Skip to content

Syntax highlighting (grammar + editor plugins) #24

Closed

Description

@JuroOravec

Syntax highlighting for Citry templates and for inline template, js, and css strings in Python component files.

Current state

  • pygments-citry 0.1.1 is published on PyPI and registers both citry and citry-html lexer entry points.
  • Its current directive-channel behavior is checked against the shared behavior-oriented conformance corpus used by editor grammars.
  • The VS Code 0.0.1 implementation is release-prepared locally. It is declarative and web-compatible: a standalone citry-html language grammar plus inline TextMate injections for exact template, js, and css triple-quoted assignments.

Syntax contract

The shared corpus covers component and structural tags, {{ ... }}, {# ... #}, raw blocks, Python-valued c-* and #c-key, bare #c-ignore, JavaScript-valued $c-props and Alpine directives, Citry Events handler references, nested templates/fragments, Unicode, and unfinished input.

Standalone template association is explicit through the language picker or project files.associations. The extension does not claim arbitrary .html files or invent a required filename suffix.

TextMate highlighting is intentionally best-effort: it cannot prove Component subclass context or fully parse every brace-heavy expression. Parser-backed region discovery and semantic intelligence belong to #23; tree-sitter remains evidence-gated.

The detailed accepted design is tracked in docs/design/ide_integration.md.

Activity

  1. added
    enhancement
    on Jul 1, 2026
  2. JuroOravec commented on Jul 30, 2026

    @JuroOravec
    MemberAuthor

    Step 2 implementation update (2026-07-30): the shared syntax corpus, aligned pygments-citry 0.1.1 package, and declarative Citry VS Code 0.0.1 extension are implemented and pass their package gates. The VS Code extension includes inline Python injection plus the explicit citry-html language, with no blanket .html association. Both artifacts are release-prepared locally. Publication remains pending a clean release commit; the current working branch is intentionally not being tagged or pushed.

  3. JuroOravec commented on Jul 30, 2026

    @JuroOravec
    MemberAuthor

    pygments-citry 0.1.1 is now published on PyPI. The package release status in this issue and the IDE design has been updated; the VS Code 0.0.1 artifact remains release-prepared locally.

  4. JuroOravec commented on Aug 30, 2026

    @JuroOravec
    MemberAuthor

    Implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions