feat(dump): add semantic_tree and semantic_tree_text formats

Adds support for dumping the semantic tree in JSON or text format
via the --dump option. Updates the Config enum and usage help.
This commit is contained in:
Adrià Arrufat
2026-03-09 18:23:52 +09:00
parent c77cb317c4
commit 3c97332fd8
2 changed files with 22 additions and 1 deletions

View File

@@ -192,6 +192,8 @@ pub const DumpFormat = enum {
html,
markdown,
wpt,
semantic_tree,
semantic_tree_text,
};
pub const Fetch = struct {
@@ -338,7 +340,7 @@ pub fn printUsageAndExit(self: *const Config, success: bool) void {
\\
\\Options:
\\--dump Dumps document to stdout.
\\ Argument must be 'html' or 'markdown'.
\\ Argument must be 'html', 'markdown', 'semantic_tree', or 'semantic_tree_text'.
\\ Defaults to no dump.
\\
\\--strip_mode Comma separated list of tag groups to remove from dump