Skip to content

Commit 5d0143d

Browse files
author
tjk
committed
Add CLI crate README
1 parent a7f1ad9 commit 5d0143d

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

cli/README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# pulldown-html-ext-cli
2+
3+
A command-line tool for converting markdown to HTML using the pulldown-html-ext library.
4+
5+
## Installation
6+
7+
```bash
8+
cargo install pulldown-html-ext-cli
9+
```
10+
11+
## Usage
12+
13+
Basic usage:
14+
```bash
15+
# Read from stdin, write to stdout
16+
echo "# Hello" | pulldown-html-ext-cli
17+
18+
# Convert a file
19+
pulldown-html-ext-cli -i input.md -o output.html
20+
21+
# Use custom configuration
22+
pulldown-html-ext-cli -i input.md -o output.html -c config.toml
23+
```
24+
25+
## Options
26+
27+
```
28+
Options:
29+
-i, --input <FILE> Input markdown file (omit for stdin)
30+
-o, --output <FILE> Output HTML file (omit for stdout)
31+
-c, --config <FILE> Config file in TOML format
32+
-h, --help Print help
33+
-V, --version Print version
34+
```
35+
36+
## Configuration
37+
38+
You can customize the HTML output by providing a TOML configuration file. Example configuration:
39+
40+
```toml
41+
[html]
42+
escape_html = true
43+
break_on_newline = true
44+
xhtml_style = false
45+
pretty_print = true
46+
47+
[elements.headings]
48+
add_ids = true
49+
id_prefix = "heading-"
50+
51+
[elements.links]
52+
nofollow_external = true
53+
open_external_blank = true
54+
55+
[elements.code_blocks]
56+
default_language = "text"
57+
line_numbers = true
58+
```
59+
60+
For full configuration options, see the [library documentation](https://docs.rs/pulldown-html-ext).
61+
62+
## Example
63+
64+
```bash
65+
# Using stdin/stdout
66+
echo "# Hello World" | pulldown-html-ext-cli > output.html
67+
68+
# Using files with custom config
69+
pulldown-html-ext-cli -i document.md -o document.html -c custom.toml
70+
```
71+
72+
## License
73+
74+
[Add your license information here]

0 commit comments

Comments
 (0)