Skip to content

feat(cli): support local code directives - #2259

Open
kadymov wants to merge 4 commits into
masterfrom
DOCSTOOLS-6666-code-directive
Open

kadymov wants to merge 4 commits into
masterfrom
DOCSTOOLS-6666-code-directive

Conversation

@kadymov

@kadymov kadymov commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add OSS CLI support for local {% code %} directives in HTML and md2md builds
  • support relative/input-root paths, lang, numeric and marker ranges, and keep-indents
  • keep fenced examples and jsonpath directives unchanged for compatibility
  • report invalid ranges and inaccessible files as build errors with safe placeholders
  • add focused unit and integration coverage

Testing

  • npm test — 2008 passed, 1 skipped
  • npm run typecheck
  • npm run lint
  • npm run build
  • npx vitest run -c vitest.integration.config.ts tests/e2e/code-includer.spec.ts
  • built the documentation repository with the locally built CLI

Related

- skip {% code %} directives inside HTML comments (mirror {% include %})
- treat a single lines marker as 'from marker to end of file'
- drop redundant attribute branch in the directive tokenizer
@sonarqubecloud

Copy link
Copy Markdown

@kadymov
kadymov marked this pull request as ready for review September 17, 2026 11:59
@kadymov
kadymov requested review from a team and diplodoc-bot as code owners September 17, 2026 11:59
@kadymov
kadymov requested review from Yurok868 and reazy015 and removed request for a team September 17, 2026 11:59
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.

1 participant