Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fairlyblank/md2min
convert markdown file to minimal html file
https://github.com/fairlyblank/md2min
Last synced: 3 months ago
JSON representation
convert markdown file to minimal html file
- Host: GitHub
- URL: https://github.com/fairlyblank/md2min
- Owner: fairlyblank
- License: mit
- Created: 2013-04-28T07:35:14.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T13:14:19.000Z (almost 7 years ago)
- Last Synced: 2024-07-16T14:04:01.218Z (4 months ago)
- Language: Go
- Size: 51.8 KB
- Stars: 36
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
md2min
======convert markdown file to minimal html file, using github css.
install
-------go get github.com/fairlyblank/md2min
If you want to build standalone execution:
cd $(GOPATH)/github.com/fairlyblank/md2min/main
go build -o md2minusage
-----As standalone execution:
Usage: md2min [-nav=h2] name.md
name.md: markdown file name
-nav="none": navigate level ["none", "h1", "h2", "h3", "h4", "h5", "h6"]As package, please review [main.go](https://github.com/fairlyblank/md2min/blob/master/main/main.go).
Generally:
#### 1. Prepare input byte slice and output writer
bytes, _ := ioutil.ReadAll(filename)
wr, _ := os.Create(newname)#### 2. Initialize package
Without navigator:
md := md2min.New("none")
Using "\
" tag as navigator:
md := md2min.New("h2")
#### 3. Parse
md.Parse(bytes, wr)
examples
-------md2min ./example/example.md
will generate html without navigator.
md2min -nav=h2 ./example/example.md
will generate html with "\
" title navigator.
About
-----
md2min is written in [Google Go](http://golang.org/).md2min is open source software released under the [MIT License](https://github.com/fairlyblank/md2min/blob/master/LICENSE).