| Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
=== 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.
|
|
The lib/parser has been deprecated.
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
=== 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
|
|
|
|
Given the following markup,
[square]
* item 1
[circle]
** item 2
The list on item 2 now start with `<div class="ulist circle">`.
|
|
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.
|
|
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].
[1] https://docs.asciidoctor.org/asciidoc/latest/lists/unordered/#basic-unordered-list
|
|
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
|
|
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.
|
|
|
|
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.
|
|
=== Bug fixes
* all: fix empty line printed on ToHTMLBody or ToHTMLEmbedded
* all: ignore parsing block image in paragraph
=== Enhancements
* all: handle empty preamble
|
|
The idea is to allow viewer to view the repository CHANGELOG without
changing to directory _doc.
|
|
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.
|
|
If the document contains empty preamble do not output the HTML wrapper of
it.
|
|
|
|
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.
|
|
=== 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
|
|
|
|
|
|
If the attribute value end with backslash '\', the value continue to the
next line.
|
|
This is to minimize checking for space when parsing later.
|
|
This is to prevent empty preamble being rendered in HTML content.
|
|
|
|
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!".
|
|
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.
|
|
This is to make sure that the test pass, since the linting is optional.
|
|
In the parseListOrdered, each time we found list item, we store its
counter and increment it by one so backend can use it to render the
counter.
|
|
The inline passthrough "pass:" can be used to control the substitutions
applied to a run of text.
Ref: https://docs.asciidoctor.org/asciidoc/latest/pass/pass-macro/
|
|
The meta key name must start with letter, digits, or _, but after
that _ is not allowed.
|
|
The idea is to move the parser to macro later so it can be reused by
html substitution.
|
|
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
|