aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2026-02-11cmd/ciigo: add option to set base path and shutdown idle durationShulhan
The `-base-path` option set the URL prefix for serving HTTP request. This allow serving the content under the prefix other than "/". The `-shutdown-idle` option set the duration when server will stop accepting new connections and shutting down. This option can be helpful to reduce the resources on local environment.
2026-02-07all: embed struct [lib/http.ServerOptions] directly to [ServeOptions]Shulhan
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.
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.
2025-01-07all: change the "serve-doc" and default address to prevent conflictsShulhan
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.
2025-01-07all: refactoring to use [watchfs/v2]Shulhan
The [watchfs/v2] bring new enhancements that watching only single file instead of all markup files for changes. This minimize number of goroutine calling os.Stat on each markup files being watched on directory.
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-08-04all: update the CLI usage in the READMEShulhan
There are three places for command usage: one in main Go doc, one in the program usage, and one in README. If we changes the flags we need to update three of them, and sometimes we forgot. To simplify, we remove the one in the Go doc main program.
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-05-10all: update module pakakeh.go to latest releaseShulhan
2024-04-11cmd/ciigo: add flag to set package and variable name for "embed"Shulhan
The flag "-package-name" can be used to changes the default package name inside the Go embed file. The flag "-var-name" can be used to changes the default memfs variable name inside the Go embed file.
2024-04-11all: fix HTML files always generated when HTMLTemplate is not setShulhan
If the path to HTMLTemplate option is not set, GoEmbed should convert to HTML only if markup file is newer than HTML file or when HTML file not exist.
2024-04-10cmd/ciigo: instantiate variable on switch casesShulhan
Instead of creating variables on top of switch, only declare them when needed.
2024-04-04Release ciigo v0.12.0 (2024-04-04)v0.12.0Shulhan
=== New features * all: add server option to automatically generate index HTML If the requested path is directory and no "index.html" file exist in that directory, ciigo server will render list of files as "index.html" automatically. === Chores * all: replace module "share" with "pakakeh.go" The "share" module has been moved to new repository with new name at "https://sr.ht/~shulhan/pakakeh.go".
2024-03-15go.mod: update module "pakakeh.go" to tipShulhan
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]
2023-11-07cmd/ciigo: set default IP address to loopback on serve commandShulhan
Previously, the default IP address is 0.0.0.0 which listen on all network interfaces. Listening to all network interface should be explicit by user.
2023-11-07go.mod: update share module to v0.50.1Shulhan
This release bring many enhancements to "lib/memfs", a library for caching file system in memory. === Enhancements * lib/memfs: return nil in AddChild if file not exist * lib/memfs: quote the path in the returned error * lib/memfs: add method Child to Node * lib/memfs: call the Init method in the embedded file * lib/memfs: include empty directory * lib/memfs: re-scan directory content on Node’s Update
2023-05-14all: bring back support for MarkdownShulhan
I use two remote repositories: GitHub and SourceHut. GitHub support rendering README using asciidoc while SourceHut not. This cause the repository that use README.adoc rendered as text in SourceHut which make the repository page less readable. Also, the pkg.go.dev now render README but only support Markdown. Since we cannot control the SourceHut and go.dev, the only option is to support converting Markdown in ciigo so I can write README using Markdown and the rest of documentation using Asciidoc.
2022-09-06all: update all dependenciesShulhan
The latest asciidoctor-go module fix parsing list description inside include directive.
2022-08-06all: set the Version automatically set during buildShulhan
This require that the command build or install using "make build/install".
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-07-24Release ciigo v0.8.2 (2022-07-24)v0.8.2Shulhan
The latest update on asciidoctor-go refactor the generated ref ID where ref ID is no longer prefixed with "\_" if start with ASCII letter. === Enhancements * all: generate HTML meta data and replace the top header title The following metadata are rendered based on the same asciidoc attributes: author, description, generator, and keywords. * all: add CSS for admonition block * all: update CSS for description list
2022-07-09all: update share module to v0.39.1-0.20220709072157-a39d5d2246f8Shulhan
This changes update the embedded Go file on cmd/ciigo-example and rename field Development on MemFS Options.
2022-05-19cmd/ciigo: simplify and cleaning up the codeShulhan
This changes move the flag "help" to command.
2022-05-19cmd/ciigo: add command to print to current versionShulhan
2022-05-19all: reformat all files using latest goimportsShulhan
While at it, replace any use of ioutil with os/io package.
2022-03-09all: update the watcher affected by changes on share moduleShulhan
In the share module, the DirWatcher and Watcher has been moved to package memfs and the way to consumed the changes is not through callback again but through channel.
2022-03-04all: re-convert markup files if HTML template is newer on GoEmbedShulhan
Calling GoEmbed with updated HTML template will reconvert all markup files automatically, as long as the generated Go file is older than the HTML template file.
2022-03-04all: re-licensing ciigo under GPL-3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl/ for more information.
2022-02-19all: add option IsDevelopment to ServeOptionsShulhan
If the IsDevelopment option set to true, the serve function will serve the root directory directly and watch all asciidoc files for changes and convert it. This is like running Watch, Convert and Serve at the same time.
2021-12-20go.mod: update to latest share moduleShulhan
2021-10-27all: update to latest share moduleShulhan
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.
2021-10-10all: refactoring with latest share moduleShulhan
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"
2021-04-03all: add option to exclude certain paths using regular expressionShulhan
The ConvertOptions now has the Exclude field that can contains regular expression. If the Exclude is not empty, it will be compiled and use in Convert, Generate, Watch, and Serve; to ignore specific paths being scanned.
2021-04-03cmd/ciigo: remove any mention of .md extensionShulhan
The support for .md file has been moved to git.sr.ht/~shulhan/mdgo.
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-04-03all: change the Convert function to use type ConvertOptionsShulhan
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.
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-12-26go.mod: update with latest asciidoctor-goShulhan
* inline_parser: add zero-width space after ellipsis character * all: add predefined attributes for character replacements * parser: wrap value of email ref name with "mailto:[<value>]" * all: remove parameter isForToC on method element.toHTML * document: rename ToEmbeddedHTML to ToHTMLEmbedded * document: group exported fields for document readibility * all: move some list ordered class names to constants * all: rename file adoc_table to element_table * all: rename type adocTable to elementTable * README: add subsection for list of TODO for Include Directive * Makefile: add task to run test * all: rename the file adoc_node to element * all: rename adocNode to element * all: add unit test for paragraph lead style * all: do not wrap document with content and preamble on ToEmbeddedHTML * all: use consistent names for parser * all: fix list description item than span on multiple lines * all: fix parsing list with open block
2020-11-26all: remove the Author and DateShulhan
Since the generate HTML already render the authors and date, there is no need to save the values in the fileHTML. Also, update the default embedded HTML template with latest format.
2020-11-26htmlgenerator: use the ToHTMLBody instead of ToEmbeddedHTMLShulhan
The ToHTMLBody generate table of contents at the top, while ToEmbeddedHTML require ":toc:" to set to "preamble" or "macro" to get it rendered.
2020-11-24README: reformat to markdown to make it readable by sourcehutShulhan
While at it simplify the example of index.adoc.
2020-11-11all: migrate the repo and Go module to git.sr.ht/~shulhan/ciigoShulhan
2020-11-09cmd/ciigo: change default debug level for "serve" from 2 to 1Shulhan
2020-11-04htmlgenerator: convert the document with body onlyShulhan
2020-11-04all: update with latest asciidoctor moduleShulhan
2020-11-03all: replace libasciidoc with asciidoctor-goShulhan