aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-20all: implement macro "footnote:"Shulhan
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.
2022-10-20go.mod: update the share moduleShulhan
2022-09-05Release asciidoctor-go v0.3.2 (2022-09-05)v0.3.2Shulhan
=== Bug fix * all: fix parsing list description inside include directive === Chores * all: update share module to v0.41.0 * all: move all documentation into directory _doc
2022-09-05all: update the path on serve-doc taskShulhan
Since the all documentation files has been moved to _doc, the serve-doc task should watch and serve directory _doc too.
2022-09-05all: fix parsing list description inside include directiveShulhan
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.
2022-09-04all: update share module to v0.41.0Shulhan
2022-08-25all: move all documentation into directory _docShulhan
While at it reformat the README, add section for development, add link for Go documentation.
2022-08-06Release asciidoctor-go v0.3.1 (2022-08-06)v0.3.1Shulhan
=== Chores * all: rewrite unit tests for inlineParser using test.Data * all: cleaning up codes * go.mod: update share to v0.40.0
2022-08-06all: rewrite unit tests for inlineParser using test.DataShulhan
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.
2022-08-05all: cleaning up codesShulhan
Use raw string literal whenever possible.
2022-08-05go.mod: update share to v0.40.0Shulhan
This update fix some issues related to new line on test.Data.
2022-07-24Release asciidoctor-go v0.3.0 (2022-07-24)v0.3.0Shulhan
This release set the minimum Go version to 1.18. === Breaking changes * all: refactoring handling generate ref ID === Enhancements * all: sort the generated HTML meta by names * all: store the list of author names under Attributes "author_names" * all: add default metadata "generator" * all: realign all structs === Chores * all: rewrite test using lib/test.Data
2022-07-24all: sort the generated HTML meta by namesShulhan
The order of meta names are "author", "description", "generator", and then "keywords".
2022-07-24all: use the Attributes "author_names" to render meta "author" in ToHTMLShulhan
2022-07-24all: store the list of author names under Attributes "author_names"Shulhan
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.
2022-07-24all: add default metadata "generator"Shulhan
The generator metadata contains the library name and its current version.
2022-07-24all: export meta name for author, description, and keywordsShulhan
By exporting this meta name, any frontend for this library can use it to check for key and value.
2022-07-24all: rename the HTML output for test-parserShulhan
The HTML output file from asciidoctor is renamed to test.exp.html, and HTML output file from this library is renamed to test.got.html. The test.html in testdata is generated from ciigo, when running "make serve-doc".
2022-07-24all: update README and SPECSShulhan
Link each supported features to their official document and add that link as Reference in the SPECS. Currently only checked and Document header.
2022-07-24all: mention in SPECS that there are no empty line in document headerShulhan
An empty line mark as the end of document header.
2022-07-24all: register the license and copyright in .reuse/dep5Shulhan
For files that cannot be add the license header (either the files auto generated during test or the comment not supported), we register the license and copyright in the .reuse/dep5.
2022-07-24all: mention in the SPECS that comment cannot start with spacesShulhan
Using spaces before comment make the line parsed as block literal. This is not a bug, as previously noted.
2022-07-24all: rewrite test using lib/test.DataShulhan
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.
2022-07-17all: move Parse and parse functions to documentShulhan
Since the Parse return a *Document it should grouped into document.go to make the code consistent.
2022-07-17all: make the parseHeader state clearShulhan
The state should store the previous kind of line being parsed, not the next state.
2022-07-17all: trim the right spaces on each line during parsing kind of lineShulhan
This is to prevent empty lines that contains only white spaces considered as non-empty line. While at it, fix typo in the comment.
2022-07-17all: add element preamble into DocumentShulhan
This is to allow testing the preamble inside the document.
2022-07-17testdata: set attribute idprefix to emptyShulhan
This is to make the generated HTML from asciidoctor match with the library. Without it, all IDs are prefixed with "_".
2022-07-16all: refactoring handling generate ref IDShulhan
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. [1] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id [2] https://docs.asciidoctor.org/asciidoc/latest/sections/id-prefix-and-separator/
2022-07-16all: reformat the README back to asciidocShulhan
This change use file name "README" for serving it in sr.ht, since the site does not support rendering asciidoc. The index.adoc is provided as symlink to README. While at it, add list of BUGS and ENHANCEMENTS under TODO sections; link to CHANGELOG, and other files.
2022-07-16all: run fieldalignment in lint taskShulhan
2022-07-16all: reformat all Go filesShulhan
Replace any usage of ":=" with "var" declaration with type. The ideas is to make the code reader know what is the expected return value of function/method.
2022-07-16all: realign all structsShulhan
Minimize struct allocation, * columnFormat: from 40 to 16 bytes (-24 bytes) * document: from 400 to 392 bytes (-8 bytes) * element: from 312 to 264 bytes (-48 bytes) * elementAttribute: from 80 to 72 bytes (-8 bytes) * elementInclude: from 128 to 120 bytes (-8 bytes) * elementTable: from 88 to 64 bytes (-24 bytes) * inlineParser: from 64 to 40 bytes (-24 bytes) Plus all structs in the test files.
2022-07-16go.mod: set the minimum Go version to 1.18 and update share moduleShulhan
This changes replace any use of io/ioutil with os package.
2022-07-16all: reformat all Go filesShulhan
2022-03-09all: reverse the license symbolic linkShulhan
Github and pkg.go.dev cannot handle symbolic link of COPYING file on the root, but the "reuse lint" command can handle it. So, we make a copy of license to COPYING and under LICENSES directoy we create symbolic link to ../COPYING.
2022-03-04Release asciidoctor-go v0.2.0 (2022-03-04)v0.2.0Shulhan
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 used 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.
2022-02-21all: relicense the asciidoctor-go under GPL 3.0 or laterShulhan
Signed-off-by: Shulhan <ms@kilabit.info>
2022-02-16all: fix list check box text get cut one characterShulhan
Given the following asciidoc check box markup, * [ ] abc It will rendereded as "&#10063; bc" instead of "&#10063; abc". This commit fix this issue.
2022-02-06all: replace bytes.Title and strings.Title with functionShulhan
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.
2022-02-06go.mod: update share module to v0.34.0Shulhan
2021-12-06Release asciidoctor-go v0.1.1 (2021-12-06)v0.1.1Shulhan
=== 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. [1] https://www.w3.org/TR/REC-xml/#NT-Name
2021-12-06all: fix parsing and rendering cross referenceShulhan
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.
2021-12-06all: allow colon ':' and period '.' on the IDShulhan
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. [1] https://www.w3.org/TR/REC-xml/#NT-Name
2021-12-06go.mod: update to latest share moduleShulhan
2021-10-05go.mod: update share module to v0.30.0Shulhan
2021-04-06go.mod: set minimum Go version to 1.16 and update module share to v0.25.1Shulhan
The latest update on share v0.25.1 remove the last boolean parameter on lib/test.Assert().
2021-03-06Release asciidoctor-go v0.1.0 (2021-03-06)v0.1.0Shulhan
The asciidoctor-go is the Go module to parse the AsciiDoc (TM) 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.
2021-03-06all: update dependencies to latest versionShulhan
While at it, increase the minimum Go version from 1.13 to 1.15
2020-12-26document_parser: remove unused debug statementShulhan