| Age | Commit message (Collapse) | Author |
|
Seems like we use "find ... -delete" for a reason that I forgot.
It should not be like that, we will fix it later.
|
|
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 environment variable GOBIN may not set by user explicitly.
|
|
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.
|
|
Using port 8080 as the default address for "serve" is too common and may
conflict with other services in user local environment.
While at it, also change the "serve-doc" with other random ports to
allow us test running "ciigo serve" and viewing doc at the same time.
|
|
Task for "lint" and "build" is much more faster than "test".
So if we lint or build failed, we did not waste too much times waiting
for all tests to pass.
While at it, remove linter "revive" we will use the standard linters
from Go tools itself.
|
|
This is to make the go embed output consistent when this repository
cloned for the first time, due the file modtime is newer on each
"git clone".
|
|
The reason for replacing is the golangci-lint become unusable.
It does not provide any useful hints (either we become better at writing
Go code or the default linter is not good enough).
While at it, add another linters from golang.org/x/tools including
fieldalignment and shadow.
|
|
|
|
|
|
When running test inside container, sometimes its success, most of the
time its fail.
In order to replicate it we need to setup the same container environment
and inspect it.
|
|
This require that the command build or install using "make build/install".
|
|
Instead of separating different build directory for OS, use single
_bin directory.
If we want to build for different OS/arch, can set the GOOS and GOARCH
environment variables before running make.
|
|
The internal/cmd/goembed is replaced as command "embed" of
cmd/ciigo-example.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
Never assume that the user set CGO_ENABLED to 1 by default.
|
|
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"
|
|
Now that we have the watcher which task are to watch the asciidoc
files and template files, we can use it in server to minimize duplicate
code.
This changes refactoring the htmlGenerator to initialize the HTML
template from internal or memfs, so the caller did not need to check by
itself.
|
|
* Do no install the ciigo-example
* Remove task for creating _bin directory since it will be handled
by go tools automatically.
|
|
|
|
|
|
|
|
|
|
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".
|
|
This first commit provide the following features,
* automatically regenerate asciidoc files on development,
* generate static and HTML files into Go source code, and
* running binary with embedded contents
|