@entropicwarrior/sdoc 0.1.10 → 0.1.11
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.
- package/README.md +66 -0
- package/lexica/sdoc-authoring.sdoc +3 -2
- package/lexica/specification.sdoc +4 -3
- package/package.json +29 -1
- package/src/notion-renderer.js +1 -0
- package/src/sdoc.js +6 -2
package/README.md
CHANGED
|
@@ -77,6 +77,72 @@ Or use the **SDOC: Browse Documents** command from the VS Code Command Palette.
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
### Inline Formatting
|
|
83
|
+
|
|
84
|
+
`*emphasis*`, `**strong**`, `~~strikethrough~~`, `` `inline code` ``, `[links](url)`, and `<https://autolinks>`.
|
|
85
|
+
|
|
86
|
+
### Semantic Markers
|
|
87
|
+
|
|
88
|
+
Annotate text with semantic meaning that renders as colored highlights:
|
|
89
|
+
|
|
90
|
+
| Syntax | Meaning | Color |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `{+text+}` | Positive | Green |
|
|
93
|
+
| `{=text=}` | Neutral | Blue |
|
|
94
|
+
| `{^text^}` | Caution | Amber |
|
|
95
|
+
| `{!text!}` | Warning | Orange |
|
|
96
|
+
| `{-text-}` | Negative | Red |
|
|
97
|
+
| `{~text~}` | Highlight | Yellow |
|
|
98
|
+
|
|
99
|
+
Markers nest with other inline formatting: `{+**all checks** passed+}`.
|
|
100
|
+
|
|
101
|
+
### Math
|
|
102
|
+
|
|
103
|
+
Inline math with `$x^2 + y^2$`, display math with `$$E = mc^2$$`, and multi-line equations with ` ```math ` code fences. Rendered via KaTeX.
|
|
104
|
+
|
|
105
|
+
### Code Blocks
|
|
106
|
+
|
|
107
|
+
Fenced with triple backticks, optional language tag for syntax highlighting. The `src:` directive includes external files inline:
|
|
108
|
+
|
|
109
|
+
````
|
|
110
|
+
```json src:./config.json lines:1-10
|
|
111
|
+
```
|
|
112
|
+
````
|
|
113
|
+
|
|
114
|
+
### Mermaid Diagrams
|
|
115
|
+
|
|
116
|
+
Code blocks tagged `mermaid` render as SVG diagrams — flowcharts, sequence diagrams, class diagrams, state diagrams, and more.
|
|
117
|
+
|
|
118
|
+
### Images
|
|
119
|
+
|
|
120
|
+
Markdown-style images with optional width and alignment:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+

|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Tables
|
|
127
|
+
|
|
128
|
+
Pipe-delimited tables with optional `borderless` and `headerless` flags.
|
|
129
|
+
|
|
130
|
+
### Lists
|
|
131
|
+
|
|
132
|
+
Bullet lists (`-`), numbered lists (`1.`), and task lists (`- [ ]` / `- [x]`). Items can have rich body content including nested lists, code blocks, and paragraphs.
|
|
133
|
+
|
|
134
|
+
### References
|
|
135
|
+
|
|
136
|
+
Tag any section with `@id` and cross-reference it anywhere with `@id` — renders as a clickable link.
|
|
137
|
+
|
|
138
|
+
### Slides
|
|
139
|
+
|
|
140
|
+
Turn any SDOC file into an HTML slide deck with themes, layouts (center, two-column), speaker notes, and PDF export.
|
|
141
|
+
|
|
142
|
+
### Custom Styling
|
|
143
|
+
|
|
144
|
+
Per-folder `sdoc.config.json` or per-file `@meta` scope for custom CSS, headers, footers, and confidentiality banners. Configs cascade from workspace root to file.
|
|
145
|
+
|
|
80
146
|
## Learning the Format
|
|
81
147
|
|
|
82
148
|
- `docs/guide/intro.sdoc` — what SDOC is and why
|
|
@@ -181,7 +181,8 @@
|
|
|
181
181
|
\`\$\$E = mc^2\$\$\` | Display math (centered)
|
|
182
182
|
\`\{+text+\}\` | Positive marker (green)
|
|
183
183
|
\`\{=text=\}\` | Neutral marker (blue)
|
|
184
|
-
\`\{
|
|
184
|
+
\`\{^text^\}\` | Caution marker (amber)
|
|
185
|
+
\`\{!text!\}\` | Warning marker (orange)
|
|
185
186
|
\`\{-text-\}\` | Negative marker (red)
|
|
186
187
|
\`\{~text~\}\` | Highlight (yellow)
|
|
187
188
|
}
|
|
@@ -353,7 +354,7 @@
|
|
|
353
354
|
{
|
|
354
355
|
Backslash escapes special characters: \`\\\\\` \`\\{\` \`\\}\` \`\\@\`
|
|
355
356
|
\`\\[\` \`\\]\` \`\\(\` \`\\)\` \`\\*\` \`\\~\` \`\\#\` \`\\!\` \`\\\<\`
|
|
356
|
-
\`\\\>\` \`\\\$\` \`\\+\` \`\\=\` \`\\-\`
|
|
357
|
+
\`\\\>\` \`\\\$\` \`\\+\` \`\\=\` \`\\-\` \`\\^\`
|
|
357
358
|
|
|
358
359
|
A line starting with \`\\#\` renders as a literal \`#\` (not a heading). Use \`\\\$\` to prevent a dollar sign from starting math mode.
|
|
359
360
|
}
|
|
@@ -454,7 +454,8 @@ Content of Section B.
|
|
|
454
454
|
- Display math: `$$E = mc^2$$` (centered block)
|
|
455
455
|
- Positive marker: `{+text+}` (green highlight)
|
|
456
456
|
- Neutral marker: `{=text=}` (blue highlight)
|
|
457
|
-
-
|
|
457
|
+
- Caution marker: `{^text^}` (amber highlight)
|
|
458
|
+
- Warning marker: `{!text!}` (orange highlight)
|
|
458
459
|
- Negative marker: `{-text-}` (red highlight)
|
|
459
460
|
- Highlight: `{~text~}` (yellow highlight)
|
|
460
461
|
}
|
|
@@ -464,7 +465,7 @@ Content of Section B.
|
|
|
464
465
|
|
|
465
466
|
# Escaping @escaping
|
|
466
467
|
{
|
|
467
|
-
In normal text (including headings and paragraphs), a backslash escapes: `\\` `\{` `\}` `\@` `\[` `\]` `\(` `\)` `\*` `\~` `\#` `\!` `\<` `\>` `\$` `\+` `\=` `\-` and `` \` ``.
|
|
468
|
+
In normal text (including headings and paragraphs), a backslash escapes: `\\` `\{` `\}` `\@` `\[` `\]` `\(` `\)` `\*` `\~` `\#` `\!` `\<` `\>` `\$` `\+` `\=` `\-` `\^` and `` \` ``.
|
|
468
469
|
|
|
469
470
|
Escapes are processed before reference detection.
|
|
470
471
|
|
|
@@ -788,7 +789,7 @@ Content of Section A.
|
|
|
788
789
|
- Comment syntax (if any)
|
|
789
790
|
- Duplicate ID resolution (error vs warning vs nearest-scope)
|
|
790
791
|
- Additional list types (checkboxes, alpha, roman)
|
|
791
|
-
- Additional inline formatting (underline
|
|
792
|
+
- Additional inline formatting (underline)
|
|
792
793
|
}
|
|
793
794
|
}
|
|
794
795
|
}
|
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.1.
|
|
5
|
+
"version": "0.1.11",
|
|
6
6
|
"publisher": "entropicwarrior",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -113,6 +113,34 @@
|
|
|
113
113
|
"configurationDefaults": {
|
|
114
114
|
"[sdoc]": {
|
|
115
115
|
"editor.wordWrap": "on"
|
|
116
|
+
},
|
|
117
|
+
"editor.tokenColorCustomizations": {
|
|
118
|
+
"textMateRules": [
|
|
119
|
+
{
|
|
120
|
+
"scope": "markup.quote.sdoc",
|
|
121
|
+
"settings": {
|
|
122
|
+
"foreground": "#3b82c3"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"scope": "markup.changed.sdoc",
|
|
127
|
+
"settings": {
|
|
128
|
+
"foreground": "#b08a1a"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"scope": "markup.keyword.warning.sdoc",
|
|
133
|
+
"settings": {
|
|
134
|
+
"foreground": "#d97706"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"scope": "markup.other.highlight.sdoc",
|
|
139
|
+
"settings": {
|
|
140
|
+
"foreground": "#a68a00"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
116
144
|
}
|
|
117
145
|
},
|
|
118
146
|
"languageModelTools": [
|
package/src/notion-renderer.js
CHANGED
package/src/sdoc.js
CHANGED
|
@@ -8,7 +8,7 @@ const COMMAND_LIST_NUMBER = "{[#]";
|
|
|
8
8
|
const COMMAND_TABLE = "{[table]";
|
|
9
9
|
const COMMAND_CODE_FENCE = "```";
|
|
10
10
|
|
|
11
|
-
const ESCAPABLE = new Set(["\\", "{", "}", "@", "[", "]", "(", ")", "*", "`", "#", "!", "~", "<", ">", "$", "+", "=", "-"]);
|
|
11
|
+
const ESCAPABLE = new Set(["\\", "{", "}", "@", "[", "]", "(", ")", "*", "`", "#", "!", "~", "<", ">", "$", "+", "=", "-", "^"]);
|
|
12
12
|
|
|
13
13
|
let _katex = null;
|
|
14
14
|
let _katexLoaded = false;
|
|
@@ -1205,6 +1205,7 @@ function parseInline(text) {
|
|
|
1205
1205
|
let mt = null;
|
|
1206
1206
|
if (mc === "+") mt = "mark_positive";
|
|
1207
1207
|
else if (mc === "=") mt = "mark_neutral";
|
|
1208
|
+
else if (mc === "^") mt = "mark_caution";
|
|
1208
1209
|
else if (mc === "!") mt = "mark_warning";
|
|
1209
1210
|
else if (mc === "-") mt = "mark_negative";
|
|
1210
1211
|
else if (mc === "~") mt = "mark_highlight";
|
|
@@ -1365,6 +1366,8 @@ function renderInlineNodes(nodes) {
|
|
|
1365
1366
|
return `<span class="sdoc-mark sdoc-mark-positive">${renderInlineNodes(node.children)}</span>`;
|
|
1366
1367
|
case "mark_neutral":
|
|
1367
1368
|
return `<span class="sdoc-mark sdoc-mark-neutral">${renderInlineNodes(node.children)}</span>`;
|
|
1369
|
+
case "mark_caution":
|
|
1370
|
+
return `<span class="sdoc-mark sdoc-mark-caution">${renderInlineNodes(node.children)}</span>`;
|
|
1368
1371
|
case "mark_warning":
|
|
1369
1372
|
return `<span class="sdoc-mark sdoc-mark-warning">${renderInlineNodes(node.children)}</span>`;
|
|
1370
1373
|
case "mark_negative":
|
|
@@ -1928,7 +1931,8 @@ const DEFAULT_STYLE = `
|
|
|
1928
1931
|
}
|
|
1929
1932
|
.sdoc-mark-positive { background-color: rgba(34, 139, 34, 0.15); color: #166016; }
|
|
1930
1933
|
.sdoc-mark-neutral { background-color: rgba(59, 130, 195, 0.15); color: #245d8a; }
|
|
1931
|
-
.sdoc-mark-
|
|
1934
|
+
.sdoc-mark-caution { background-color: rgba(200, 150, 30, 0.18); color: #7a5f0e; }
|
|
1935
|
+
.sdoc-mark-warning { background-color: rgba(255, 120, 0, 0.18); color: #b35400; }
|
|
1932
1936
|
.sdoc-mark-negative { background-color: rgba(187, 50, 50, 0.15); color: #911e1e; }
|
|
1933
1937
|
.sdoc-mark-highlight { background-color: rgba(255, 255, 0, 0.75); }
|
|
1934
1938
|
|