Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bbelderbos/md_to_html
https://github.com/bbelderbos/md_to_html
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/bbelderbos/md_to_html
- Owner: bbelderbos
- Created: 2024-05-31T09:46:35.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-05-31T15:23:38.000Z (4 months ago)
- Last Synced: 2024-06-01T11:37:13.233Z (4 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert markdown files to html Rust exercise
In my journey of learning Rust, I decided to pick a small Python program that converts markdown files to html + makes an index page for those files, and rewrite it in Rust (with the help of AI of course).
To learn the syntax and also see if I could speed it up.
Seems it did :)
```
$ time python gen_html.py /Users/pybob/code/newbies-part2HTML pages and index generated in html_pages
python gen_html.py /Users/pybob/code/newbies-part2 0.20s user 0.02s system 85% cpu 0.268 total$ time cargo run -- --directory /Users/pybob/code/newbies-part2
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/md_to_html --directory /Users/pybob/code/newbies-part2`
HTML pages and index generated in html_pages
cargo run -- --directory /Users/pybob/code/newbies-part2 0.04s user 0.03s system 26% cpu 0.292 total$ cargo build --release
$ time ./target/release/md_to_html --directory /Users/pybob/code/newbies-part2
HTML pages and index generated in html_pages
./target/release/md_to_html --directory /Users/pybob/code/newbies-part2 0.00s user 0.01s system 79% cpu 0.020 total
```