| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
This update have changes on [lib/http.FSHandler] that return second
parameter, status code.
|
|
This is the last release for year 2025.
In the README, we fix broken "Change log" link when rendered on pkg.go.dev
and sr.ht sites.
The go.mod has been updated to use minimum Go 1.24.0; and all dependencies
has been updated to latest release.
Happy holidays!
|
|
This release update the core asciidoctor-go module that brings several new
features.
[NEW FEATURE] **Support include directive inside block code.**
Example of block code with include directive,
----
...
include::file[]
...
----
[NEW FEATURE] **Support document attribute "docdir".**
The "docdir" attribute contains the full path of the directory that
contains the source document.
By default it is set to the directory where the Document resided.
[NEW FEATURE] **Add default HTML stylesheet**.
The generated HTML now contains the default stylesheet.
The stylesheet is copied from HTML file generated by Asciidoctor
v2.0.23.
|
|
[BUG FIX]
Fix section detected as paragraph after list and comment.
Previously, given the following markup,
----
* Sub list
+
Sub list content.
//}}}
//{{{
== Sub 2
//}}
----
The section "Sub 2" will be parsed as paragraph instead of new section.
[CHORE]
In the linter, we replace the fieldalignment and shadow using our internal
gocheck command.
This linters actually have an API that can be combined into a program,
which provided by package "pakakeh.go/lib/goanalysis".
|
|
This is the first major release of ciigo on the new year of 2025.
We bring many enhancements and update on the documentation.
[ENHANCEMENT]
The first changes is refactoring to use watchfs/v2. The [watchfs/v2]
bring new enhancements by watching only single file instead of all
markup files for changes. This minimize number of goroutine calling
[os.Stat] on each markup files.
[BUG FIX]
When listing the file markups, if the node is symlink (either file or
directory) and target its not exist, continue to the next node instead
of returning error. The same is true for directory that cannot be
opened, probably due to broken symlink or permission.
[ENHANCEMENT]
In development mode, where [ServeOptions.IsDevelopment] is set to true
or when running "ciigo serve", the ciigo HTTP server will check if the
new markup file is newer than HTML file when user press refresh or
reload on the browser. If its newer, it will convert the markup file and
return the new content of HTML file.
This allow quick preview without waiting for watcher to complete.
[ENHANCEMENT]
The README has been revamped to include section on how to install ciigo
as program, how to running ciigo convert and serve, how to write content
and view it live on browser, and how to deploy it.
On the section "ciigo as library" we point the user the sample code at
"internal/cmd/ciigo-example" instead of writing long code at the front.
[BUG FIX]
This release also fix Exclude option does not get processed when calling
GoEmbed, or running "ciigo embed".
|
|
|
|
When listing the file markups, if the node is symlink (either file or
directory) and target its not exist, continue to the next node instead
of returning error.
The same is true for directory that cannot be opened, probably due to
broken symlink or permission.
|
|
=== Breaking changes
* all: refactoring functions to accept non pointer struct option
The function that accept struct XxxOptions should only received the
copy of struct, not pointer.
=== New features
* 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.
=== Enhancements
* 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.
|
|
The function that accept struct XxxOptions should only received
the copy of struct, not pointer.
|
|
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.
|
|
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.
Reference: https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/
* 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.
|
|
=== Bug fixes
* 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.
=== Others
* 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.
|
|
=== New features
* 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.
=== Enhancements
* 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.
|
|
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.
|
|
=== 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".
|
|
|
|
=== Breaking changes
* Field [ConvertOptions.HtmlTemplate] become [ConvertOptions.HTMLTemplate]
* Method [Converter.SetHtmlTemplateFile] become
[Converter.SetHTMLTemplateFile]
* Method [Converter.ToHtmlFile] become [Converter.ToHTMLFile]
=== Bug fix
* asciidoc: fix custom ID on the first section not applied correctly
|
|
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]
|
|
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.
=== Bug fixes
all: ignore error permission when listing file markups::
Instead of returning the error, ignore it and continue processing
other files in the list.
=== Enhancements
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::
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.
|
|
Previously, in changes 46bd8b68dc8c we pass the force=true to Convert
function.
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.
|
|
|
|
Previously, the convert command only check if the markup file is newer
than the output file.
If the template file updated, it will not re-convert the markup file.
This changes fix this by always convert the markup files regarding
their output modification times.
|
|
Instead of returning the error, ignore it and continue processing other
files in the list.
|
|
=== New features
* 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.
|
|
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.
|
|
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
|
|
=== Bug fix
* all: check for symlink and re-fetch file info using os.Stat
=== Chores
* all: update all dependencies
* all: group all documents under directory _doc
* all: try to fix test that sometimes fail inside container
* all: add tasks to setup test inside systemd container
|
|
Since Readdir return list of FileInfo using Lstat, any node that is
symlink may return false file size and mod time.
|
|
=== Bug fixes
* 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.
|
|
=== New features
* all: export internal htmlGenerator as Converter
=== Chores
* all: add package build for Arch Linux
* all: set the Version automatically set during build
* all: convert the README using AsciiDoc
* all: merge internal/cmd/goembed to cmd/ciigo-example
|
|
This require that the command build or install using "make build/install".
|
|
|
|
Replace any usage of ":=" with explicit variable declaration for better
types clarity.
|
|
The purpose of Converter is to provide a single, reusable converter
for AsciiDoc file or content.
|
|
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.
|
|
While at it, replace any use of ioutil with os/io package.
|
|
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.
|
|
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.
|
|
See https://kilabit.info/journal/2022/gpl/ for more information.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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"
|
|
|
|
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.
|