I am interested in generating slides using asciidoc markup. Thus far I have been able to generate some slides using asciidoc tool by passing the flag -b slidy to the asciidoc executable as given here: https://www.methods.co.nz/asciidoc/slidy.html#(3)
However, when I try to embed Latex expressions like $\alpha + \beta$ it just gets rendered as is. I know there is a tool called asciidoctor-latex which can be used for generating "normal" HTML pages / PDF files containing the Latex symbols
but when I tried -b slidy flag with asciidoctor-latex I get the error
asciidoctor: FAILED: missing converter for backend 'slidy'. Processing aborted. (RuntimeError)
Use --trace for backtrace
How should I go about installing the necessary slidy backend?
As far as I am aware there is a backend for slidy included in the asciidoc program (python) distribution, but currently there is no such backend for asciidoctor (the ruby implementation of AsciiDoc).
You can generate LaTeX with asciidoc (python) LaTeX Backend, but that probably won't help with embedding formulas in slidy. I guess it is easier to write a preprocessor script that replaces your LaTeX-Code with an svg-image (external reference to a file generated by eg. dvisvgm).
Related
I like to add additional macros to asciidoctor for these types:
path:[some path value]
label:[some label text]
replace:[some value to become replaced by the user]
screen:[something the users sees on screen]
I mainly want to have it rendering some CSS classes while rendering to HTML5. I found several sources on how to write a macro for asciidoctor, but I do not get the point. Where to place or insert the ruby code and classes I write? Here is an example page I found: https://docs.asciidoctor.org/asciidoctor/latest/extensions/inline-macro-processor/
But I found no simple step-by-step information about where to place that?
Can someone tell me:
In which file(s) shall I add my macro code?
How to enable this in general for asciidoctor (so I can simply call it without the need to put it into the comandline call. Or do I have to register the macro in the call all the time?
I installed asciidoctor on Ubuntu 20.04 using apt-get install asciidoctor. Seems it works so far. But I found no files for the predefined macros btn, kbd and menu.
I'm a little lost here... Any help is appreciated.
PS. I know the syntax [.label]#some label text# to place CSS classes, but I want to have it generic and also usable for PDF generation later.
After many different tries and research I finally found it to be easy. Just point asciidoctor to the file you want to include by using the -r comandline parameter:
asciidoctor -r ~/tools/asciidoctor_patch/include_asciidoc.rb
Sadly, the whole asciidoctor documentation names this parameter only "require" and does not even mention this to be used for extensions. I also found no source that mentions the use of -r for including the macros.
I am using rtags which is a C++ source code indexer based on clang. I have been able to play around with it and now I want to actually index the firefox source code. I am pretty new to this stuff and this tool uses cmake to generate a compile_commands.json file to pass over to the program that indexes code.
Is there a way I can generate a the compile_commands.json file for the firefox source code that provides the exact compilation line for each translation unit inside the firefox source?
You can generate compile_commands.json by
mozilla_cnetral/mach build-backend -b CompileDB
In my environment(Ubuntu 16.04), it was created at mozilla_cnetral/obj-x86_64-pc-linux-gnu/.
Reference:
https://developer.mozilla.org/en-US/docs/Developer_Guide/Editor_Configuration#rtags_(LLVMClang-based_Code_Indexing)
Not sure if I follow the part "Is there a way I can generate a the compile_commands.json file for the firefox source code that provides the exact compilation line for each translation unit inside the firefox source?". But I can offer simply that you can generate a compile_commands.json file from a make-based system using the bear utility (which I obtained from my package manager: brew). After a make clean, I do 'bear --append make' and it traces the make build process and produces the compile_commands.json. More can be learned here: https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/
As the article referenced implies, my motivation was to be able to use the wonderful rtag system inside Emacs. Hope this helps a bit.
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)?
Yes to both, though the ways to extend each are different. In the Python implementation there's a conf file you use to create additional regex matchers. In asciidoctor (ruby) there is a full extension system built into versions starting at 0.1.4 (though it was at preview level in 0.1.4). Visit http://asciidoctor.org/docs/user-manual/#extension-points for more information about extensions in asciidoctor. http://asciidoc.org/userguide.html#X7 for asciidoc.
I was using this directive but the html generated simply omitted my code. For example, if I use:
.. code:: python
def my_function():
"just a test"
print 8/2
The html generated just doesn't contain this block of code whatsoever.
I have Pygments installed on my machine. Also, I'm using Pandoc to generate the html file.
Any idea what I'm doing wrong?
The development version of pandoc understands the language specification on .. code:: and will generate highlighted code from your input. This feature will be in the next release.
Is it possible to generate RDoc in LaTeX format? I looked at RDoc and YARD, but didn't find what I need.
I am writing a documentation in LaTeX for my project in Ruby, and I need a way to easily embed the API reference, as an appendix or as a chapter, in the final PDF. The most convenient, for me, would be to generate LaTeX source from Ruby source files and include it where appropriate.
I have no experience with it, but a short google-search shows:
https://github.com/Quintus/rdoc_pdf-latex (link broken, see below)
http://www.ruby-doc.org/core-1.9/classes/RDoc/Markup/ToLaTeX.html (link broken)
Another possibility:
DO you know the listings-package in LaTeX? There is also a ruby support.
You would get no rdoc-commands, but maybe you could make LaTeX-commands in your code?
Papyrus is a plugin for RDoc that enables RDoc to generate PDF files. It's based on LaTeX. So there should be a intermediate TeX-file.
From the readme.rdoc of the github repository for papyrus:
This library is a plugin for Ruby’s documentation generator RDoc. It provides both a generator for outputting PDF (Portable document format) (the RDoc::Generator::Papyrus class) files and a formatter for turning the parsed RDoc markup into LaTeX code (RDoc::Markup::ToLaTeX; RDoc::Markup::ToLaTeX_Crossref adds cross-reference facilities).