- ciigo v0.14.0 (2024-10-06)
- ciigo v0.13.2 (2024-09-07)
- ciigo v0.13.1 (2024-08-04)
- ciigo v0.13.0 (2024-05-12)
- ciigo v0.12.0 (2024-04-04)
- ciigo v0.11.0 (2023-12-14)
- ciigo v0.10.1 (2023-11-06)
- ciigo v0.10.0 (2023-05-14)
- ciigo v0.9.3 (2022-03-03)
- ciigo v0.9.2 (2022-09-06)
- ciigo v0.9.1 (2022-08-07)
- ciigo v0.9.0 (2022-08-06)
- ciigo v0.8.2 (2022-07-24)
- ciigo v0.8.1 (2022-05-19)
- ciigo v0.8.0 (2022-03-04)
- ciigo v0.7.1 (2022-01-10)
- ciigo v0.7.0 (2021-12-06)
- ciigo v0.6.0 (2021-04-07)
- ciigo v0.5.0 (2021-02-21)
- ciigo v0.4.1 (2021-01-21)
- ciigo v0.4.0 (2021-01-21)
- ciigo v0.3.0 (2020-12-06)
- ciigo v0.2.0 (2020-07-05)
- ciigo v0.1.1 (2020-03-24)
- all: refactoring functions to accept non pointer struct option
-
The function that accept struct XxxOptions should only received the copy of struct, not pointer.
- all: introduce new type Ciigo
-
The Ciigo type provides customizable and reusable instance of ciigo for embedding, converting, and/or serving HTTP server. This type is introduced so one can add HTTP handler or endpoint along with serving the files.
- all: set margin on sectlevel3, sectlevel4, sectlevel5
-
Using default margin (1.25rem) cause the TOC for level 3 until 5 have wide gap in between them.
Update on asciidoctor-go bring new features and enhancements,
-
Support document attribute "leveloffset".
The ":leveloffset:" on document attribute allow increment or decrement the heading level on included files.
-
Use strict document header format.
Previously, an empty line before Document Title cause the parser stop parsing the document header, now an empty lines are skipped. Also document attribute can be place anywhere, either before or after title, and in between attributes; now it can be only placed after revision or author or title.
- Fix "serve" not detecting new files
-
If there is new files on the root of directory it will not detected automatically. This release now fix this issue.
- all: remove Limitations and update Links
-
The asciidoc-go library now support scanning symlink inside Root directory. The Links sections merge the previous contents from old index.adoc.
- all: update the CLI usage in the README
-
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.
- cmd/ciigo: add flag to set package and variable name for "embed"
-
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.
- all: fix HTML files always generated when HTMLTemplate is not set
-
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.
- all: initialize memfs using New
-
When memfs not initialized using New, the [memfs.MemFS.PathNodes] will be nil. This cause any Get on new file will return 404.
- 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.
- 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".
-
Field [ConvertOptions.HtmlTemplate] become [ConvertOptions.HTMLTemplate]
-
Method [Converter.SetHtmlTemplateFile] become [Converter.SetHTMLTemplateFile]
-
Method [Converter.ToHtmlFile] become [Converter.ToHTMLFile]
-
asciidoc: fix custom ID on the first section not applied correctly
In this release, update on asciidoctor-go add new features to parse unordered list with '-' and some bug fixes related to rendering list.
The update on share module fix for permission error when scanning using memfs and HTTP redirect for request to directory that does not end with slash.
- all: ignore error permission when listing file markups
-
Instead of returning the error, ignore it and continue processing other files in the list.
- all: print log message with log package
-
This is to provide the timestamp to each log output.
- cmd/ciigo: set default IP address to loopback on serve command
-
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.
- all: use modification time to force HTML conversion
-
Previously, in changes 46bd8b68dc8c we set the Convert to always force the HTML conversion.
In this changes, we derive the decision based on modification time of HTML template and markup file. If the HTML template or markup file is newer that HTML file then the new HTML file will be generated.
- all: bring back support for Markdown
-
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.
- all: update asciidoctor-go and share module to latest version
-
Changes on the asciidoctor-go v0.4.1,
=== Bug fixes
-
all: fix empty line printed on ToHTMLBody or ToHTMLEmbedded
-
all: ignore parsing block image in paragraph
=== Enhancements
-
all: handle empty preamble
-
- all: check for symlink and re-fetch file info using os.Stat
-
Since Readdir return list of FileInfo using Lstat, any node that is symlink may return false file size and mod time.
- all: update all dependencies
-
The latest asciidoctor-go module fix parsing list description inside include directive.
- all: group all documents under directory _doc
- all: try to fix test that sometimes fail inside container
-
When the test running we create directory testdata/watcher, create a new file testdata/watcher/index.adoc and expect that the modify time for testdata/watcher is changes.
Except that sometimes it is not. The modification time of directory watcher before and after the file created most of times equal and this cause the test wait indifinitely and fail.
This changes add 1 second delay before creating file inside directory to make sure that the modification time changes.
- all: add tasks to setup test inside systemd container
-
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.
- all: remove delay for testing Watch
-
The delay sometimes cause the test locked and hung.
- all: fix HTML template loaded during Serve on non-development
-
The HTML template in the ServeOptions should not read when ciigo.Serve running on non-development environment.
- all: export internal htmlGenerator as Converter
-
The purpose of Converter is to provide a single, reusable converter for AsciiDoc file or content.
- all: add package build for Arch Linux
- all: set the Version automatically set during build
-
This require that the command build or install using "make build/install".
- all: convert the README using AsciiDoc
-
While at it, create symlink README so the git.sr.ht site can display it.
- all: merge internal/cmd/goembed to cmd/ciigo-example
-
The internal/cmd/goembed is replaced as command "embed" of cmd/ciigo-example.
The latest update on asciidoctor-go refactor the generated ref ID where ref ID is no longer prefixed with "\_" if start with ASCII letter.
- 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.
This changes also replace the topbar title with the document title, cleanup the HTML header syntax by replacing "/>" with ">", trim leading and trailing spaces on Body and embedded CSS.
- all: add CSS for admonition block
-
The style only applicable for non-icon admonition.
- all: update CSS for description list
-
Set the list title font weight to be bold and remove the font-size for list description to make the font-size consistent.
-
all: check for excluded file before processing sub directory
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.
-
cmd/ciigo: simplify and cleaning up the code
This changes move the flag "help" to command.
-
cmd/ciigo: add command to print to current version
-
all: include the path that cause an error on newHTMLGenerator
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.
-
all: reformat all files using latest goimports
While at it, replace any use of ioutil with os/io package.
-
all: update the watcher affected by changes on share module
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.
This release changes the license of this software to GPL-3.0 or later.
-
all: fix adoc files not re-converted when template file changes
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.
-
go.mod: update module asciidoctor-go to the tip
The latest tip fix rendering list check box text that get cut one character in the beginning.
-
all: re-convert markup files if HTML template is newer on GoEmbed
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.
-
all: add 1em to the bottom margin of paragraph under list
This is to make the list content readable and indistinguishable, especially when we have many list items with paragraphs.
-
all: add option IsDevelopment to ServeOptions
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.
This release update all dependencies and codes affected by updated.
Changes on asciidoctor-go,
-
all: fix parsing and rendering cross reference
-
all: allow colon ':' and period '.' on the ID
-
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"
-
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
Update to latest share module.
Fix the HTTP server not auto-reload the new changes if DEBUG value is non-zero.
Refactoring due to change on memfs package.
This changes affect the exported functions Generate() and Serve().
Previously, the Generate() function accept three options: dir, out, and htmlTemplate; this release 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).
This release replace the asciidoc parsing from libasciidoc-go to asciidoctor-go, which provide more control and stable APIs.
We also remove support form markdown markup language and focus only to support asciidoctor format from now on.
The Go module path and repository is also moved from github to git.sr.ht/~shulhan/ciigo.
-
all: simplify serving content using function Serve
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().
-
all: embed the HTML template and the stylesheet
The parameter for template either in Convert or Generate functions or in CLI now become pure optional, not default to "templates/html.tmpl" anymore. This will minimize steps for user to setup or run the library or program.
The first release support asciidoc and markdown markup language.
The v0.1.0 release has been deleted because it contains error in the dependencies and the Go module cache make it even harder to invalidate it.