Crates.io | htmd-cli |
lib.rs | htmd-cli |
version | 0.3.4 |
source | src |
created_at | 2024-06-20 08:56:43.083517 |
updated_at | 2024-07-12 06:24:36.108994 |
description | The command line tool for htmd. |
homepage | https://github.com/letmutex/htmd-cli |
repository | https://github.com/letmutex/htmd-cli |
max_upload_size | |
id | 1277745 |
size | 140,327 |
The command line tool for htmd
# Read input from stdin
htmd
# Will write output to stdout
htmd test.html
# Explicit input option
htmd --input test.html
# Write output to test.md by shell
htmd test.html > test.md
# Write output to test.md internally
htmd test.html --output ./
# Read html files from a directory
htmd ./pages -o converted
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:
-
, < page.html
page.html
, index.html
pages
, ./folder
pages/\*\*/\*.html
, ./\*.html
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:
-
output.md
,output
, ./converted
htmd test.html --ignored-tags "head,script,style" --heading-style setex
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
.
htmd pages/**/*.html --output converted --flatten-output
You can save your options to a toml file
# htmd-options.toml
[options]
ignored-tags =["head", "script", "style"]
heading-style = "setex"
Then load them using --options-file
htmd test.html --options-file htmd-options.toml
cargo install htmd-cli
You can download binaries from GitHub - Releases
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.