asciidoctor
<img class="emoji" title=":gem:" alt=":gem:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f48e.png" height="20" width="20" align="absmiddle"> A fast, open source text processor and publishing toolchain, written in Ruby, for converting AsciiDoc content to HTML5, DocBook 5 (or 4.5) and other formats.
Asciidoctor | An open source implementation of AsciiDoc in Ruby
I would like to create a external link with an ID using asciidoctorj. I couldn't find anywhere in the manual a way on how to do it.
Asciidoctor Source:
http://stackoverflow.com[Cool Site, id="myId"] ...
Current result:
<a rel='nofollow' href="http://stackoverflow.com">Cool Site</a> ...
Expected result:
<a id="myId" rel='nofollow' href="http://stackoverflow.com">Cool Site</a> ...
Source: (StackOverflow)
I am trying to add a cover image to an ASCIIDoc file (to be able to convert it to EPUB3) using this syntax
: front-cover-image: image: cover.png[width=1050, height=1600]
In the master file as mentioned in their page over here but it doesn't seem to override the default asciidoc cover page. The image cover.png lies in an images folder that exists inside the same folder as the AsciiDoc master file. Could anyone please let me know how else to resolve this, and add my own cover image?
Source: (StackOverflow)
i tried to use asciidoctor gem in my rails app. I added it to my Gemfile
and made bundle install
.
Now i try to use asciidoctor within a Controller:
def show
@article.text = Asciidoctor.render(@article.text)
end
But i get an error:
uninitialized constant ArticlesController::Asciidoctor
Whats the right way to user asciidoctor-gem with rails?
Source: (StackOverflow)
Does anyone know a way, how to add text to the cover page. More precisely, I need a table on the front page of my generated pdf. I am using asciidoctor with asciidoctor-pdf to generate a pdf out of my asciidoc file. I hope someone can help me out here.
I already know, how to add an cover background image, but that does not help me.
Source: (StackOverflow)
I'm trying to convert .adoc files to .docx
Actually I'm using:
asciidoctor file.adoc -o file.html
pandoc -s -S file.html -o output.docx
My math equations or symbols inside .adoc are equal to:
latexmath:[$\phi$] and more text as Inline test latexmath:[$\sin(x)$]
It returns after conversion to docx the strange lines inside .docx:
\($\phi$\) and more text as Inline test \($\sin(x)$\)
Any hint?
$ pandoc --version
pandoc 1.13.2.1
Compiled with texmath 0.8.2, highlighting-kate 0.5.15.
Source: (StackOverflow)
Using the asciidoctor-maven-plugin on Windows we are getting an encoding incompatability error when ejecuting the goal process-asciidocs.
We have tried with the 0.1.4 release of the plugin and the latest SNAPSHOT from master.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0-SNAPSHOT:process-asciidoc (default-cli) on project lgtdev-doc: Execution default-cli of goal org.asciido
ctor:asciidoctor-maven-plugin:1.5.0-SNAPSHOT:process-asciidoc failed: (Encoding::CompatibilityError) incompatible character encodings: CP850 and UTF-8
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.asciidoctor:asciidoctor-maven-plugin:1.5.0-SNAPSHOT:process-asciidoc failed: (Encoding::CompatibilityError) incompatible character enco
dings: CP850 and UTF-8
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.jruby.exceptions.RaiseException: (Encoding::CompatibilityError) incompatible character encodings: CP850 and UTF-8
at org.jruby.RubyString.concat(org/jruby/RubyString.java:2636)
at RUBY.result((erb):58)
at org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1093)
at RUBY.result(jar:file:/C:/Users/AUX7010/.m2/repository/org/jruby/jruby-complete/1.7.4/jruby-complete-1.7.4.jar!/META-INF/jruby.home/lib/ruby/1.9/erb.rb:838)
at RUBY.render(jar:file:C:/Users/AUX7010/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor/backends/base_template.rb:55)
at RUBY.render(jar:file:C:/Users/AUX7010/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor/renderer.rb:137)
at RUBY.render(jar:file:C:/Users/AUX7010/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor/document.rb:769)
at RUBY.render(jar:file:C:/Users/AUX7010/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor.rb:915)
at RUBY.render_file(jar:file:C:/Users/AUX7010/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor.rb:993)
at RUBY.render_file(<script>:51)
at org.jruby.gen.InterfaceImpl1306937631.render_file(org/jruby/gen/InterfaceImpl1306937631.gen:13)
When using cruby with the asciidoctor gem we don't get this error so it imagine that the problem is with the jruby execution environment.
On Mac we solved the same error by setting JAVA_TOOL_OPTIONS="-DFile=encoding.UTF-8" but on Windows this has no effect.
How can we coerce jruby into using UTF-8?
Source: (StackOverflow)
If I have something like the following:
The Manual
====================
Gregg Bolinger
v1.0, 2014-15
:doctype: book
:icons: font
:imagesdir: images
Preamble paragraph
include::chapter1.ad[]
include::chapter2.ad[]
I'd like so that each chapter renders in its own HTML file and is linked to from the TOC rather than everything being in a single book.html, for example. It seems to generate separate files already, but that's only because they are in the source directory. It is still combining everything into a single HTML page. I'm using the Gradle Asciidoctor plugin, if that helps to know.
Source: (StackOverflow)
In my current Asciidoctor document I have an atribute that I want to use in a codeblock. Is there a way to do String interpolation in a codeblock?
Attribute in header..
:api_version: 1.0
Codeblock
{
"api_version" : "{api_version}",
}
I seem unable to do String replacement, any hints or tips to do String replacement in code block?
Source: (StackOverflow)
My Maven build generates a static HTML based on Asciidoc sources.
I would like to serve this file as a welcome page of my Jersey 2 application.
Please note I do not have any servlet configuration, as spring-boot-starter-jersey
handles this by itself.
I have struggled for some time now and I'm not sure there is an elegant to do this.
Source: (StackOverflow)
Running AsciiDoctor from the CLI creates a HTML document with an embedded stylesheet:
$ asciidoctor mysample.adoc
....
<title>My First Experience with the Dangers of Documentation</title>
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; }
...
However, running Asciidoctor in a Ruby file does not:
r.rb:
#!/usr/bin/env ruby
require 'asciidoctor'
Asciidoctor.render_file('mysample.adoc', :in_place => true)
$ ./r.rb
...
<title>My First Experience with the Dangers of Documentation</title>
<link rel="stylesheet" rel='nofollow' href="./asciidoctor.css">
...
The documentation doesn't indicate that there should be any difference. What am I missing?
Details:
- Asciidoctor 0.1.4
- ruby 2.0.0p247
Source: (StackOverflow)
I see that asciidoctor.org itself has a navigation (top) bar. I'm guessing that the website was written using asciidoctor source files. Either way, how do I add a navigation bar using asciidoctor?
Update
This is possibly the wrong question to ask. Perhaps the right way to go is to use awestruct, Middleman, or Jekyll. Advice/suggestions are welcome.
Source: (StackOverflow)
reStructuredText allow you extend/rewrite writer for its markup. So you can add new type of embedded objects or introduce new sub-language by defined API.
Is this possible with Asciidoc (original Python implementation or Ruby asciidoctor)?
Source: (StackOverflow)
I have a asciidoctor page like:
:toclevels: 3
= 1
== 1.1
=== 1.1.1
== 1.2
= 2
== 2.1
=== 2.1.1
The general config is to display 3 level deep in the table of contents.
But e.g. for chapter 2 I only want to include the top level in the table of contents.
Is it possible to change the toc level per chapter?
Source: (StackOverflow)
Hey exist in asciidoc a way to create preprocessor macros?
The macros in asciidoc allow me generate custom commands for the different output formats. My goal is the creation of valid asciidoc.
for example:
preprocessormacro: #define pair() %1 and %2
use: i think pair("a", "b") are the same
result: i think a and b are the same
I hope you get the idea.
Attributes, specialwords and replacements don't fulfill this requirement. Or am i wrong?
Thanks for any kind of help.
Source: (StackOverflow)
If I process the following asciidoc
file with asciidoctor
,
Here is our first program:
[source,cpp]
----
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
// Interesting line
// Interesting line
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
// Uninteresting/Potboiler line
----
the result looks as follows:

But often (as hinted in the code above) the crux of what's interesting is brief.
In such cases I can keep the entire HTML succinct by quoting just the interesting lines, and adding a link that points to the full source file. This takes the reader out of context, and forces them to go forward/back in the HTML navigation.
I am looking instead for a way to keep the full code accessible through scrolling in the html page, while showing only the interesting bits. Is this possible with asciidoctor?
Source: (StackOverflow)