| Age | Commit message (Collapse) | Author |
|
A line that start with one or more space will be considered
as literal paragraph.
Once literal line found it will end until an empty line.
|
|
Previously, we try to fix the anchor position by using "flex-direction:
row-reverse".
This cause the formatted text inside title also become reversed.
For example,
== With `mono`
Will rendered as
mono With $
This is not as expected.
This changes fix this by rendering the anchor on the right after title.
|
|
In Asciidoctor, when `:sectanchors:` is set, the default anchor symbol
position is absolute on the left side of heading text with block display
option (the symbol located outside of box area of headers).
In special case, this cause an overflow when the generated HTML are
rendered inside flex with fixed height (the body is scrollable with empty
content on bottom).
This module changes the anchor symbol position to the right side of
heading text to prevent scroll on such layout, without absolute position
and normal inline layout.
|
|
The asciidoctor behaviour will not recognize list that is not started
by empty line, similar to our implementation.
|
|
If the text inside the inline format contains escaped character, the
parsing failed to find the closed character which cause the format is
not rendered as expected.
|
|
The aria-label help user with screen reader to discern and navigate
the anchor.
Ref: https://dequeuniversity.com/rules/axe/4.11/link-name
|
|
|
|
Using separate file allow tracking and modifying the style as needed.
|
|
The "generator" value will changes on each releases, so better to disable
it to minimize noise during release commit.
|
|
[NEW FEATURE] Support include directive inside block code.
Example of block code with include directive,
----
...
include::file[]
...
----
[NEW FEATURE] Support document attribute "docdir"
The "docdir" attribute contains the full path of the directory that
contains the source document.
By default it is set to the directory where the Document resided.
[NEW FEATURE] Add default HTML stylesheet.
The generated HTML now contains the default stylesheet.
The stylesheet is copied from HTML file generated by Asciidoctor
v2.0.23.
|
|
Example of block code with include directive,
----
...
include::file[]
...
----
|
|
The "docdir" attribute contains the full path of the directory that
contains the source document.
By default it is set to the directory where the Document resided.
|
|
Every time we execute "make test-parser", the generated HTML files will
changes the "Last updated xxx" (where xxx is the time its executed).
This changes prevent this unnecessary diff in the future.
|
|
The generated HTML now contains the default stylesheet.
The stylesheet is copied from HTML file generated by Asciidoctor v2.0.23.
|
|
|
|
|
|
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.
|
|
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.
|
|
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/
|
|
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.
|
|
|
|
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.
|
|
|
|
Given the following markup,
[square]
* item 1
[circle]
** item 2
The list on item 2 now start with `<div class="ulist circle">`.
|
|
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
|
|
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.
|
|
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.
|
|
|
|
If the attribute value end with backslash '\', the value continue to the
next line.
|
|
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!".
|
|
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/
|
|
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.
|
|
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.
|
|
=== 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.
|
|
This update fix some issues related to new line on test.Data.
|
|
The order of meta names are "author", "description", "generator", and
then "keywords".
|
|
The generator metadata contains the library name and its current version.
|
|
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.
|
|
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.
|
|
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.
|