aboutsummaryrefslogtreecommitdiff
path: root/cmd/ciigo-example/main.go
AgeCommit message (Collapse)Author
2025-01-07all: move example for ciigo as library to internal/cmd/ciigo-exampleShulhan
While at it, update the example index by removing unnecessary external image, and update links to open in new tab/window.
2024-10-06all: refactoring functions to accept non pointer struct optionShulhan
The function that accept struct XxxOptions should only received the copy of struct, not pointer.
2024-05-12_example: fix SPDX header on template fileShulhan
The comment for HTML should end with "-->" not "--!>". While at it, set embedded Go file store the file without modification time to make the output (cmd/ciigo-example/static.go) does not changes on new clone.
2024-03-05all: replace module "share" with "pakakeh.go"Shulhan
2023-12-10all: fix all warnings reported by linter reviveShulhan
Unfortunately, this breaks some API and exported fields, but its better than creating revive.toml file to add an exception. Some breaking changes, * Field [ConvertOptions.HtmlTemplate] become [ConvertOptions.HTMLTemplate] * Method [Converter.SetHtmlTemplateFile] become [Converter.SetHTMLTemplateFile] * Method [Converter.ToHtmlFile] become [Converter.ToHTMLFile]
2022-08-01all: merge internal/cmd/goembed to cmd/ciigo-exampleShulhan
The internal/cmd/goembed is replaced as command "embed" of cmd/ciigo-example.
2022-08-01all: clean up codesShulhan
Replace any usage of ":=" with explicit variable declaration for better types clarity.
2022-05-19all: reformat all files using latest goimportsShulhan
While at it, replace any use of ioutil with os/io package.
2022-03-04all: re-licensing ciigo under GPL-3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl/ for more information.
2021-04-03all: change the Serve signature to ServeOptionsShulhan
Previously, we pass four parameters to Serve function: the instance to memfs.MemFS, the root directory, the address to listen, and path to HTML template. In case we need to add new parameter in the future, the Serve function signature will changes and this is not good for consumer of API. This commit changes the Serve function parameters to ServeOptions so we can add optional parameter in the future without changes to its signature.
2021-02-21all: return error instead of call log.Fatal on non main packagesShulhan
The library, non-main packages, should never call Fatal or panic, its up to the main package or the caller on how to handle it. While at it, fix the returned error to use log prefix and the error value, remove the "ciigo: " prefix.
2021-01-10all: refactoring due to change on memfs packageShulhan
This changes affect exported function Generate and Serve. Previously, the Generate() function accept three options: dir, out, and htmlTemplate; this commit changes the parameter into single struct Options with two additional options: GenPackageName and GenVarName. The GenPackageName allow to set the package name in Go generate source code, default to "main" if not set. The GenVarName set the instance of memfs.MemFS where the embedded files will be stored. On the Serve() function, we add parameter to pass the instance of memfs.MemFS (the one that passed on GenVarName).
2020-11-11all: migrate the repo and Go module to git.sr.ht/~shulhan/ciigoShulhan
2020-05-07all: rename the "content" directory to "_example"Shulhan
While at it, also move the templates into _example and all assets into the same directory.
2020-05-01all: simplify serving content using function ServeShulhan
Previously to serve the generated content we call two fucntions: NewServer() and Server.Start(). This changes unexported the internal server, and expose only the Serve() function with the same parameter as NewServer().
2019-08-14cmd/ciigo: a CLI to convert, generate, and serve markup filesShulhan
Here are the usage of CLI, ciigo [-template <file>] convert <dir> Scan the "dir" recursively to find markup files (.adoc or .md) and convert them into HTML files. The template "file" is optional, default to "templates/html.tmpl" in the current directory. ciigo [-template <file>] [-out <file>] generate <dir> Convert all markup files inside directory "dir" recursively and then embed them into ".go" source file. The output file is optional, default to "ciigo_static.go" in current directory. ciigo [-template <file>] [-address <ip:port>] serve <dir> Serve all files inside directory "dir" using HTTP server, watch changes on markup files and convert them to HTML files automatically. If the address is not set, its default to ":8080".
2019-08-06cmd/ciigo: move to ciigo-exampleShulhan
The "cmd/ciigo-example" will be used to test and give an example of how to build a binary that contains static, generated .go source file.