| Age | Commit message (Collapse) | Author |
|
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 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
|
|
Since the all documentation files has been moved to _doc,
the serve-doc task should watch and serve directory _doc too.
|
|
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.
|
|
|
|
While at it reformat the README, add section for development, add
link for Go documentation.
|
|
=== Chores
* all: rewrite unit tests for inlineParser using test.Data
* all: cleaning up codes
* go.mod: update share to v0.40.0
|
|
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.
|
|
Use raw string literal whenever possible.
|
|
This update fix some issues related to new line on test.Data.
|
|
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
|
|
The order of meta names are "author", "description", "generator", and
then "keywords".
|
|
|
|
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.
|
|
The generator metadata contains the library name and its current version.
|
|
By exporting this meta name, any frontend for this library can use
it to check for key and value.
|
|
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".
|
|
Link each supported features to their official document and add that
link as Reference in the SPECS.
Currently only checked and Document header.
|
|
An empty line mark as the end of document header.
|
|
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.
|
|
Using spaces before comment make the line parsed as block literal.
This is not a bug, as previously noted.
|
|
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.
|
|
Since the Parse return a *Document it should grouped into document.go
to make the code consistent.
|
|
The state should store the previous kind of line being parsed, not the
next state.
|
|
This is to prevent empty lines that contains only white spaces considered
as non-empty line.
While at it, fix typo in the comment.
|
|
This is to allow testing the preamble inside the document.
|
|
This is to make the generated HTML from asciidoctor match with the
library.
Without it, all IDs are prefixed with "_".
|
|
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/
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
This changes replace any use of io/ioutil with os package.
|
|
|
|
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.
|
|
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.
|
|
Signed-off-by: Shulhan <ms@kilabit.info>
|
|
Given the following asciidoc check box markup,
* [ ] abc
It will rendereded as "❏ bc" instead of "❏ abc".
This commit fix this issue.
|
|
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.
|
|
|
|
=== 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
|
|
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.
|
|
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
|
|
|
|
|
|
The latest update on share v0.25.1 remove the last boolean parameter
on lib/test.Assert().
|
|
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.
|
|
While at it, increase the minimum Go version from 1.13 to 1.15
|
|
|