apexfile 1.1.0
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/LICENSE +94 -0
- package/README.md +415 -0
- package/bin/cli.js +334 -0
- package/package.json +59 -0
- package/src/ast/index.js +260 -0
- package/src/index.js +438 -0
- package/src/parser/index.js +594 -0
- package/src/renderer/html.js +983 -0
- package/src/resolver/index.js +442 -0
- package/src/tokenizer/index.js +518 -0
- package/src/tokenizer/tokens.js +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Boniface Njuguna
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
───────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
ADDITIONAL GRANT — APEXDOC FORMAT SPECIFICATION
|
|
26
|
+
|
|
27
|
+
The ApexDoc document format specification (the ".apx format"), including its
|
|
28
|
+
syntax rules, block definitions, token types, AST structure, and all associated
|
|
29
|
+
format documentation, is hereby declared open and permanently free.
|
|
30
|
+
|
|
31
|
+
This additional grant clarifies and extends the permissions above specifically
|
|
32
|
+
for the purpose of format interoperability:
|
|
33
|
+
|
|
34
|
+
1. IMPLEMENTATION FREEDOM
|
|
35
|
+
Any person or organization may implement a parser, renderer, tokenizer,
|
|
36
|
+
editor, validator, converter, or any other tool that reads, writes, or
|
|
37
|
+
processes files in the ApexDoc (.apx) format without requiring permission,
|
|
38
|
+
payment, license fees, or attribution to this project, subject only to
|
|
39
|
+
the condition in clause 3 below.
|
|
40
|
+
|
|
41
|
+
2. COMPATIBLE IMPLEMENTATIONS
|
|
42
|
+
Any implementation that correctly parses and renders a superset or subset
|
|
43
|
+
of the ApexDoc format specification may call itself "ApexDoc-compatible"
|
|
44
|
+
provided it documents clearly which parts of the specification it supports
|
|
45
|
+
and which it does not.
|
|
46
|
+
|
|
47
|
+
3. FORMAT SPECIFICATION ATTRIBUTION
|
|
48
|
+
Implementations that claim full compliance with the ApexDoc format
|
|
49
|
+
specification must reference the authoritative specification at
|
|
50
|
+
https://github.com/bonifacenjuguna/apexdoc as the source of that
|
|
51
|
+
specification. Partial implementations need not do so but are encouraged to.
|
|
52
|
+
|
|
53
|
+
4. FORKING THE SPECIFICATION
|
|
54
|
+
You may fork the ApexDoc specification and create a derived format. A
|
|
55
|
+
derived format may not be called "ApexDoc" without permission from the
|
|
56
|
+
original author, but may be called anything else including "Based on
|
|
57
|
+
ApexDoc", "ApexDoc-derived", or any entirely new name.
|
|
58
|
+
|
|
59
|
+
5. DOCUMENT FILES
|
|
60
|
+
Files in the ApexDoc format (.apx files) authored by any person are owned
|
|
61
|
+
entirely by their author. This license does not claim ownership of, or
|
|
62
|
+
impose any restrictions on, document files created using the ApexDoc format
|
|
63
|
+
or this software.
|
|
64
|
+
|
|
65
|
+
───────────────────────────────────────────────────────────────────────────────
|
|
66
|
+
|
|
67
|
+
THIRD-PARTY ACKNOWLEDGEMENTS
|
|
68
|
+
|
|
69
|
+
ApexDoc draws syntactic inspiration from the following open-source projects
|
|
70
|
+
and standards. No code from these projects is included in this distribution,
|
|
71
|
+
but their design philosophies shaped the ApexDoc format:
|
|
72
|
+
|
|
73
|
+
- Markdown (John Gruber, 2004) — heading, list, emphasis, and link syntax
|
|
74
|
+
- CommonMark Specification (various authors) — Markdown formalization
|
|
75
|
+
- AsciiDoc (Stuart Rackham, 2002) — directive/block syntax inspiration
|
|
76
|
+
- LaTeX (Leslie Lamport, 1984) — mathematical notation and academic structure
|
|
77
|
+
- SCSS / Sass (Hampton Catlin, 2007) — CSS variable and nesting conventions
|
|
78
|
+
- Jinja2 (Armin Ronacher, 2008) — template logic syntax (@if, @each, @set)
|
|
79
|
+
- Mermaid.js (Knut Sveidqvist, 2014) — diagram-from-text philosophy
|
|
80
|
+
- MDX (various authors, 2018) — component-in-document concept
|
|
81
|
+
- Reveal.js (Hakim El Hattab, 2011) — presentation mode conventions
|
|
82
|
+
|
|
83
|
+
Their work made the document tooling ecosystem what it is today. ApexDoc
|
|
84
|
+
exists to build on that foundation and push it further.
|
|
85
|
+
|
|
86
|
+
───────────────────────────────────────────────────────────────────────────────
|
|
87
|
+
|
|
88
|
+
CONTACT
|
|
89
|
+
|
|
90
|
+
Boniface Njuguna
|
|
91
|
+
GitHub: https://github.com/bonifacenjuguna
|
|
92
|
+
npm: https://npmjs.com/~bonifacenjuguna
|
|
93
|
+
Email: hello@apex.run
|
|
94
|
+
Website: https://apex.run
|
package/README.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="./icons/apex-logo.svg" width="120" alt="ApexDoc Logo" />
|
|
4
|
+
|
|
5
|
+
# ApexDoc
|
|
6
|
+
|
|
7
|
+
### One file. Every format. No compromises.
|
|
8
|
+
|
|
9
|
+
[](https://npmjs.com/package/apexdoc)
|
|
10
|
+
[](https://pypi.org/project/apexdoc)
|
|
11
|
+
[](./LICENSE)
|
|
12
|
+
[](#)
|
|
13
|
+
[](https://marketplace.visualstudio.com/items?itemName=bonifacenjuguna.apexdoc)
|
|
14
|
+
|
|
15
|
+
**[Get Started](#quick-start) · [Full Syntax Reference](./SPEC.md) · [Plugins](./PLUGINS.md) · [Themes](./THEMES.md) · [Playground](https://apex.run/play)**
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What is ApexDoc?
|
|
22
|
+
|
|
23
|
+
ApexDoc is an open document format — file extension `.apx` — that unifies everything writers, developers, scientists, and designers need into a single, human-readable file.
|
|
24
|
+
|
|
25
|
+
Where Markdown stops at basic formatting, ApexDoc keeps going. Where LaTeX handles math beautifully but nothing else, ApexDoc handles everything. Where HTML gives you full power but demands full expertise, ApexDoc gives you the same power with a syntax anyone can learn in an afternoon.
|
|
26
|
+
|
|
27
|
+
A single `.apx` file can simultaneously be:
|
|
28
|
+
|
|
29
|
+
- A **technical document** with full LaTeX math, theorems, and chemical equations
|
|
30
|
+
- A **data dashboard** with live charts, stat cards, and real-time feeds
|
|
31
|
+
- A **presentation** with slide transitions, speaker notes, and presenter timer
|
|
32
|
+
- A **design system** with CSS variables, named themes, and custom color palettes
|
|
33
|
+
- An **interactive application** with polls, quizzes, kanban boards, and countdowns
|
|
34
|
+
- An **animated experience** with scroll-triggered effects and particle backgrounds
|
|
35
|
+
|
|
36
|
+
All from one file. All with a clean, readable syntax. All exportable to HTML, PDF, Markdown, slides, and plain text — without touching the source.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## The Problem with Document Formats
|
|
41
|
+
|
|
42
|
+
Every format ever designed was built to solve one specific problem. As a result, every format created several new ones.
|
|
43
|
+
|
|
44
|
+
**Markdown** is elegant for notes and READMEs. Try adding a LaTeX equation, a bar chart, a switchable dark-mode theme, or an interactive quiz. You cannot. You are now outside Markdown, stitching five tools together and paying the maintenance cost of that decision forever.
|
|
45
|
+
|
|
46
|
+
**HTML** can do everything Markdown cannot. But the moment you want a source file that a non-developer can read, write, and maintain — let alone version-control meaningfully — HTML becomes an obstacle, not a tool.
|
|
47
|
+
|
|
48
|
+
**LaTeX** is the gold standard for mathematics and academic typesetting. It cannot be read without compilation. It has no concept of themes, live data, or interactivity. Setup takes hours, mastery takes months.
|
|
49
|
+
|
|
50
|
+
**PDF** is the most universally portable format on earth. It also cannot be edited in place, reflowed to different screen sizes, or made interactive without specialized tooling.
|
|
51
|
+
|
|
52
|
+
The real problem is not any single format. The real problem is that the world has accepted a reality where every document type demands a different tool, a different syntax, a different mental model, and a different export pipeline — and we maintain separate versions of the same content in five formats simultaneously.
|
|
53
|
+
|
|
54
|
+
ApexDoc is the answer to this fragmentation. Not by being acceptable at everything, but by being genuinely excellent — absorbing the best syntax conventions from each major format and unifying them under one coherent, learnable design.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
### Document & Content
|
|
61
|
+
Familiar Markdown-style syntax for headings, paragraphs, lists, blockquotes, footnotes, horizontal rules, and tables. Callout blocks — notes, tips, warnings, dangers — in a single line. Collapsible sections, tabbed panels, multi-column grids, reusable component definitions, and cross-document imports.
|
|
62
|
+
|
|
63
|
+
### Mathematics & Science
|
|
64
|
+
Full LaTeX math, inline (`$E = mc^2$`) and block (`%%math`). Chemical notation with `%%chem`. AsciiMath as a simpler alternative. Theorem, proof, lemma, and corollary blocks with automatic numbering. Greek symbols, calculus operators, matrix rendering, summations, integrals. Everything a scientist or engineer needs, zero external dependencies.
|
|
65
|
+
|
|
66
|
+
### Design & Theming
|
|
67
|
+
A CSS-variable system lets you define your entire visual language inside `%%style`. Switch between named themes — `dark-ocean`, `neon-city`, `sunset`, `minimal-light`, `terminal` — with one line. Build custom themes. Every color, font, spacing unit, shadow, and radius is a variable you own.
|
|
68
|
+
|
|
69
|
+
### Data & Charts
|
|
70
|
+
Embed JSON or CSV data inline. Fetch from live REST APIs with configurable refresh intervals. Render bar, line, pie, scatter, area, donut, and heatmap charts directly from your data. Display stat cards and KPI dashboards. Animate counters and progress bars on scroll.
|
|
71
|
+
|
|
72
|
+
### Animations
|
|
73
|
+
Fade, slide, zoom, bounce, flip, blur, glitch — apply to any block. Trigger on load, scroll, hover, or click. Stagger children with timing delays. Define custom `@keyframe` sequences. Import Lottie JSON animations. Scatter particles across backgrounds.
|
|
74
|
+
|
|
75
|
+
### Live & Interactive
|
|
76
|
+
Embed a live clock. Countdown to any date. Pull WebSocket streams and render them live. Add polls readers can vote in. Create quizzes with instant feedback. Build kanban boards, event timelines, rating widgets, interactive sliders, signature pads, and modal popups — all in `.apx` syntax, zero JavaScript knowledge required.
|
|
77
|
+
|
|
78
|
+
### Presentation Mode
|
|
79
|
+
One metadata field — `mode: presentation` — turns every `%%slide` block into a slide. Full transition effects, speaker notes, presenter timer, slide thumbnails, and remote control via QR code. Export to standalone HTML slides or PDF.
|
|
80
|
+
|
|
81
|
+
### Logic & Variables
|
|
82
|
+
Define variables with `@set`. Write `@if`/`@elseif`/`@else` conditionals. Loop with `@each`. Evaluate expressions inline — `{price * 1.1 | currency}`. Call built-in functions: `{today()}`, `{uuid()}`, `{wordCount()}`, `{random(1,100)}`. Apply pipe filters for formatting and transformation.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Quick Start
|
|
87
|
+
|
|
88
|
+
### Install
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Global CLI — the fastest way to start
|
|
92
|
+
npm install -g apexdoc
|
|
93
|
+
|
|
94
|
+
# As a library in your project
|
|
95
|
+
npm install apexdoc
|
|
96
|
+
|
|
97
|
+
# Python
|
|
98
|
+
pip install apexdoc
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Your First Document
|
|
102
|
+
|
|
103
|
+
Save this as `hello.apx`:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
%%meta
|
|
107
|
+
title: "Hello, ApexDoc"
|
|
108
|
+
author: "Your Name"
|
|
109
|
+
theme: dark-ocean
|
|
110
|
+
%%end
|
|
111
|
+
|
|
112
|
+
%%style
|
|
113
|
+
--primary: #00f5d4
|
|
114
|
+
--bg: #0d0d0d
|
|
115
|
+
%%end
|
|
116
|
+
|
|
117
|
+
%%body
|
|
118
|
+
|
|
119
|
+
# Hello, ApexDoc {color: var(--primary)}
|
|
120
|
+
|
|
121
|
+
A paragraph with **bold**, _italic_, and $E = mc^2$ inline math.
|
|
122
|
+
|
|
123
|
+
%%note
|
|
124
|
+
This is a note callout. It supports **any** inline formatting.
|
|
125
|
+
%%end
|
|
126
|
+
|
|
127
|
+
- [x] Math rendering
|
|
128
|
+
- [x] Themes and color variables
|
|
129
|
+
- [x] Charts and live data
|
|
130
|
+
- [~] Your imagination
|
|
131
|
+
|
|
132
|
+
%%chart {type: bar, data: [40,80,60,95], labels: [Q1,Q2,Q3,Q4], title: "Revenue", animated: true}%%end
|
|
133
|
+
|
|
134
|
+
%%end
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
apex serve hello.apx # Live preview at http://localhost:3000
|
|
139
|
+
apex build hello.apx # Compile to hello.html
|
|
140
|
+
apex export hello.apx --to pdf
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### API — Node.js
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
const apex = require('apexdoc');
|
|
147
|
+
|
|
148
|
+
// One line
|
|
149
|
+
const html = apex.compile('./report.apx', 'html');
|
|
150
|
+
|
|
151
|
+
// Step by step
|
|
152
|
+
const ast = apex.parse('./report.apx');
|
|
153
|
+
const html = apex.render(ast, 'html');
|
|
154
|
+
const text = apex.render(ast, 'text');
|
|
155
|
+
const json = apex.render(ast, 'json');
|
|
156
|
+
|
|
157
|
+
// Write to file
|
|
158
|
+
apex.export('./report.apx', 'html', './dist/report.html');
|
|
159
|
+
|
|
160
|
+
// Validate
|
|
161
|
+
const { valid, errors, warnings } = apex.lint('./report.apx');
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### API — Python
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
import apexdoc
|
|
168
|
+
|
|
169
|
+
html = apexdoc.compile("report.apx", target="html")
|
|
170
|
+
|
|
171
|
+
ast = apexdoc.parse("report.apx")
|
|
172
|
+
html = apexdoc.render(ast, target="html")
|
|
173
|
+
|
|
174
|
+
apexdoc.export("report.apx", target="pdf", output="./dist/report.pdf")
|
|
175
|
+
|
|
176
|
+
result = apexdoc.lint("report.apx")
|
|
177
|
+
print(result["valid"], result["errors"])
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Syntax Overview
|
|
183
|
+
|
|
184
|
+
> The complete format specification — every block, every prop, every token, every error code — lives in **[SPEC.md](./SPEC.md)**.
|
|
185
|
+
|
|
186
|
+
### File Structure
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
%%meta ← document configuration
|
|
190
|
+
%%style ← CSS variables, themes, fonts
|
|
191
|
+
%%body ← all content
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
All three sections are optional. A file with no sections is treated as a bare `%%body`.
|
|
195
|
+
|
|
196
|
+
### Inline Formatting
|
|
197
|
+
|
|
198
|
+
| Syntax | Output |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `**bold**` | bold |
|
|
201
|
+
| `_italic_` | italic |
|
|
202
|
+
| `__underline__` | underline |
|
|
203
|
+
| `~~strikethrough~~` | strikethrough |
|
|
204
|
+
| `` `code` `` | inline code |
|
|
205
|
+
| `==highlight==` | highlighted |
|
|
206
|
+
| `^^super^^` | superscript |
|
|
207
|
+
| `,,sub,,` | subscript |
|
|
208
|
+
| `$E = mc^2$` | LaTeX math |
|
|
209
|
+
| `{today()}` | current date |
|
|
210
|
+
| `[text](url)` | hyperlink |
|
|
211
|
+
| `[red]{color: red}` | styled span |
|
|
212
|
+
| `[word]{tooltip: "hint"}` | tooltip |
|
|
213
|
+
|
|
214
|
+
### Block Syntax
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
%%blockname {prop: value, prop: value}
|
|
218
|
+
Content here. Supports all inline formatting.
|
|
219
|
+
Supports nesting.
|
|
220
|
+
%%end
|
|
221
|
+
|
|
222
|
+
%%selfclosing {prop: value}%%end
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Logic
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
@set price = 49.99
|
|
229
|
+
@set users = ["Alice", "Bob", "Carol"]
|
|
230
|
+
|
|
231
|
+
Total: ${price * 1.1 | currency("USD")}
|
|
232
|
+
|
|
233
|
+
@if price == 0
|
|
234
|
+
Free tier.
|
|
235
|
+
@else
|
|
236
|
+
Paid: {price}
|
|
237
|
+
@end
|
|
238
|
+
|
|
239
|
+
@each user in users
|
|
240
|
+
- {user}
|
|
241
|
+
@end
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Block Types
|
|
247
|
+
|
|
248
|
+
50+ blocks ship with ApexDoc. A selection:
|
|
249
|
+
|
|
250
|
+
| Block | Renders |
|
|
251
|
+
|---|---|
|
|
252
|
+
| `%%box` | Styled container — bg, border, radius, padding |
|
|
253
|
+
| `%%note` / `%%tip` / `%%warning` / `%%danger` | Callout blocks with icons |
|
|
254
|
+
| `%%code` | Syntax-highlighted code, copy button, line numbers |
|
|
255
|
+
| `%%math` | LaTeX block equation with optional numbering |
|
|
256
|
+
| `%%chem` | Chemical equation notation |
|
|
257
|
+
| `%%theorem` / `%%proof` / `%%lemma` | Academic math blocks |
|
|
258
|
+
| `%%table` | Striped, sortable, bordered tables |
|
|
259
|
+
| `%%chart` | Bar, line, pie, scatter, donut, heatmap |
|
|
260
|
+
| `%%data` | Inline JSON/CSV or live API data source |
|
|
261
|
+
| `%%stats` | Stat cards and KPI dashboard |
|
|
262
|
+
| `%%tabs` | Tabbed content panels |
|
|
263
|
+
| `%%collapse` | Expandable/collapsible section |
|
|
264
|
+
| `%%grid` | Responsive multi-column layout |
|
|
265
|
+
| `%%animate` | Any block with scroll or load animation |
|
|
266
|
+
| `%%stagger` | Children animate in sequence |
|
|
267
|
+
| `%%slide` | Presentation slide |
|
|
268
|
+
| `%%timeline` | Vertical/horizontal event timeline |
|
|
269
|
+
| `%%kanban` | Task board |
|
|
270
|
+
| `%%poll` | Live voting widget |
|
|
271
|
+
| `%%quiz` | Multiple-choice quiz with feedback |
|
|
272
|
+
| `%%countdown` | Live countdown to a date |
|
|
273
|
+
| `%%clock` | Live digital clock |
|
|
274
|
+
| `%%qr` | QR code from URL or text |
|
|
275
|
+
| `%%terminal` | Styled terminal output |
|
|
276
|
+
| `%%diff` | Code diff — added/removed lines |
|
|
277
|
+
| `%%gallery` | Image grid with lightbox |
|
|
278
|
+
| `%%mindmap` | Tree diagram |
|
|
279
|
+
| `%%flowchart` | Flow diagram from text |
|
|
280
|
+
| `%%modal` | Popup dialog |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Themes
|
|
285
|
+
|
|
286
|
+
| Theme | Character |
|
|
287
|
+
|---|---|
|
|
288
|
+
| `dark-ocean` | Deep blue — the ApexDoc signature |
|
|
289
|
+
| `neon-city` | Cyberpunk neons on near-black |
|
|
290
|
+
| `sunset` | Warm oranges and deep reds |
|
|
291
|
+
| `minimal-light` | Clean white, professional |
|
|
292
|
+
| `forest` | Deep greens, organic |
|
|
293
|
+
| `candy` | Pastel, playful, colorful |
|
|
294
|
+
| `terminal` | Classic green-on-black |
|
|
295
|
+
| `academic` | Serif, print-ready, formal |
|
|
296
|
+
| `newspaper` | High-contrast editorial |
|
|
297
|
+
|
|
298
|
+
Add a runtime theme switcher:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
%%theme-switcher {themes: [dark-ocean, neon-city, minimal-light]}%%end
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Build your own theme in `%%style`:
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
@theme my-brand {
|
|
308
|
+
--bg: #0a0014
|
|
309
|
+
--primary: #a855f7
|
|
310
|
+
--text: #f3e8ff
|
|
311
|
+
--font: "Outfit", sans-serif
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
> See **[THEMES.md](./THEMES.md)** for the complete theme authoring guide and how to publish themes.
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## VS Code Extension
|
|
320
|
+
|
|
321
|
+
The ApexDoc VS Code extension provides a complete editing experience for `.apx` files.
|
|
322
|
+
|
|
323
|
+
**Install:** Open VS Code → Extensions (`Ctrl+Shift+X`) → search **ApexDoc** → Install.
|
|
324
|
+
|
|
325
|
+
**What you get:**
|
|
326
|
+
- Syntax highlighting with 41 token scope mappings — every part of the syntax has its own color
|
|
327
|
+
- **Live preview** — open with `Ctrl+Shift+V` / `Cmd+Shift+V`, updates as you type
|
|
328
|
+
- Inline **lint diagnostics** — errors and warnings shown as squiggles in your editor
|
|
329
|
+
- **30+ snippets** — type `%%` to trigger block completions
|
|
330
|
+
- **Dark Ocean** editor theme — matching ApexDoc's default aesthetic
|
|
331
|
+
- `.apx` file icon in the file explorer
|
|
332
|
+
- Export to HTML directly from the Command Palette
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Compared to the Alternatives
|
|
337
|
+
|
|
338
|
+
### vs. Markdown
|
|
339
|
+
Markdown excels at simple notes. ApexDoc is built for when Markdown ends. If you've ever added raw HTML tags to a Markdown file, used a separate LaTeX renderer for equations, or given up on adding a chart — ApexDoc removes every one of those friction points.
|
|
340
|
+
|
|
341
|
+
### vs. MDX
|
|
342
|
+
MDX embeds React inside Markdown. ApexDoc requires no framework, no build pipeline, and no JavaScript knowledge. A scientist, a writer, and a data analyst can all author `.apx` files without knowing what JSX is.
|
|
343
|
+
|
|
344
|
+
### vs. LaTeX
|
|
345
|
+
ApexDoc uses LaTeX's math notation exactly — `$E = mc^2$`, `\int_{-\infty}^{\infty}`, `\begin{pmatrix}` — so you never relearn the math syntax you already know. It then adds everything LaTeX lacks: themes, live data, charts, animations, and source files you can read without compiling.
|
|
346
|
+
|
|
347
|
+
### vs. Notion / Confluence
|
|
348
|
+
Those are collaboration platforms with proprietary document formats. ApexDoc is an open, plain-text format — version-controlled, diffable, scriptable, and owned entirely by you. Your `.apx` files live on your filesystem.
|
|
349
|
+
|
|
350
|
+
### vs. PowerPoint / Keynote
|
|
351
|
+
Presentation software produces binary files you cannot meaningfully diff or generate with code. An ApexDoc presentation is plain text — scriptable, version-controllable, renderable anywhere with `apex serve`.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Ecosystem
|
|
356
|
+
|
|
357
|
+
| Package | Description |
|
|
358
|
+
|---|---|
|
|
359
|
+
| `apexdoc` (npm) | Core parser and renderer — Node.js |
|
|
360
|
+
| `apexdoc` (pip) | Python port — identical API |
|
|
361
|
+
| `apexdoc-vscode` | VS Code extension |
|
|
362
|
+
| `apex` (CLI) | Build, serve, export, lint |
|
|
363
|
+
| `apex.run` | Playground and documentation |
|
|
364
|
+
|
|
365
|
+
### Plugin System
|
|
366
|
+
|
|
367
|
+
ApexDoc has a first-class plugin API. Plugins can add custom block types, inline tags, export targets, and lifecycle hooks.
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
apex plugin install apexdoc-katex # Faster math via KaTeX
|
|
371
|
+
apex plugin install apexdoc-mermaid # Mermaid diagrams
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
> See **[PLUGINS.md](./PLUGINS.md)** for how to build and publish plugins.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Documentation Index
|
|
379
|
+
|
|
380
|
+
| File | Contents |
|
|
381
|
+
|---|---|
|
|
382
|
+
| **README.md** | This file — overview, features, quick start |
|
|
383
|
+
| **[SPEC.md](./SPEC.md)** | Complete format specification — all syntax, all blocks, all props |
|
|
384
|
+
| **[PLUGINS.md](./PLUGINS.md)** | Plugin development guide |
|
|
385
|
+
| **[THEMES.md](./THEMES.md)** | Theme authoring and publishing guide |
|
|
386
|
+
| **[CONTRIBUTING.md](./CONTRIBUTING.md)** | How to contribute to ApexDoc |
|
|
387
|
+
| **[CHANGELOG.md](./CHANGELOG.md)** | Version history |
|
|
388
|
+
| **[SECURITY.md](./SECURITY.md)** | Security policy and vulnerability reporting |
|
|
389
|
+
| **[CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)** | Community standards |
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Contributing
|
|
394
|
+
|
|
395
|
+
ApexDoc is open source and welcomes contributions — new block types, export targets, themes, plugins, documentation improvements, and bug fixes.
|
|
396
|
+
|
|
397
|
+
Read [CONTRIBUTING.md](./CONTRIBUTING.md) to get started. The project has an 86-test suite that must pass fully before any merge.
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## License
|
|
402
|
+
|
|
403
|
+
MIT © 2026 [Boniface Njuguna](https://github.com/bonifacenjuguna)
|
|
404
|
+
|
|
405
|
+
The ApexDoc format specification is permanently open. Anyone may implement a parser, renderer, editor, or tooling for `.apx` files without restriction or royalty.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
<div align="center">
|
|
410
|
+
|
|
411
|
+
**[apex.run](https://apex.run) · [npm](https://npmjs.com/package/apexdoc) · [PyPI](https://pypi.org/project/apexdoc) · [GitHub](https://github.com/bonifacenjuguna/apexdoc) · [VS Code](https://marketplace.visualstudio.com/items?itemName=bonifacenjuguna.apexdoc)**
|
|
412
|
+
|
|
413
|
+
*The last document format you'll ever need.*
|
|
414
|
+
|
|
415
|
+
</div>
|