aboutsummaryrefslogtreecommitdiff
path: root/document_test.go
AgeCommit message (Collapse)Author
2025-04-18all: disable generating HTML meta for "generator" in testsShulhan
The "generator" value will changes on each releases, so better to disable it to minimize noise during release commit.
2025-02-16all: move setting attribute to DocumentShulhan
Some of attribute may depends on property of the Document.
2025-02-13testdata: redact the "Last updated" time in test-parser HTML filesShulhan
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.
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-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-03-05all: replace module "share" with "pakakeh.go"Shulhan
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.
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-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-08-05all: cleaning up codesShulhan
Use raw string literal whenever possible.
2022-07-24all: rename the HTML output for test-parserShulhan
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".
2022-07-24all: rewrite test using lib/test.DataShulhan
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.
2022-07-17all: move Parse and parse functions to documentShulhan
Since the Parse return a *Document it should grouped into document.go to make the code consistent.
2022-07-16all: reformat all Go filesShulhan
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.
2022-02-21all: relicense the asciidoctor-go under GPL 3.0 or laterShulhan
Signed-off-by: Shulhan <ms@kilabit.info>
2020-10-15asciidoctor-go: asciidoctor markup parser for GoShulhan
This is the first commit that can parser whole document line by line and provide convertion to HTML. Things that does not working: inline style, table, passthrough, dynamic attributes, include.