Skip to content

Commit

Permalink
refactor(html): extract and isolate markdown rendering (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Nov 8, 2024
1 parent f26eb97 commit b43dd22
Show file tree
Hide file tree
Showing 41 changed files with 1,192 additions and 2,026 deletions.
226 changes: 8 additions & 218 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 7 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name = "deno_doc"

[[example]]
name = "ddoc"
required-features = ["html"]
required-features = ["html", "comrak"]

[dependencies]
anyhow = "1.0.86"
Expand All @@ -37,33 +37,13 @@ regex = "1.10.6"
serde.workspace = true
serde_json = { version = "1.0.122", features = ["preserve_order"] }
termcolor = "1.4.1"
itoa = "1.0.11"

html-escape = { version = "0.2.13", optional = true }
comrak = { version = "0.28.0", optional = true, default-features = false }
handlebars = { version = "6.1", optional = true, features = ["string_helpers"] }
syntect = { version = "5.2.0", optional = true, default-features = false, features = [
"parsing",
"default-syntaxes",
"default-themes",
"html",
"dump-load",
"regex-onig",
] }
handlebars = { version = "6.1", features = ["string_helpers"], optional = true }
comrak = { version = "0.29.0", optional = true, default-features = false }
ammonia = { version = "4.0.0", optional = true }

tree-sitter-highlight = { version = "0.22.6", optional = true }
tree-sitter-javascript = { version = "0.21.4", optional = true }
tree-sitter-typescript = { version = "0.21.2", optional = true }
tree-sitter-json = { version = "0.21.0", optional = true }
tree-sitter-regex = { version = "0.21.0", optional = true }
tree-sitter-css = { version = "0.21.0", optional = true }
tree-sitter-md = { version = "0.2.3", optional = true }
tree-sitter-rust = { version = "0.21.2", optional = true }
tree-sitter-html = { version = "0.20.3", optional = true }
tree-sitter-bash = { version = "0.21.0", optional = true }
tree-sitter-xml = { version = "0.6.4", optional = true }
itoa = "1.0.11"

[dev-dependencies]
anyhow = { version = "1.0.86" }
clap = "2.34.0"
Expand All @@ -75,22 +55,10 @@ pretty_assertions = "1.4.0"
insta = { version = "1.39.0", features = ["json"] }

[features]
default = ["html", "rust", "tree-sitter"]
default = ["rust", "html", "comrak"]
rust = []
html = ["html-escape", "comrak", "handlebars", "ammonia"]
tree-sitter = [
"tree-sitter-highlight",
"tree-sitter-javascript",
"tree-sitter-typescript",
"tree-sitter-json",
"tree-sitter-regex",
"tree-sitter-css",
"tree-sitter-md",
"tree-sitter-rust",
"tree-sitter-html",
"tree-sitter-bash",
"tree-sitter-xml",
]
html = ["html-escape", "handlebars"]
comrak = ["dep:comrak", "ammonia"]

[[test]]
name = "specs"
Expand Down
Loading

0 comments on commit b43dd22

Please sign in to comment.