static markdown compiler

cdelorme 19408daa43 fix main smd command implementation hace 7 años
cmd 19408daa43 fix main smd command implementation hace 7 años
templates c1b6ae4dc7 update static library code to be much simpler hace 7 años
.gitignore 7f2dd5ac4c rename command to smd hace 7 años
license 4b409534fd switch to zlib license hace 7 años
markdown.go c1b6ae4dc7 update static library code to be much simpler hace 7 años
markdown_test.go c1b6ae4dc7 update static library code to be much simpler hace 7 años
readme.md 19408daa43 fix main smd command implementation hace 7 años
static.go c1b6ae4dc7 update static library code to be much simpler hace 7 años
static_test.go c1b6ae4dc7 update static library code to be much simpler hace 7 años
templates.go c1b6ae4dc7 update static library code to be much simpler hace 7 años

readme.md

GoDoc

static

An abstraction ontop of blackfriday for the purpose of accepting a folder of files and generating html in lexical order with built-in templates.

The primary objective of this project was originally self-education. The result is a sub-par utility with minimal features. The only benefits it offers are a significantly smaller code base, and no meta-data dependencies.

usage

To import the library:

import "github.com/cdelorme/static"

notes

Relative path support has been removed because raw markdown is intended to be readable.

Automatic navigation has been removed from the web solution, since the requirements vary by website and are entirely different when generating a book. Use the template override feature to create your own.

The code makes no assumptions about what index name is used, since that is entirely controlled by the web server.

The library is not concurrently safe, because there are zero benefits to running it concurrently. Everything is bottlenecked at the hard drive, and that cannot be addressed without proper buffered solutions to both markdown and template parsing.

It uses go-bindata to embed default templates, which have been committed to the project since go generate is not possible to do from go get.

No efforts have been made to optimize re-execution around existing files, but it would be possible to compare the markdown file modified time against the modified time of existing html files to reduce overhead in the future.

If two files with alternative markdown extensions but identical base names exist, the first match is the only one that will be parsed into an html file.

The book mode provides automatically generated navigation using javascript.

Any absolute links in book mode will not function as desired.

All tests have been (re) written using a black-box approach, where only publicly exposed functions and properties are modified.

references