Skip to content

Highlight schema syntax templates in the reference - #4940

Merged
sebastiannberg merged 3 commits into
masterfrom
johsol/highlight-schema-templates
Oct 9, 2026
Merged

sebastiannberg merged 3 commits into
masterfrom
johsol/highlight-schema-templates

Conversation

@johansolbakken

Copy link
Copy Markdown
Contributor

Highlights the syntax templates in the schema reference and the .model file reference, such as

field [name] type [type-name] {
    [body]
}
  • A new Rouge extension, _plugins/rouge_schema_placeholders.rb, colors a bracketed placeholder in schema code as one emphasized token, like the XML placeholders in _plugins/rouge_xml_placeholders.rb. Without it, words in a placeholder are colored as schema, e.g. type in [type-name] as a keyword. A placeholder starts with a letter and does not follow a name, a closing bracket or ):, so tensor dimensions (x[384]) and tensor values (tensor(x[3]):[1, 2, 3]) are not affected. None of the schema blocks already highlighted on the site changes.
  • Tags 67 templates in schemas.html and model-files.html as schema, and the inputs and constants examples in schemas.html. Links in the templates are kept.
  • Fixes tensor(key{}]) to tensor(key{}) in the constants example.

The overview of schema elements at the top of schemas.html and the query syntax [field-name].[component-name]:term stay plain.

🤖 Generated with Claude Code

johansolbakken and others added 3 commits October 9, 2026 13:27
Syntax templates in the schema reference write placeholders such as [name] and
[type-name]. Color a bracketed placeholder as one emphasized token, so that words
in it, like "type" in [type-name], are not colored as schema keywords. Tensor
dimensions and tensor values in brackets are not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tag the syntax templates in the schema reference and the .model file reference
as schema, and the inputs and constants examples in the schema reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sebastiannberg
sebastiannberg merged commit cdaf872 into master Oct 9, 2026
2 checks passed
@sebastiannberg
sebastiannberg deleted the johsol/highlight-schema-templates branch October 9, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants