Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1 post
|
I want to customize the HTML output from Asciidoctor, so I have made a local copy of the templates from https://github.com/asciidoctor/asciidoctor-backends and pointed to them via --template-dir. I made sure to install slim version 2.1.0.
My environment is Windows 10. The command I use is: call asciidoctor.bat ^ --trace ^ --verbose ^ --warnings ^ --attribute stylesheet=%IncludesFolder%\MyStyle.css ^ --require asciidoctor-diagram ^ --template-dir %IncludesFolder%\asciidoctor-backends\slim\html5 ^ %SourceDoc% Execution fails with this output: C:/Subversion/Incubation/Includes/asciidoctor-backends/slim/html5/document.html.slim:51: warning: possibly useless use of a variable in void context C:/Subversion/Incubation/Includes/asciidoctor-backends/slim/html5/document.html.slim:21: warning: possibly useless use of a variable in void context Traceback (most recent call last): 22: from C:/Ruby26-x64/bin/asciidoctor:23:in `<main>' 21: from C:/Ruby26-x64/bin/asciidoctor:23:in `load' 20: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/bin/asciidoctor:15:in `<top (required)>' 19: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `invoke!' 18: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `each' 17: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!' 16: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `convert_file' 15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `open' 14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `block in convert_file' 13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:118:in `convert' 12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:951:in `convert' 11: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/converter/composite.rb:28:in `convert' 10: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/converter/template.rb:107:in `convert' 9: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:109:in `render' 8: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `evaluate' 7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `call' 6: from C:/Subversion/Incubation/Includes/asciidoctor-backends/slim/html5/document.html.slim:54:in `__tilt_18244800' 5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/converter/composite.rb:28:in `convert' 4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/asciidoctor-2.0.10/lib/asciidoctor/converter/template.rb:109:in `convert' 3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:109:in `render' 2: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `evaluate' 1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/tilt-2.0.10/lib/tilt/template.rb:170:in `call' C:/Subversion/Incubation/Includes/asciidoctor-backends/slim/html5/block_outline.html.slim:2:in `__tilt_18244800': uninitialized constant Asciidoctor::Document::DEFAULT_TOCLEVELS (NameError) Did you mean? Asciidoctor::DEFAULT_DOCTYPE Am I using the correct or most up-to-date templates? Any suggestions on how to resolve this? Thanks |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
2681 posts
|
The templates in asciidoctor-backends aren't kept up to date anymore (due to time constraints). However, you don't need all of them anyway. It's better to start with a single template and build from there. Here's a brief tutorial to get you started: https://github.com/asciidoctor/jekyll-asciidoc#customizing-the-generated-html The instructions are geared towards using Jekyll. The only difference is that instead of setting the templates dir in _config.yml, you pass it using the -T flag: asciidoctor -T path/to/templates -E slim doc.adoc For even more info, see https://github.com/asciidoctor/asciidoctor.org/issues/80 -Dan p.s. If someone wants to maintain asciidoctor-backends, I'd be happy to hand over the responsibility. On Sun, Oct 27, 2019 at 8:13 PM Brady [via Asciidoctor :: Discussion] <[hidden email]> wrote: I want to customize the HTML output from Asciidoctor, so I have made a local copy of the templates from https://github.com/asciidoctor/asciidoctor-backends and pointed to them via --template-dir. I made sure to install slim version 2.1.0. ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |