Crates.io | pulldown-html-ext-cli |
lib.rs | pulldown-html-ext-cli |
version | 0.5.0 |
source | src |
created_at | 2024-11-29 05:52:13.486878 |
updated_at | 2024-12-06 03:58:07.639349 |
description | CLI tool for extended HTML rendering of Markdown with pulldown-cmark |
homepage | |
repository | |
max_upload_size | |
id | 1465223 |
size | 36,497 |
Here is the rewritten README for the pulldown-html-ext-cli crate:
A command-line tool for converting Markdown to HTML using the pulldown-html-ext library.
You can install the pulldown-html-ext-cli tool using Cargo:
cargo install pulldown-html-ext-cli
The tool supports several options for converting Markdown to HTML:
pulldown-html-ext-cli [OPTIONS]
-i, --input <FILE>
: Specify the input Markdown file. If omitted, the tool will read from standard input.-o, --output <FILE>
: Specify the output HTML file. If omitted, the tool will write to standard output.-c, --config <FILE>
: Provide a TOML configuration file to customize the HTML output.-h, --help
: Display the help message.-V, --version
: Print the version information.To convert a Markdown file to HTML and write the output to stdout:
pulldown-html-ext-cli -i input.md
To convert a Markdown file and write the HTML output to a file:
pulldown-html-ext-cli -i input.md -o output.html
You can provide a TOML configuration file to customize the HTML output. Here's an example configuration:
[html]
escape_html = true
break_on_newline = true
xhtml_style = false
pretty_print = true
[elements.headings]
add_ids = true
id_prefix = "heading-"
[elements.links]
nofollow_external = true
open_external_blank = true
[elements.code_blocks]
default_language = "text"
line_numbers = true
To use the custom configuration, run the tool with the -c
option:
pulldown-html-ext-cli -i input.md -o output.html -c custom.toml
For more information on the available configuration options, please refer to the pulldown-html-ext library documentation.
This project is licensed under the MIT License - see the LICENSE file for details.