asciidoctor-go v0.7.1 (2025-04-18)
[BUG FIX] Fix the logic when applying default embedded CSS.
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".
[ENHANCEMENT] Export the constant for document attribute "stylesheet".
asciidoctor-go v0.7.0 (2025-04-18)
[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.
asciidoctor-go v0.6.2 (2025-02-01)
[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.
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".
asciidoctor-go v0.6.1 (2024-12-08)
Bug fixes
- all: fix error log when failed to open included file
-
The log use the wrong variable when printing path for failed include file.
- all: fix reading include file when parent path is absolute
-
Previously, if the parent document is opened using absolute path and it contains include directive, the included file will fail to read because the parent path is joined with current working directory.
asciidoctor-go v0.6.0 (2024-09-07)
Breaking changes
- all: rename struct "AttributeEntry" to "DocumentAttribute"
-
This is to make the struct is clear that it represent the document attribute.
- all: rename struct "AttributeEntry" to "DocumentAttribute"
-
This is to make the struct is clear that it represent the document attribute.
- all: refactoring DocumentAttribute into struct
-
Using struct limit the value to only string, while some attributes can be an integer value, for example "leveloffset".
New features
- all: support document attribute "leveloffset"
-
The ":leveloffset:" on document attribute allow increment or decrement the heading level on included files.
Enhancements
- all: 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.
- all: remove unnecessary TrimRight
-
Each lines to be parsed has been trimmed on the first load, so there is no need to do it again, on some cases.
asciidoctor-go v0.5.2 (2023-04-04)
This release only contains 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". For more information see the change logs at "pakakeh.go" module.
- all: comply with linter recommendations
-
Most of the code changes related to refactoring if-else witch switch statement.
- all: replace if-else bytes.Equals with static string case comparisons
-
Using string instead of [bytes.Equal] give code much more readable.
asciidoctor-go v0.5.1 (2023-12-14)
Bug fixes
- all: fix custom IDs on first section always got replaced
-
Any custom ID on the first section always replaced with the subsection because, first, when detecting preamble we did not check for line with kind ID "[[…]]" an short ID "[#…]". Second, when parsing preamble we did not stop when we found line kind ID and short ID.
This preamble thing is kind of annoying. We need to revisit again how to detect preamble, maybe not calling separate block parser, but making it linear as the default first child of parent element.
Chores
- all: replace "lib/parser" with "strings/parser"
-
The lib/parser has been deprecated in share module.
- all: remove dependency to "git.sr.ht/~shulhan/pakakeh.go/lib/debug"
- all: replace linter golangci-lint with revive and shadow
-
The golangci-lint does not output any results anymore Either we are getting good at writing Go or the linter itself is become less good. We also have seen that the latest golangci-lint is failed to build with Go tip, a simple "make" on the golangci-lint never success in my experiences.
This changes fix all the output reported by the revive and shadow.
asciidoctor-go v0.5.0 (2023-06-04)
New features
- all: add support for unordered list with '-'
-
The unordered list item with hyphen ('-') cause too much confusion and inconsistency, nevertheless most of still use it.
Case one, given the following markup,
- Item 1 + "A line of quote" -- Author
Is the "Author" the sub item in list or we are parsing author of quote paragraph?
Case two, the writer want to write em dash (
—
in HTML Unicode) but somehow the editor wrap it and start in new line.As a reminder, the official documentation only recommend using hyphen for simple list item [1].
Bug fixes
- all: fix rendering blockquote without attribution
-
Previously, in the htmlWriteBlockQuoteEnd, if attribution is set we add HTML tag <div> and close it later after we add citation.
The issue is we did not check if attribution is true again when we add closing tag for div, which make the div above of blockquote get closed.
- all: handle custom marker in between unordered list
-
Given the following markup,
[square] * item 1 [circle] ** item 2
The list on item 2 now start with
<div class="ulist circle">
.
asciidoctor-go v0.4.1 (2023-03-03)
Bug fixes
- all: fix empty line printed on ToHTMLBody or ToHTMLEmbedded
-
Given the following adoc,
= T
If we call ToHTMLBody, the output is
(empty line here) <div id="header"> <h1>T</h1>
This changes remove the empty line at the top.
- all: ignore parsing block image in paragraph
-
Previously, if we have block image in paragraph, we parse it as inline image but with invalid src, for example
image::my.png[multi line].
would be parsed as <img src=":imy.png" alt="multi line">. This is incorrect according to asciidoctor output.
Enhancements
- all: handle empty preamble
-
If the document contains empty preamble do not output the HTML wrapper of it.
asciidoctor-go v0.4.0 (2023-02-12)
New features
- all: add support for document attribute "last-update-label"
-
By default the last-update-label value set to "Last updated" and the value is the document modification time.
If the label is suppressed with "!", no "Last updated" will be print on the footer.
- all: implement inline macro for passthrough ("pass:")
-
The inline passthrough "pass:" can be used to control the substitutions applied to a run of text.
- all: implement macro "footnote:"
-
Macro footnote grammar,
"footnote:" [ REF_ID ] "[" STRING "]"
In asciidoctor, footnote can be placed anywhere, even after WORD without space in between.
The REF_ID, define the unique ID for footnote and can be used to reference the previous footnote. The first footnote with REF_ID, should have the STRING defined. The next footnote with the same REF_ID, should not have the STRING defined; if its defined, the STRING is ignored.
Bug fixes
- all: detach parsing preamble from content
-
This is to prevent empty preamble being rendered in HTML content.
- all: fix the orders of generated HTML meta
-
The meta tags from original asciidoctor are ordered as viewport, generator, description, keywords, and then author.
While at it remove empty style tag due to when testing we use empty.css not "stylesheet!".
Enhancements
- all: support multi line attribute values
-
If the attribute value end with backslash '\', the value continue to the next line.
asciidoctor-go v0.3.2 (2022-09-05)
Bug fix
- all: fix parsing list description inside include directive
-
Previously, given the following include statements in the main document
include::list_desc.adoc[] include::list_desc.adoc[]
Where list_desc.adoc content is,
Item 00:: + -- * Bullet 0 + Description 0. * Bullet 1 --
The first include is parsed correctly, but the second include is parsed as is.
Chores
- all: update share module to v0.41.0
- all: move all documentation into directory _doc
-
While at it reformat the README, add section for development, add link for Go documentation.
asciidoctor-go v0.3.1 (2022-08-06)
Chores
- all: rewrite unit tests for inlineParser using test.Data
-
Using string literal for testing string input that may contains backtick or double quote make the test code become unreadable and hard to modify.
The test.Data help this by moving the input and expected output into a file that can we write as is.
- all: cleaning up codes
-
Use raw string literal whenever possible.
- go.mod: update share to v0.40.0
-
This update fix some issues related to new line on test.Data.
asciidoctor-go v0.3.0 (2022-07-24)
This release set the minimum Go version to 1.18.
Breaking changes
- all: refactoring handling generate ref ID
-
Previously, we always set the ID prefix and separator default to "_" if its not set, this cause all of the ID is prefixed with "_".
This changes use strict rules when generating ID following the Mozilla specification [1] and latest AsciiDoc Language [2].
The idprefix must be ASCII string. It must start with "_", "-", or ASCII letters, otherwise the "_" will be added to the beginning. If one of the character is not valid, it will replaced with "_".
The
idseparator
can be empty or single ASCII character ('_' or '-', ASCII letter, or digit). It is used to replace invalid characters in the REF_ID.
Enhancements
- all: sort the generated HTML meta by names
-
The order of meta names are "author", "description", "generator", and then "keywords".
- all: store the list of author names under Attributes "author_names"
-
Previously, to get list of author names, we need to iterate each of the Authors field.
This changes set the Attributes "author_names" to list of author full names, each separated by comma.
- all: add default metadata "generator"
-
The generator metadata contains the library name and its current version.
- all: realign all structs
-
This is to minimize memory allocation when using asciidoctor.
Chores
- all: rewrite test using lib/test.Data
-
Previously, to test parser and check the generated HTML, we write AsciDoc input and expected HTML output using literal string
…
. The text of input and output sometimes long, take multiple lines, which makes the test code ugly, hard to write, and read.Using lib/test.Data we can write the input and output as the AsciiDoc markup and the HTML markup as is, simplify writing the test and more readable.
asciidoctor-go v0.2.0 (2022-03-04)
This release changes the license of asciidoctor-go from BSD to GPL 3.0 or later.
Bug fixes
- all: fix list check box text get cut one character
-
Given the following asciidoc check box markup,
-
❏ abc
It will rendereded as "❏ bc" instead of "❏ abc".
-
Chores
- all: replace bytes.Title and strings.Title with function
-
Both of those functions has been deprecated.
Since the Title function is to convert the adminition string into a human title (first letter uppercase), we can use a function to do that. Any unknown admonition will be returned as is.
asciidoctor-go v0.1.1 (2021-12-06)
Bug fixes
- all: fix parsing and rendering cross reference
-
Previously, when parsing cross reference we assume that if the string contains upper-case letter then it’s a label so we store it as title to search for ID later.
The bug is when ID is set manually and its contains upper-case for example "[#Id]".
This changes fix this issue by storing cross reference first, not assuming it as ID or title, and then when doing rendering we check whether its ID or title.
- all: allow colon ':' and period '.' on the ID
-
According to XML spec [1], the colon is allowed as the first and the next character. While period is only allowed on the next characters.
asciidoctor-go v0.1.0 (2021-03-06)
The asciidoctor-go is the Go module to parse the AsciiDoc ™ markup and convert it into HTML5.
This first release bring almost all AsciiDoc syntax except for include directive, inter-document cross-reference, macros, and non-primary syntax features.
I hope this library can be useful for Gophers who need the power of AsciiDoc in their workflows.