aboutsummaryrefslogtreecommitdiff
path: root/converter.go
AgeCommit message (Collapse)Author
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-01-07all: auto convert markup when HTTP client request GET to HTML fileShulhan
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.
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-11-09all: use modification time when deciding when to convert to HTMLShulhan
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.
2023-10-13all: print log message with log packageShulhan
This is to provide the timestamp to each log output.
2023-07-01all: replace ioutil.ReadFile with os.ReadFileShulhan
The ioutil has been deprecated since Go 1.19.
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-07all: fix HTML template loaded during Serve on non-developmentShulhan
The HTML template in the ServeOptions should not read when ciigo.Serve running on non-development environment.
2022-08-06all: cleaning up codesShulhan
2022-08-01all: export the Converter method to reload HTML templateShulhan
The SetHtmlTemplateFile set or changes the HTML template used by Converter to convert AsciiDoc to HTML.
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-08-01all: export internal htmlGenerator as ConverterShulhan
The purpose of Converter is to provide a single, reusable converter for AsciiDoc file or content.