htmd-cli-0.3.0 is not a library.
Features
- Minimal, A 2MB+ binary is all you need
- Batch, both file, directory and glob pattern are supported
- Fast, it takes only ~2s to convert 200 html files (~70MB in total size, see the benchmark README)
Usages
Basic
# Read input from stdin
# Will write output to stdout
# Explicit input option
# Write output to test.md by shell
# Write output to test.md internally
# Read html files from a directory
Inputs
Stdin (- as the filename), file, directory, and glob pattern are supported.
This default input is stdin, so after you type only htmd it will wait for input, to finish typing, press Ctrl + D (Ctrl + Z on Windows).
Example inputs:
- Stdin:
-,< page.html - File:
page.html,index.html - Directory:
pages,./folder - Glob pattern:
pages/\*\*/\*.html,./\*.html
Output
Stdout (- as the filename), file, and directory are supported. Defaults to stdout.
You cannot set output as stdout when you have multiple input files.
Example outputs:
- Stdout:
- - File:
output.md, - Directory:
output,./converted
With conversion options
Flatten output
By default, when converting files using glob patterns such as pages/**/*.html, output files will follow the original folder hierarchy, to flatten output files, use --flatten-output.
Load options form toml file
You can save your options to a toml file
# htmd-options.toml
[]
=["head", "script", "style"]
= "setex"
Then load them using --options-file
htmd test.html --options-file htmd-options.toml
Install
Cargo
Binaries
You can download binaries from GitHub - Releases
License
Copyright 2024 letmutex
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.