aboutsummaryrefslogtreecommitdiff
path: root/html_backend.go
AgeCommit message (Collapse)Author
2026-03-30all: move the sect anchor element to the rightShulhan
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.
2026-01-24all: add aria-label to the anchor when sectanchor enabledShulhan
The aria-label help user with screen reader to discern and navigate the anchor. Ref: https://dequeuniversity.com/rules/axe/4.11/link-name
2024-10-15all: group all image related method and functions into single fileShulhan
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.
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-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-03-05all: comply with linter recommendationsShulhan
2024-03-05all: replace module "share" with "pakakeh.go"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-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-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.
2022-12-16all: detach parsing preamble from contentShulhan
This is to prevent empty preamble being rendered in HTML content.
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.
2022-11-27all: implement inline macro for passthrough ("pass:")Shulhan
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/
2022-10-20all: implement macro "footnote:"Shulhan
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.
2022-08-05all: cleaning up codesShulhan
Use raw string literal whenever possible.
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-12-26all: replace space surrounding the em-dash with html symbol thin spaceShulhan
If the em-dash strings "--" flanked by space, replace the space with HTML symbol thin space.
2020-12-25all: add predefined attributes for character replacementsShulhan
2020-12-24all: remove parameter isForToC on method element.toHTMLShulhan
This is to minimize call stack size since the method will be called recursively.
2020-12-24document: rename ToEmbeddedHTML to ToHTMLEmbeddedShulhan
This is for consistency on exported method names on Document object. While at it, simplify the documentation for exported methods.
2020-12-24all: rename type adocTable to elementTableShulhan
2020-12-24all: rename adocNode to elementShulhan
Using prefix adoc to module asciidoc is kinda bit stutter.
2020-12-20all: do not wrap document with content and preamble on ToEmbeddedHTMLShulhan
Previously, HTMl document generated from ToEmbeddedHTML contains div with id "content" and sub div "preamble". This changes, make the ToEmbeddedHTML generate the HTML document without those divs wrapper.
2020-12-10all: fix rendering block listingShulhan
2020-12-10all: add support for "[source]" element attributeShulhan
2020-12-08all: support custom markers on unordered listShulhan
Custom markers including "square", "circle", "disc", "none", "no-bullet", "unstyled", and any strings that is not part of asciidoc internal styles.
2020-12-05all: render the table caption with auto numberingShulhan
2020-12-05html_backend: parse cell contents by paragraphsShulhan
If the cell contents contains multiple paragraphs, parse and render each of them as separated block paragraph.
2020-12-04all: support setting table width and with autowidth optionShulhan
2020-12-03all: remove unused methods and unexport internal methodsShulhan
2020-12-03all: unified the document node attributesShulhan
2020-11-30all: implement table options "footer"Shulhan
2020-11-29all: implement cell formattingShulhan
One of the most hardest task to finished after inline markup. It take three refactoring until we get the current implementation. To make the cell formatting works, we breaking down all table contents into cells. When parsing a cells, we lookup the content before '|' and after '\n'. If its a valid cell format, it will be set as cell format for the next cell, otherwise it will considered as normal text.
2020-11-24all: support all column style "a", "e", "h", "l", "m", "d", "s", "v"Shulhan
2020-11-23all: implement parser for tableShulhan
Currently supported format with "cols" options are, * setting number of columns, * setting the horizontal and vertical alignment * setting the column width
2020-11-16all: support section "[discrete]" headings styleShulhan
2020-11-15all: implement additional metadatasShulhan
The following metadata has been implemented, * "idprefix": changing the auto generated ID prefix * "idseparator": changing the separator for auto generated ID * "sectids": enabling or disabling auto generated ID * "sectlinks": generate link on section title * "sectanchors: generate an anchor, empty link, before section title
2020-11-15html_backend: check for meta "version-label" when generating footerShulhan
2020-11-15all: support additional metadatasShulhan
Including "no-header-footer", "no-footer", "title", and "notitle"
2020-11-15all: unpack the revision number, date, and remark into RevisionShulhan
Also support setting and checking metadata revnumber, revdate, revremark, and version-label.
2020-11-15all: add support for multiple authors with emailShulhan
2020-11-15all: minimize number of short HTML templatesShulhan
Inlining all short HTML templates to HTML backend.
2020-11-15all: add support for disable rendering title using "showtitle!"Shulhan
2020-11-15all: add method ToEmbeddedHTMLShulhan
The ToEmbeddedHTML will generate the document content only, without header and footer.
2020-11-15all: support meta "noheader"Shulhan
If the meta "noheader" is set, the document header will not be rendered.
2020-11-15all: parse the document subtitleShulhan
This changes also support different title separator using meta attribute "title-separator".
2020-11-14all: fix linter warningsShulhan
Remove unused constants and functions, replace Write() with fmt.Fprint(), and other fixes.