Documentation ¶
Overview ¶
Package ciigo is a program to write static web server with embedded files using asciidoc markup languages.
For more information see the README file at the page repository https://sr.ht/~shulhan/ciigo.
Index ¶
Constants ¶
const (
// DefaultRoot define default Root value for GenerateOptions.
DefaultRoot = "."
)
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert all markup files inside directory "dir" recursively into HTML files using "htmlTemplate" file as template. If htmlTemplate is empty it will default to use embedded HTML template. See template_index_html.go for template format.
func Generate ¶
func Generate(opts *GenerateOptions) (err error)
Generate a static Go file to be used for building binary.
It will convert all markup files inside directory "dir" into HTML files, recursively; and read all the HTML files and files in "content/assets" and convert them into Go file in "out".
If htmlTemplate is empty it will default to use embedded HTML template. See template_index_html.go for template format.
func Watch ¶ added in v0.5.0
Watch any changes on asciidoc files on directory "dir" recursively and changes on the HTML template file. If there is new or modified asciidoc files it will convert them into HTML files using HTML template automatically.
If the HTML template file modified, it will re-convert all asciidoc files. If the HTML template file deleted, it will replace them with internal, default HTML template.
Types ¶
type GenerateOptions ¶ added in v0.4.1
type GenerateOptions struct { // Root directory where its content will be embedded into Go source // code. // Default to DefaultRoot if its empty. Root string // HTMLTemplate the HTML template to be used when converting asciidoc // file into HTML. // If empty it will default to use embedded HTML template. // See template_index_html.go for template format. HTMLTemplate string // GenPackageName the name of package in Go generated source code. // Default to memfs.DefaultGenPackageName if its empty. GenPackageName string // GenVarName the name of variable where all files in Root will be // stored. // Default to memfs.DefaultGenVarName if its empty. GenVarName string // GenGoFileName the file name of Go source code will be written. // Default to memfs.DefaultGenGoFileName if its empty. GenGoFileName string }
GenerateOptions define the options for calling Generate function.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
ciigo
ciigo is a CLI to convert, generate, and/or serve a directory that contains markup files, as HTML files.
|
ciigo is a CLI to convert, generate, and/or serve a directory that contains markup files, as HTML files. |
ciigo-example
Program ciigo-example provide an example on how to build a binary that include the static, generated .go file.
|
Program ciigo-example provide an example on how to build a binary that include the static, generated .go file. |
internal
|
|