| Age | Commit message (Collapse) | Author |
|
[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.
[CHORE]
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".
|
|
|
|
The fieldalignment and shadow is linter from golang.org/x/tools.
This linters actually have an API that can be combined into a program,
which provided by package "pakakeh.go/lib/goanalysis".
|
|
|
|
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.
|
|
|
|
=== 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.
|
|
|
|
Using 8080 is too common and has cause conflict with some service on my
development laptop.
|
|
This is to make it easy to see how it parsed and how it written to HTML,
make the code more searchable.
While at it, add test for block image.
|
|
|
|
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.
|
|
|
|
=== 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.
|
|
|
|
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.
|
|
The WriteByte is the method in that conform [io.ByteWriter].
|
|
Each lines to be parsed has been trimmed on the first load, so
there is no need to do it again, on some cases.
|
|
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/
|
|
Using struct limit the value to only string, while some attributes
can be an integer value, for example "leveloffset".
|
|
The idea is to provide consistent naming for metadata and attribute.
The AsciiDoctor documentation mostly name them as document attribute.
|
|
Using ".reuse/dep5" has been deprecated since REUSE v3.2.
While at it, add missing license to file "const.go".
|
|
This is to make the struct is clear that it represent the document
attribute.
|
|
The elKindSection0 is the Document Title, the line that start
with "= ".
|
|
|
|
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.
|
|
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.
|