From 96b01cfd7be1ab209556a911fc5160a6e54e6ced Mon Sep 17 00:00:00 2001 From: Kenta Oda <4185305+odknt@users.noreply.github.com> Date: Wed, 15 May 2019 20:40:34 +0900 Subject: [PATCH] feat(parser/renderer): add user macro feature (#347) Fixes #334 --- README.adoc | 20 + pkg/parser/asciidoc-grammar.peg | 25 + pkg/parser/asciidoc_parser.go | 47310 ++++++++++++------------ pkg/parser/user_macro_test.go | 53 + pkg/renderer/context.go | 18 + pkg/renderer/html5/renderer.go | 2 + pkg/renderer/html5/user_macro.go | 33 + pkg/renderer/html5/user_macro_test.go | 135 + pkg/renderer/options.go | 11 +- pkg/types/grammar_types.go | 39 + 10 files changed, 24995 insertions(+), 22651 deletions(-) create mode 100644 pkg/parser/user_macro_test.go create mode 100644 pkg/renderer/html5/user_macro.go create mode 100644 pkg/renderer/html5/user_macro_test.go diff --git a/README.adoc b/README.adoc index b4c82820..c453e797 100644 --- a/README.adoc +++ b/README.adoc @@ -68,6 +68,26 @@ where the returned `map[string]interface{}` object contains the document's title For now, the sole option to pass as a last argument is `renderer.IncludeHeaderFooter` to include the `
` and `