Repository navigation
[TASK] Typed directive values - #1392
Merged
Merged
Conversation
linawolf
force-pushed
the
task/directive-value-type
branch
from
September 23, 2026 12:29
782731e to
d310d42
Compare
jaapio
requested changes
Sep 27, 2026
jaapio
left a comment
Member
There was a problem hiding this comment.
I think it's better to keep the values of directive and options separated. The values on options can differ from what we allow on directives and visa versa. It's not an issue to have duplication for this matter.
linawolf
force-pushed
the
task/directive-value-type
branch
3 times, most recently
from
October 5, 2026 15:10
8163ca2 to
bcc64df
Compare
jaapio
approved these changes
Oct 6, 2026
jaapio
force-pushed
the
task/directive-value-type
branch
from
October 6, 2026 19:24
bcc64df to
cb640e2
Compare
jaapio
enabled auto-merge
October 6, 2026 19:24
Directives have no way to declare what kind of value they accept: some take no value at all, some only plain text, a file path or inline markup. Yet DirectiveRule parses every directive value as inline markup, regardless of what it means. This change, the proposal @jaapio asked for, lets a directive declare its value type with DirectiveValueType: Empty, String, Inline, Integer, Boolean, Path, Url or Array. Restricting a directive's content type and allowed parent directives is left for follow-up work. Options keep their own OptionType: what a directive's value may be and what an option's value may be can differ, so the two stay separate. DirectiveRule now checks the value against the declared type, emitting a warning on mismatch, and parses it as inline markup only when the type is Inline. Migrated as examples: HighlightsDirective (Empty), and SectionauthorDirective and RawDirective (String, not inline markup). Signed-off-by: linawolf Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jaapio
force-pushed
the
task/directive-value-type
branch
from
October 6, 2026 20:07
cb640e2 to
9011d77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Directives have no way to declare what kind of value they accept:
some take no value at all, some only plain text, a file path or
inline markup. Yet DirectiveRule parses every directive value as
inline markup, regardless of what it means.
This change, the proposal @jaapio asked for, lets a directive declare
its value type with DirectiveValueType: Empty, String, Inline, Integer,
Boolean, Path, Url or Array. Restricting a directive's content type and
allowed parent directives is left for follow-up work.
Options keep their own OptionType: what a directive's value may be and
what an option's value may be can differ, so the two stay separate.
DirectiveRule now checks the value against the declared type,
emitting a warning on mismatch, and parses it as inline markup only
when the type is Inline.
Migrated as examples: HighlightsDirective (Empty), and
SectionauthorDirective and RawDirective (String, not inline markup).
Signed-off-by: linawolf
Assisted-By: Claude Sonnet 5 noreply@anthropic.com
Assisted-By: Claude Opus 5.5 (1M context) noreply@anthropic.com