| Age | Commit message (Collapse) | Author |
|
At this point, all of the fields in the struct ServeOptions is the
same with [lib/http.ServerOptions] except IsDevelopment and
ConvertOptions.
For field IsDevelopment we keep in the struct.
For field ConvertOptions we remove it and let the caller pass it on
Serve function or InitHTTPServer method.
|
|
Previously, with direct embed, every time we change the CSS or index
template, we need to restart the "ciigo serve" command.
Using memfs make us easy to update and see the changes directly, without
restarting the server.
|
|
|
|
The fieldalignment and shadow is linter from golang.org/x/tools.
This linters actually have an API that can be combined into a program,
which provided by package "pakakeh.go/lib/goanalysis".
|
|
While at it, update the example index by removing unnecessary
external image, and update links to open in new tab/window.
|
|
The internal/cmd/goembed is replaced as command "embed" of
cmd/ciigo-example.
|
|
Replace any usage of ":=" with explicit variable declaration for better
types clarity.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
The latest share module simplify the memfs.GoEmbed call by using
struct memfs.EmbedOptions instead of passing it as parameters.
The changes on share module affect on how EmbedOptions in this module,
where memfs.EmbedOptions is used to replace field PackageName, VarName,
and GoFileName.
|
|
The lates share module use the term GoEmbed to generate Go source file.
In order for this repo in sync with upstream terminology and to minimize
confusion, we changes the exported function and command name from
"generate" to "embed", this includes
* Command "ciigo generate" become "ciigo embed"
* Exported function to generate Go renamed from "Generate" to "GoEmbed".
This include the parameter GenerateOptions which renamed to
EmbedOptions.
* The internal command to generate example renamed from "generate" to
"goembed"
|
|
Previously, we pass the directory to be scanned for asciidoc markup files
and path to HTML template on Convert function. Adding new option to
Convert will cause changes on the Convert signature.
To prevent this, we changes the Convert signature from multiple parameters
into single parameter ConvertOptions.
While at it, change the variable name HTMLTemplate to HtmlTemplate.
|
|
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.
|
|
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).
|
|
|
|
While at it, also move the templates into _example and all assets
into the same directory.
|
|
|