cleanup, docs

This commit is contained in:
root
2026-06-16 12:21:31 +00:00
parent dff1959341
commit ea08d5f28b
296 changed files with 1571 additions and 1940 deletions
+4 -12
View File
@@ -8,6 +8,7 @@ options : optional markdown options tree
return value : a `DValue` document AST
:see
>markup
markdown_to_html
component
component_render
@@ -36,10 +37,6 @@ The returned AST uses `type` plus node-specific fields such as `level`, `text`,
Top-level documents use:
```text
type = "document"
children = [...]
```
Common block nodes:
@@ -66,11 +63,6 @@ Common inline nodes:
Example:
```uce
DValue options = json_decode("{\"components\":{\":::warning\":\"components/markdown/warning\"}}");
DValue ast = markdown_to_ast(file_get_contents("README.md"), options);
print(json_encode(ast));
```
Options:
@@ -78,7 +70,7 @@ Options:
- `options["allow_html"]` allows raw HTML passthrough nodes to be captured and rendered. Defaults to `false`.
- `options["components"]` provides the component hook map later used by `markdown_to_html()`. The parser preserves directive data needed by those hooks.
Related:
- PHP: CommonMark or Parsedown parsing pipelines that expose a syntax tree or token stream
- JavaScript / Node.js: `remark`, `micromark`, or `markdown-it` token streams and AST-like structures
:example
DValue ast = markdown_to_ast("# Title");
print(ast.is_array() ? "ast\n" : "empty\n");