You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convert AsciiDoc documents to Markdown for agentic consumption, with a focus on preserving semantic structure and document frontmatter.
100
100
See <<markdowngrade>>.
101
101
102
-
AsciiDoc source inspection::
102
+
AsciiDoc and Markdown source inspection::
103
103
Skim AsciiDoc documents to produce machine-oriented outlines of sections, code blocks, tables, and other semantic elements for tooling and agent consumption.
104
104
See <<source-skim>>.
105
105
@@ -300,20 +300,21 @@ Override it per call with the `canonical_prefix:` keyword argument.
300
300
Canonical blocks use AsciiDoc-style `tag::`/`end::` markers embedded inside comments.
301
301
Three comment styles are recognized so the same prime can manage files of any type:
302
302
303
-
[cols="3m,5m",options="header"]
303
+
[cols="3,5m",options="header"]
304
304
|===
305
305
| Style | Example
306
-
| HTML / Markdown comment
307
-
| <!-- tag::universal-intro[] -->
308
-
| AsciiDoc line comment
306
+
| HTML / Markdown
307
+
| <!-- tag::universal-intro[] +++-->+++
308
+
| AsciiDoc / JavaScript
309
309
| // tag::universal-intro[]
310
-
| Shell / Ruby / YAML comment
310
+
| Shell / Ruby / YAML / INI
311
311
| # tag::universal-intro[]
312
312
|===
313
313
314
-
The trailing `[]` is optional in all three styles.
314
+
A block with tag names beginning with the configured prefix (default `universal-`) is treated as canonical and managed by Sync/Cast.
315
+
316
+
Any block wrapped in `tag::_skip[]` and `end::_skip[]` will _not_ be passed from prime to target even during the init operation.
315
317
316
-
A tag whose name begins with the configured prefix (default `universal-`) is treated as canonical and managed by Sync/Cast.
317
318
All other tagged regions in a target file are left entirely alone, and their presence beside a canonical block never triggers a warning.
318
319
319
320
[[sync-cast-operations]]
@@ -322,6 +323,8 @@ All other tagged regions in a target file are left entirely alone, and their pre
322
323
init::
323
324
One-time operation that renders the prime template (the whole file, not just canonical blocks) through Liquid and writes the result as a new target file.
324
325
Use this to bootstrap a repo-local copy of a project template.
326
+
+
327
+
NOTE: Only blocks marked `_skip` are not carried over.
325
328
326
329
sync::
327
330
Ongoing operation that scans for canonical blocks, replaces their content with the prime version (after optional Liquid rendering), and leaves everything else verbatim.
@@ -354,6 +357,18 @@ This is {{ data.variables.name }} version {{ data.variables.version }}.
354
357
<!-- end::universal-intro[] -->
355
358
----
356
359
360
+
Since each block is rendered independently, variables cannot reference content from other blocks.
361
+
Use a segment wrapped in `_liquid` tags to set variables inline that will be used across all subsequent blocks.
362
+
This `_liquid` segment only has access to variables passed into the main render call, not to any content blocks.
363
+
364
+
[source,markdown]
365
+
----
366
+
<!-- tag::_liquid -->
367
+
{%- assign name = data.variables.this_proj_name | default: 'Unknown Project' %}
368
+
{%- assign version = data.variables.this_prod_vrsn | default: '0.0.0' %}
369
+
<!-- end::_liquid -->
370
+
----
371
+
357
372
[[sync-cast-bootstrap]]
358
373
==== Bootstrap example
359
374
@@ -362,7 +377,7 @@ This is {{ data.variables.name }} version {{ data.variables.version }}.
Pass `forms: [:tree]` (default), `forms: [:flat]`, or both.
448
470
Tree shape preserves nesting; flat shape adds `parent_id` and expresses child section IDs as an array.
449
471
450
472
Categories::
473
+
(AsciiDoc skims only.)
451
474
Default output includes `attributes_custom`, `definition_lists`, `code_blocks`, `literal_blocks`, `examples`, `sidebars`, `tables`, and `images`.
452
475
Opt-in only (excluded by default): `attributes_builtin`, `admonitions`, `quotes`.
453
476
Pass `categories:` with an explicit array of symbols to restrict or expand output.
@@ -457,6 +480,7 @@ The skim output schema is at `specs/data/asciidoc-source-skim.schema.json` and a
457
480
458
481
[[skim-asciidoctor-extension]]
459
482
==== Asciidoctor extension
483
+
460
484
`Sourcerer::SourceSkim::TreeProcessorExtension` integrates SourceSkim into Asciidoctor parsing pipelines.
461
485
It stores the result as the `source-skim-result` document attribute and reads `source-skim-forms` and `source-skim-categories` document attributes for per-document configuration.
462
486
@@ -620,9 +644,10 @@ Use them as examples or utilities but do not rely on them in production.
0 commit comments