aboutsummaryrefslogtreecommitdiff
path: root/filehtml.go
AgeCommit message (Collapse)Author
15 min.all: stores all document attributes into MetadatadevShulhan
This is to allow user to defines their own key-value in document attributes and access it in HTML template using "{{ .Metadata.<key> }}".
2026-02-02all: allow combination of default and custom stylesheetShulhan
To combine default stylesheet with custom CSS, set the value to "default" and the file name of custom CSS, separated by comma. This is the recommended way to use custom stylesheet since it can be set only on specific pages. ---- // In asciidoctor: :stylesheet: default, custom.css // In markdown: stylesheet: default, custom.css ---- To disable default stylesheet and only using custom CSS, set the value only to the file name of custom CSS. Another way to use custom stylesheet is by creating your own template and pass it to `serve` or `convert` command. This method makes the stylesheet applied to all pages.
2026-01-24all: embed CSS and index HTML template using memfsShulhan
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.
2025-04-18go.mod: update asciidoctor-go module to fix default embedded CSSShulhan
By default, the document contains ":stylesheet:" attribute, which means using the default embedded CSS. To disable it, unset the attribute using ":stylesheet!:". To overwrite it, set the attribute to path of CSS file ":stylesheet: my.css".
2024-08-18go.mod: update asciidoctor-go to the tipShulhan
2023-12-10all: fix all warnings reported by linter reviveShulhan
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]
2023-05-14all: bring back support for MarkdownShulhan
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.
2022-08-06all: cleaning up codesShulhan
2022-08-01all: export convert method in Converter as ToHtmlFileShulhan
This is the first public API provided for Converter, as promised in the previous commit.
2022-07-24all: generate HTML meta data and replace the top header titleShulhan
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.
2022-05-19all: reformat all files using latest goimportsShulhan
While at it, replace any use of ioutil with os/io package.
2022-03-04all: re-licensing ciigo under GPL-3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl/ for more information.
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-02-21all: add the fileHTML type to fileMarkup typeShulhan
This is to minimize recreating the fileHTML for the same fileMarkup, and to simplify operation that require fileMarkup and fileHTML at the same time.
2020-11-26all: remove the Author and DateShulhan
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.
2020-11-24go.mod: update with latest asciidoctor-goShulhan
Changes, ea961ec (HEAD -> main, origin/main) chore: increase the debug value to supress logs on DEBUG=1 6f33f2a README: change the format to markdown d5502ca all: support all column style "a", "e", "h", "l", "m", "d", "s", "v" f14e27f go.mod: update with latest share module f1c0969 all: implement parser for table 4f24d95 all: support forcing line break by ending the line with " +\n" 18f26d6 all: change attributeClass from map to slice 43dfd5e all: support section "[discrete]" headings style 4a96e9e all: implement additional metadatas aa9956d html_backend: check for meta "version-label" when generating footer 73255a6 all: support additional metadatas 02594b3 all: unpack the revision number, date, and remark into Revision 15ab720 all: add support for multiple authors with email 0d1a3e6 all: change the classes field from slice to map d63f184 all: minimize number of short HTML templates fa7fd13 all: add support for disable rendering title using "showtitle!" 7e3de28 all: add method ToEmbeddedHTML 1d89381 all: support meta "noheader" e108779 all: parse the document subtitle 6429bf9 all: support setting document title through meta "doctitle" 842a827 all: fix linter warnings 3cbc0a0 all: minimize error checking by using bytes.Buffer 31c0a7d document_parser: remove unused return 'c' ab98ae3 document_parser: minimize duplicate code when parsing paragraph 177f09b all: split between document and a document parser 54c1fa5 all: rewrite HTML backend template without text/template
2020-11-09go.mod: update to latest asciidoctor-goShulhan
2020-11-04all: update with latest asciidoctor moduleShulhan
2020-11-03all: replace libasciidoc with asciidoctor-goShulhan
2020-10-08all: check for zero last updated when unpacking adoc metadataShulhan
If the date is zero ("0001-01-01 ...") reset it to empty string and do not render it on HTML output.
2020-10-07all: update to libasciidoc v0.5.1Shulhan
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.
2020-05-01all: embed the HTML template and the stylesheetShulhan
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.
2020-03-25all: move the metadata keys as constantsShulhan
2020-03-24all: rename markupFile to fileMarkupShulhan
This is to make it consistent with fileHTML.
2019-08-14filehtml: unpack the author and date from document metadataShulhan
2019-08-05all: add support for markdown markup languageShulhan
Due to the popularity of markdown format, we decide to support converting markdown file in ciigo. While at it ignore all files or directories that start with dot, which are hidden file in unix-like system.
2019-05-12go.mod: update to latest libasciidoc and shareShulhan
The update on libasciidoc affect the unpacking asciidoc metadata, which change the attribute "doctitle" to "title".
2019-05-09filehtml: save other metadata as map of string to stringShulhan
One can use the map in template using the following syntax {{ index .Metadata "key" }}
2019-04-19ciigo: program to write static web server using asciidoc markup languageShulhan
This first commit provide the following features, * automatically regenerate asciidoc files on development, * generate static and HTML files into Go source code, and * running binary with embedded contents