@entropicwarrior/sdoc 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -307,7 +307,7 @@ Content of Section B.
|
|
|
307
307
|
|
|
308
308
|
# References @references
|
|
309
309
|
{
|
|
310
|
-
Assign a slug with \`@slug\` on a heading, then reference it
|
|
310
|
+
Assign a slug with \`@slug\` on a heading, then reference it elsewhere in the same document with \`@slug\`:
|
|
311
311
|
|
|
312
312
|
```
|
|
313
313
|
# Setup @setup {
|
|
@@ -318,6 +318,14 @@ Content of Section B.
|
|
|
318
318
|
Make sure you complete @setup first.
|
|
319
319
|
}
|
|
320
320
|
```
|
|
321
|
+
|
|
322
|
+
References are **document-local only** — \`@slug\` resolves within the current file. To point a reader to a section in another file, use a link with a fragment:
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
See [Setup](./other-file.sdoc#setup) for details.
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Do not write \`@setup\` when the target scope is in a different file — it will be flagged as a broken reference.
|
|
321
329
|
}
|
|
322
330
|
|
|
323
331
|
# Code Blocks @code-blocks
|
|
@@ -672,6 +680,25 @@ Content of Section B.
|
|
|
672
680
|
```
|
|
673
681
|
}
|
|
674
682
|
|
|
683
|
+
# Cross-Document @slug References @cross-doc-refs
|
|
684
|
+
{
|
|
685
|
+
\`@slug\` references are document-local. Using \`@slug\` to refer to a section in another file produces a broken reference error:
|
|
686
|
+
|
|
687
|
+
**Wrong** — \`@setup\` does not exist in this file:
|
|
688
|
+
|
|
689
|
+
```
|
|
690
|
+
See `getting-started.sdoc` @setup for installation steps.
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
**Right** — use a link with a fragment:
|
|
694
|
+
|
|
695
|
+
```
|
|
696
|
+
See [Setup](./getting-started.sdoc#setup) for installation steps.
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
The fragment (\`#setup\`) matches the target scope's \`@id\`. Use \`\\@\` if you need a literal \`@\` in text without triggering reference resolution.
|
|
700
|
+
}
|
|
701
|
+
|
|
675
702
|
# @References Inside Link Labels @refs-in-link-labels
|
|
676
703
|
{
|
|
677
704
|
Inline \`@references\` are parsed everywhere, including inside link labels. If you mention a scope ID in a link label, escape the \`@\` to prevent it being treated as a reference to the current document:
|
|
@@ -393,6 +393,8 @@ Content of Section B.
|
|
|
393
393
|
{
|
|
394
394
|
{[.]
|
|
395
395
|
- A reference is `@id` in text (unescaped)
|
|
396
|
+
- References are document-local: `@id` resolves to a scope within the same file only. Cross-document reference syntax may be introduced in a future version but is not part of v0.2
|
|
397
|
+
- To link to a section in another file, use a standard link with a fragment: `[Label](./other-file.sdoc#section-id)`
|
|
396
398
|
- References link to the scope with that ID
|
|
397
399
|
- ID uniqueness is strongly recommended; tooling may warn on duplicates
|
|
398
400
|
- References are parsed inside link labels — use `\@` to include a literal `@` in a link label without triggering a reference
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@entropicwarrior/sdoc",
|
|
3
3
|
"displayName": "SDOC",
|
|
4
4
|
"description": "A plain-text documentation format with explicit brace scoping — deterministic parsing, AI-agent efficiency, and 10-50x token savings vs Markdown.",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.3",
|
|
6
6
|
"publisher": "entropicwarrior",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|