| Age | Commit message (Collapse) | Author |
|
While at it, update the example index by removing unnecessary
external image, and update links to open in new tab/window.
|
|
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.
|
|
|
|
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".
|
|
|
|
|
|
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 changes update the embedded Go file on cmd/ciigo-example and
rename field Development on MemFS Options.
|
|
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.
|
|
|
|
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"
|
|
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.
|
|
|
|
|
|
|
|
|
|
The latest release of libasciidoc changes the API to convert adoc content
to HTML.
Instead of one call, we need to call ParseDocument first to get
the document metadata (Attributes) and then call Convert() to convert it
to HTML.
|
|
|
|
While at it, also move the templates into _example and all assets
into the same directory.
|
|
|
|
|
|
|
|
The internal search template require the HTML generator to be initialized
with HTML template that provide when running "go generate". Without
the template, the internal search function will not work.
|
|
|
|
The search function is available through internal API "/_internal/search"
with single parameter "q" that contains one or more words to search.
|
|
|
|
The "cmd/ciigo-example" will be used to test and give an example of
how to build a binary that contains static, generated .go source file.
|