aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-19all: reformat all files using latest goimportsShulhan
While at it, replace any use of ioutil with os/io package.
2022-05-19go.mod: update share module to v0.37.0Shulhan
2022-03-27.reuse: add missing copyright and license in the testdata filesShulhan
2022-03-27_example: fix the copyright comment on the CSS filesShulhan
2022-03-27all: set the field Development to true if MemFS is not set on newServerShulhan
2022-03-27all: include the path that cause an error on newHTMLGeneratorShulhan
In case the newHTMLGenerator return an error, it's hard to track which part of code that cause the error because there are three files being processed (the index HTML, HTML template, or internal template). This changes include the file that cause an error inside the error message.
2022-03-27go.mod: update the share module to latestShulhan
This also fix the share module using "replace" instead of "require".
2022-03-12all: check for excluded file before processing sub directoryShulhan
Previously, if the file path match with one of the excluded pattern, we keep processing the sub directory to find the markup files. This may cause an error "too many open files" if excluded directory contains many sub directory and/or files. This changes fix this issue by checking the path with excluded pattern first before diving into sub directory.
2022-03-09all: remove old license section on READMEShulhan
While at it, remove the SPDX comment at the top README to fix the markdown not rendered correctly.
2022-03-09all: reverse the license symbolic linkShulhan
Github and pkg.go.dev cannot handle symbolic link of COPYING file on the root, but the "reuse lint" command can handle it. So, we make a copy of license to COPYING and under LICENSES directoy we create symbolic link to ../COPYING.
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-04Release ciigo v0.8.0 (2022-03-04)v0.8.0Shulhan
09ab0af all: re-convert markup files if HTML template is newer on GoEmbed 753642c all: add 1em to the bottom margin of paragraph under list 0d59995 all: update asciidoctor-go and share modules to latest version 88478fd all: re-licensing ciigo under GPL-3.0 or later a6c335c go.mod: update share module to the tip 61fa9a7 all: realign all structs fdc5579 all: fix adoc files not re-converted when template file changes 41117b4 all: add option IsDevelopment to ServeOptions 42e9c24 go.mod: update module asciidoctor-go to the tip ce2af85 Makefile: set CGO_ENABLED to 1 when running test
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: add 1em to the bottom margin of paragraph under listShulhan
This is to make the list content readable and indistinguishable, especially when we have many list items with paragraphs.
2022-03-04all: update asciidoctor-go and share modules to latest versionShulhan
2022-03-04all: re-licensing ciigo under GPL-3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl/ for more information.
2022-03-01go.mod: update share module to the tipShulhan
2022-02-19all: realign all structsShulhan
Changes, * fileMarkup: realign from 56 to 48 bytes (-8 bytes) * htmlGenerator: realign from 32 to 24 bytes (-8 bytes) * watcher: realign from 48 to 40 bytes (-8 bytes)
2022-02-19all: fix adoc files not re-converted when template file changesShulhan
In commit 06d03f6afe37 we skip converting files if the generated HTML is newer than adoc file. This cause an issue where the template file changes during Watch or Serve, but the HTML files is not regenerated.
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.
2022-02-17go.mod: update module asciidoctor-go to the tipShulhan
The latest tip fix rendering list check box text that get cut one character in the beginning.
2022-02-16Makefile: set CGO_ENABLED to 1 when running testShulhan
Never assume that the user set CGO_ENABLED to 1 by default.
2022-01-10Release ciigo v0.7.1 (2022-01-10)v0.7.1Shulhan
This release update all dependencies and codes affected by updated.
2022-01-10go.mod: update to latest share moduleShulhan
2021-12-20go.mod: update to latest share moduleShulhan
2021-12-06Release ciigo v0.7.0 (2021-12-06)v0.7.0Shulhan
Changes on asciidoctor-go, * all: fix parsing and rendering cross reference * all: allow colon ':' and period '.' on the ID === Breaking changes * all: refactoring with latest share module The latest 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" === Bug fixes * all: add missing new line when printing file to be converted * all: fix empty fileMarkups on watcher Previously, when user call ciigo.Watch(), and the markup file changes, the onChangeFileMarkup method will print an error "xyz not found" which cause the markup file not converted. This is caused by watcher.fileMarkups is empty. This changes fix this issue by initializing the fileMarkups field using listFileMarkups, so the next callback to onChangeFileMarkup can detect the changed file and convert it. * This update fix HTTP server caching using ETag. === Enhancements * all: check markup modification time before converting to HTML Previously, when the Convert, Watch or Serve running it will convert all markup files into HTML without checking if the adoc has been modified or newer than HTML file. This changes check the modification time of markup file first before converting them, to minimize unnecessary operation.
2021-12-06go.mod: update share v0.32.0 and asciidoctor-go v0.1.1Shulhan
Changes on asciidoctor-go, * all: fix parsing and rendering cross reference * all: allow colon ':' and period '.' on the ID
2021-12-06all: add missing new line when printing file to be convertedShulhan
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-17all: fix empty fileMarkups on watcherShulhan
Previously, when user call ciigo.Watch(), and the markup file changes, the onChangeFileMarkup method will print an error "xyz not found" which cause the markup file not converted. This is caused by watcher.fileMarkups is empty. This changes fix this issue by initializing the fileMarkups field using listFileMarkups, so the next callback to onChangeFileMarkup can detect the changed file and convert it.
2021-10-10all: rename type fileHTML to fileHtmlShulhan
2021-10-10all: check markup modification time before converting to HTMLShulhan
Previously, when the Convert, Watch or Serve running it will convert all markup files into HTML without checking if the adoc has been modified or newer than HTML file. This changes check the modification time of markup file first before converting them, to minimize unnecessary operation.
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-10-09go.mod: update share module to latest commitsShulhan
This update fix HTTP server caching using ETag.
2021-10-08all: update share module to latest versionShulhan
This update affect the Watcher due to changes on FileState.
2021-07-09go.mod: upgrade share module to v0.28.1-0.20210709045022-0cd813b8ae8aShulhan
This upgrade affect the Server due to field Memfs has been removed from lib/http.Server.
2021-04-07Release ciigo v0.6.0 (2021-04-07)v0.6.0Shulhan
=== Breaking changes * all: change the Convert function to use type ConvertOptions 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. * all: change the Serve signature to ServeOptions 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. * all: changes the Watch signature to use ConvertOptions Just like changes on Convert function, this is to prevent additional parameter added on Watch function affect the consumer of API in the future. === New features * all: add option to exclude certain paths using regular expression 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. === Enhancements * all: exclude common file and directories names for being watched By default, any hidden files on Unix like system, which start with dot '.' should not be watched for any changes. So does "node_modules" from npm and "vendor" directory which may contains many unrelated files.
2021-04-07all: replace any mention of asciidoc with markupShulhan
2021-04-06go.mod: set the minimum Go to 1.16 and update the dependenciesShulhan
2021-04-03all: update README and LICENSEShulhan
Update README to reflect the latest changes and features on the ciigo as command and library. On license file, fix the year to the first commit and current year.
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: changes the Watch signature to use ConvertOptionsShulhan
Just like changes on Convert function, this is to prevent additional parameter added on Watch function affect the consumer of API in the future.
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: exclude common file and directories names for being watchedShulhan
By default, any hidden files on Unix like system, which start with dot '.' should not be watched for any changes. So does "node_modules" from npm and "vendor" directory which may contains many unrelated files.
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-03-06all: update module dependenciesShulhan
Update to latest release of asciidoctor-go and share modules.
2021-03-04all: update with latest share moduleShulhan
2021-02-21Release ciigo v0.5.0 (2021-02-21)v0.5.0Shulhan
=== New features * all: implement Watch functionality The Watch function, 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. === Breaking changes * all: return error instead of call log.Fatal on non main packages 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. === Chores * all: rewrite to use the watcher 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.
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.