-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
88 lines (82 loc) · 3.42 KB
/
Copy pathCargo.toml
File metadata and controls
88 lines (82 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[package]
name = "md2any"
version = "0.3.0"
edition = "2021"
rust-version = "1.74"
description = "Markdown → PowerPoint, OpenDocument Impress, PDF, Word, Writer, HTML, SVG, and PNG. One markdown source, one small Rust binary."
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/javaperformance/md2any"
homepage = "https://github.com/javaperformance/md2any"
documentation = "https://docs.rs/md2any"
keywords = ["markdown", "presentation", "powerpoint", "pptx", "pdf"]
categories = ["command-line-utilities", "text-processing"]
authors = ["javaperformance"]
exclude = [
"/.github",
"/scripts",
"/tests/snapshots/*.actual.snap",
"/target",
"/examples/*.pptx",
"/examples/*.pdf",
"/examples/*.odp",
"/examples/*.docx",
"/examples/*.odt",
# The manual in binary office formats (~1.2 MB) is redundant with HELP.md
# for a source crate; keep it in the repo, out of the published package.
"/docs/manual",
# Large pre-rendered sample images not referenced by any shipped example.
"/examples/assets/*.png",
]
[[bin]]
name = "md2any"
path = "src/main.rs"
[lib]
name = "md2any"
path = "src/lib.rs"
[dependencies]
clap = { version = "4.5", features = ["derive"] }
pulldown-cmark = "0.10"
zip = { version = "0.6", default-features = false, features = ["deflate"] }
flate2 = "1"
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_yaml = "0.9"
serde_json = "1"
# TTF parser — pure Rust, no_std, used to extract cmap + glyph widths from
# the DejaVu fonts we embed in the PDF output.
ttf-parser = { version = "0.21", default-features = false, features = ["std"] }
# Typst's tiny TTF subsetter. We use it to ship only the glyphs each PDF
# actually references — turns a 21 MB PDF (full Noto CJK) into ~200 KB.
subsetter = "0.2"
# Tiny synchronous HTTP client (rustls TLS). Used to fetch remote image URLs
# referenced in markdown at build time. Disable with `--no-default-features`
# if you don't need HTTP image fetching.
ureq = { version = "2.10", default-features = false, features = ["tls"], optional = true }
# SVG rasterisation. Pure Rust. Used to convert `<svg>` images into PNG at
# build time so they can be embedded in PDF / OOXML / ODF outputs which
# don't natively understand vector graphics. Optional — disable for a
# smaller binary if you only embed raster images.
resvg = { version = "0.42", default-features = false, features = ["text", "raster-images"], optional = true }
usvg = { version = "0.42", default-features = false, features = ["text"], optional = true }
tiny-skia = { version = "0.11", default-features = false, features = ["std", "png-format"], optional = true }
[features]
default = ["remote-images", "svg"]
# Bring in ureq + rustls so markdown `` references
# work. Drop this feature for a smaller binary if you only use local images.
remote-images = ["ureq"]
# Bring in resvg + usvg + tiny-skia so markdown can reference `*.svg`
# image files. They're rasterised to PNG at build time and embedded the
# same way as a regular raster image.
svg = ["resvg", "usvg", "tiny-skia"]
[dev-dependencies]
# Renderer tests open the produced PPTX/ODP/DOCX/ODT archives to assert
# structural invariants. zip is already a runtime dep — re-listed here to
# make the dev-only usage explicit.
zip = { version = "0.6", default-features = false, features = ["deflate"] }
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 1
strip = true
panic = "abort"