| 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.
|
|
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.
|
|
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.
|
|
The function that accept struct XxxOptions should only received
the copy of struct, not pointer.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
Instead of creating variables on top of switch, only declare them when
needed.
|
|
=== 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".
|
|
|
|
|
|
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]
|
|
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.
|
|
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
|
|
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.
|
|
The latest asciidoctor-go module fix parsing list description inside
include directive.
|
|
This require that the command build or install using "make build/install".
|
|
The internal/cmd/goembed is replaced as command "embed" of
cmd/ciigo-example.
|
|
Replace any usage of ":=" with explicit variable declaration for better
types clarity.
|
|
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
|
|
This changes update the embedded Go file on cmd/ciigo-example and
rename field Development on MemFS Options.
|
|
This changes move the flag "help" to command.
|
|
|
|
While at it, replace any use of ioutil with os/io package.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
The support for .md file has been moved to git.sr.ht/~shulhan/mdgo.
|
|
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.
|
|
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.
|
|
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.
|
|
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).
|
|
* 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
|
|
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.
|
|
The ToHTMLBody generate table of contents at the top, while ToEmbeddedHTML
require ":toc:" to set to "preamble" or "macro" to get it rendered.
|
|
While at it simplify the example of index.adoc.
|
|
|
|
|
|
|
|
|
|
|