summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-07Release asciidoctor-go v0.6.0 (2024-09-07)v0.6.0Shulhan
=== 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. Reference: https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/ === 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.
2024-09-07go.mod: update dependencyShulhan
2024-09-07Makefile: replace golangci-lint with "go vet"Shulhan
This is the second we remove golangci-lint. Previously, we replace it with revive, now we replace it with go internal tools "go vet". The problem is the same, golangci-lint does not works when compiled or using gotip. Also, on VM with 8GB memory, it will crash due to OOM.
2024-09-07all: fix signature of [Element.WriteByte]Shulhan
The WriteByte is the method in that conform [io.ByteWriter].
2024-08-16all: remove unnecessary TrimRightShulhan
Each lines to be parsed has been trimmed on the first load, so there is no need to do it again, on some cases.
2024-08-16all: support document attribute "leveloffset"Shulhan
The ":leveloffset:" on document attribute allow increment or decrement the heading level on included files. Reference: https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/
2024-08-13all: refactoring DocumentAttribute into structShulhan
Using struct limit the value to only string, while some attributes can be an integer value, for example "leveloffset".
2024-08-13all: rename meta or metadata words to document attributeShulhan
The idea is to provide consistent naming for metadata and attribute. The AsciiDoctor documentation mostly name them as document attribute.
2024-08-13all: replace licensing format to REUSE.tomlShulhan
Using ".reuse/dep5" has been deprecated since REUSE v3.2. While at it, add missing license to file "const.go".
2024-08-13all: rename struct "AttributeEntry" to "DocumentAttribute"Shulhan
This is to make the struct is clear that it represent the document attribute.
2024-08-13all: add element kind Section 0Shulhan
The elKindSection0 is the Document Title, the line that start with "= ".
2024-08-12go.mod: update all dependenciesShulhan
2024-08-12all: use strict document header formatShulhan
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.
2024-04-04Release asciidoctor-go v0.5.2 (2023-04-04)v0.5.2Shulhan
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.
2024-03-05all: replace if-else bytes.Equals with static string case comparisonsShulhan
2024-03-05all: comply with linter recommendationsShulhan
2024-03-05all: replace module "share" with "pakakeh.go"Shulhan
2023-12-14Release asciidoctor-go v0.5.1 (2023-12-14)v0.5.1Shulhan
=== 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 "github.com/shuLhan/share/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.
2023-12-13all: replace "lib/parser" with "strings/parser"Shulhan
The lib/parser has been deprecated.
2023-12-10all: remove dependency to "github.com/shuLhan/share/lib/debug"Shulhan
2023-12-10go.mod: set minimum Go to version 1.20 and update all dependenciesShulhan
2023-12-10all: fix custom IDs on first section got replacedShulhan
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.
2023-12-09all: rewrite tests for ToHTML using [test.Data]Shulhan
2023-12-09all: replace linter golangci-lint with revive and shadowShulhan
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.
2023-11-05go.mod: update all dependenciesShulhan
2023-10-14go.mod: update all dependenciesShulhan
2023-06-04Release asciidoctor-go v0.5.0 (2023-06-04)v0.5.0Shulhan
=== New features * all: add support for unordered list with '-' === Bug fixes * all: fix rendering blockquote without attribution * all: handle custom marker in between unordered list
2023-06-04go.mod: update share module to v0.47.0Shulhan
2023-05-30all: handle custom marker in between unordered listShulhan
Given the following markup, [square] * item 1 [circle] ** item 2 The list on item 2 now start with `<div class="ulist circle">`.
2023-05-28_doc: add HTML file to test previewing partial HTML contentShulhan
The HTML file can be viewed by running "make serve-doc" and opening http://127.0.0.1:8080/test.html . It provide a textarea where developer can input partial HTML and a button Preview to render the partial HTML on the right.
2023-05-28all: add support for unordered list with '-'Shulhan
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 (`&#8212;` 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]. [1] https://docs.asciidoctor.org/asciidoc/latest/lists/unordered/#basic-unordered-list
2023-05-28all: reformat list item, remove numbering prefix xx.x.Shulhan
Somehow using "X." prefix after list item rendered different on different host. For example, given these markdown * 16. Sections * 16.1. Titles as HTML headings On github [1], * xvi. Sections o 16.1. Titles as HTML headings On SourceHut [2], * Sections o 16.1. Titles as HTML headings On pkg.go.dev [3], o i. Sections o 16.1. Titles as HTML headings [1] https://github.com/shuLhan/asciidoctor-go/tree/f3bc802f3978192ad25176a0f9e2c24ac855c23a [2] N/A [3] https://pkg.go.dev/git.sr.ht/~shulhan/asciidoctor-go@v0.4.2-0.20230527193852-5d485c227553#section-readme
2023-05-28all: fix rendering blockquote without attributionShulhan
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.
2023-05-28go.mod: update all dependencies and Go version to 1.19Shulhan
2023-05-27all: convert README from Asciidoc to 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. How did Markdown become defactor standard? Its lack comment, creating table of content, macro, and many more.
2023-03-02Release asciidoctor-go v0.4.1 (2023-03-02)v0.4.1Shulhan
=== Bug fixes * all: fix empty line printed on ToHTMLBody or ToHTMLEmbedded * all: ignore parsing block image in paragraph === Enhancements * all: handle empty preamble
2023-03-02all: move CHANGELOG from _doc to rootShulhan
The idea is to allow viewer to view the repository CHANGELOG without changing to directory _doc.
2023-03-02all: fix empty line printed on ToHTMLBody or ToHTMLEmbeddedShulhan
Given the following adoc, ---- = T ---- If we call ToHTMLBody, the output is ---- <div id="header"> <h1>T</h1> ---- This changes fix the empty line at the top.
2023-03-02all: handle empty preambleShulhan
If the document contains empty preamble do not output the HTML wrapper of it.
2023-03-02all: update share modulesShulhan
2023-03-02all: ignore parsing block image in paragraphShulhan
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.
2023-02-12Release asciidoctor-go v0.4.0 (2023-02-12)v0.4.0Shulhan
=== New features * all: add support for document attribute "last-update-label" * all: implement inline macro for passthrough ("pass:") * all: implement macro "footnote:" === 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 === Enhancements * all: support multi line attribute values
2023-02-12go.mod: update share module to v0.43.0Shulhan
2022-12-19all: update reference for preamble and add unit testShulhan
2022-12-19all: support multi line attribute valuesShulhan
If the attribute value end with backslash '\', the value continue to the next line.
2022-12-19all: trim right spaces on each lines before parsingShulhan
This is to minimize checking for space when parsing later.
2022-12-16all: detach parsing preamble from contentShulhan
This is to prevent empty preamble being rendered in HTML content.
2022-12-16all: add package documentation and comment on VersionShulhan
2022-12-16all: fix the orders of generated HTML metaShulhan
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!".
2022-12-16all: add support for document attribute "last-update-label"Shulhan
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.