U bekijkt momenteel de Netherlands versie van de site.
Wilt u overschakelen naar uw lokale site?
14 MIN LEESTIJD

AsciiDoc

Creating better documents in AsciiDoc

Making well-formatted documents is a snap for Karsten Günther because he’s learnt how to use a metaformat – and now you can, too.

Credit: http://asciidoc.org

OUR EXPERT

Karsten Günther makes documents with AsciiDoc, LaTeX and other formats. If he needs a metaformat, he uses AsciiDoc.

The different AsciiDoc styles for paragraph formatting. Here the examples have been formatted in AsciidocFX as HTML5. Outputs to other formats, such as PDF, vary slightly.

A sciiDoc is a shell program that takes source text, formats it and produces legible, correct output. A plus of AsciiDoc is that there are several versions in Ruby, Java, JavaScript and Python (plus Rust and Go unofficially) that produces mostly identical output.

Markup or formatting languages are about separating content from presentation. So tables are special structures with rows and columns, not text aligned by indents and spaces.

AsciiDoc tries to emulate many functions of LaTeX, albeit at a low level. LaTeX documents, for example, allow data to be automatically read in and prepared, as well as define their own macros and more. AsciiDoc does not do this directly, so there is no simple way to define your own elements – the existing ones must suffice. On the other hand, AsciiDoc syntax is much simpler, easier-to-understand and use than LaTeX, and much faster to write. In some places, AsciiDoc takes over elements from LaTeX, such as when citing references. Then the corresponding LaTeX macros are provided as AsciiDoc macros.

A special feature of AsciiDoc is the internal data format. This is closely based on (X)HTML and thus easily supports many output formats with which LaTeX has problems. EPUB and other ebook formats, for example, are based on HTML, which makes AsciiDoc an ideal input. In fact, AsciiDoc is even able to translate the supported formats directly into LaTeX and DocBook formats. While the conversion is largely error-free, it still must still be manually post-processed.

GET THE LATEST BUILDS

AsciiDoc and often Asciidoctor are available as packages in the repositories of most distributions. Docker solutions are also increasingly being developed and propagated. There are often also various packages available with extensions for AsciiDoc and editors. For example, there are extensions for special diagram forms, but plugins are also available for Emacs and Vi (and various modern editors), which mostly perform a type of syntax highlighting in the source code.

AsciiDoc was originally made available at www. methods.co.nz/asciidoc/, however the page is currently only sporadically accessible. Asciidoctor can be downloaded and installed directly from the current homepage – https://asciidoctor.org – as a gem (a Ruby package).

This is also possible for special variants of Asciidoctor – for example, for direct PDF output: gem install asciidoctor-pdf . (The output generated by this is important.)

For some components, this does not work because there are no official versions yet – Asciidoctor LaTeX, for example. But preliminary versions can be installed: gem install asciidoctor-latex--pre will do it.

If AsciidocFX is not available in the repositories, the tar.gz package will be available on the website: https://github.com/ asciidocfx/AsciidocFX/ releases/download/v1.8.4/ AsciidocFX_Linux.tar.gz. After unpacking – usually to /opt/ – the program is started directly from a terminal.

Ontgrendel dit artikel en nog veel meer met
Je kunt genieten:
Geniet volledig van deze editie
Direct toegang tot 600+ titels
Duizenden oude edities
Geen contract of verplichting
ABONNEER NU
30 dagen proberen, dan gewoon €11,99 / maand. Op elk moment opzeggen. Alleen nieuwe abonnees.


Meer informatie
Pocketmags Plus
Pocketmags Plus

Dit artikel komt uit...


View Issues
Linux Format
July 2023
IN DE WINKEL BEKIJKEN

Andere artikelen in dit nummer


Linux Format
Linux Format
Future Publishing Limited, Quay House, The Ambury, Bath,
WELCOME
MEET THE TEAM
We’re trying to keep things light this issue, so what’s your top tip for making something run faster or use less memory?
Keep it light
It’s fascinating to read the constant online forum
REGULARS AT A GLANCE
Newsdesk
THIS ISSUE: Art apps get touch-ups HDR Hackfest hopes KeePassXC passes test Ghostly chicken haunts AMD CPUs
It’s a wrap on HDR Hackfest
Exciting plans are in motion after the 2023 HDR Hackfest in Prague. Simon Ser shares his hopes.
KeePassXC passes audit
Independent security consultant was impressed.
NOT END OF LIFE
Joe Brockmeier is head of community, Percona.
KERNEL KUDOS
Muhammad Usama Anjum is a software developer at Collabora.
AMD haunted by spectral chicken
Kernel code is hen-pecked.
X.Org cleanup
Certain X.Org packages are retired and now archive-only.
Linus commits
Torvalds explains his changes to the Linux kernel.
Distro watch
What’s behind the free software sofa?
IN EURO WE TRUST
Italo Vignoli is one of founders of LibreOffice and The Document Foundation.
BUG OUT
Jon Masters is a kernel hacker who’s been
Kernel Watch
Jon Masters keeps up with all the latest happenings in the Linux kernel, so you don’t have to.
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to answers@linuxformat.com your Intel branch prediction.
Mailserver
WRITE TO US Do you have a burning
HotPicks
THE BEST NEW OPEN SOURCE SOFTWARE ON THE PLANET
REVIEWS
Adata Legend 960 Max
Heatsinks make everything better, even Shane Downing.
Nvidia RTX 4070
Put that foreign holiday on hold, shouts Dave James, it’s time to invest in a shiny new graphics card instead!
Tiny Core Linux 14.0
Hold on tight as Nate Drake dares to embark on a white-knuckle ride on the stripped-down Tiny Core Linux!
Lubuntu 23.04
Nate Drake samples the lighter flavour of Ubuntu and has brought enough to share.
MidnightBSD 3.0.0
Nate Drake almost gets lost in the labyrinth that is MidnightBSD – a surprising open source alternative to Linux.
ROUNDUP
Kotlin Go Rust Python C++
The Verdict
Beginner coding languages
LIGHTSPEED UBUNTU
Fitness guru Jonni Bidwell is here to trim down your Ubuntu installations for summer. Not a single star jump required.
Pi USER
It’s artificial not human intelligence
The Pi Foundation outlines its approach to teaching AI to young learners.
Micropython 1.20
Supports the Pico!
More GPIO!
Same old SOC.
YOUR JAMMY EVENT HERE!
Les Pounder works with groups such as the
Ubuntu 23.04 Beta
Les Pounder loves the B-52s’ ‘Rock Lobster’ but will he find Ubuntu 23.04 Lunar Lobster also rocks or is just a bit rocky?
Creality CR-M4
“Look at the size of that thing!” cries Denise Bertacchi, but this 3D printer from Creality is certainly no moon.
Setting up virtual Python environments
Les Pounder enjoys dancing to Jamiroquai’s ‘Virtual Insanity’, but much prefers losing himself in Python’s virtual environments.
Eye spy with my little Pi API…
Tam Hanna uses the new Raspberry Pi Camera API and Microsoft Azure to create a machine that can classify things.
IN DEPTH
Join the Pod, Man!
Aaron Peters, unabashed container newbie, explores the Podman management application and why you might pick it over Docker.
Stay on top of your to-do list
If creating to-do lists were an Olympic event, Shashank Sharma would be a winner, seeing as how his just keep on growing.
Search desktop file contents instantly
Super-sleuth Nick Peers reveals how to find any file by searching its contents as well as filenames with the help of Recoll.
Climbing the ALPs
Piling survival essentials such as containers, Btrfs and KVM into his backpack, Matt Holder sets out to conquer OpenSUSE’s latest technological answer to immutable OSes.
TUTORIALS
LISP - exploring the original AI language
Discover one of the first programming languages, which Mike Bedford realises couldn’t have been more different from its early stablemates.
Master Linux VM creation in Azure
Swallowing his pride, Stuart Burns tests out what Microsoft has to offer for Linux servers in its Azure cloud.
Kicking your music ’80s Amiga-style
Musical Michael Reed shows you how to create an Amigastyle tracker tune using modern open source Linux software.
CODING ACADEMY
Generate and then solve mazes with C
David Bolton demonstrates how a Raspberry Pi can create mazes in C/SDL and then solve them with animations.
Spice up your Python console applications
Matt Holder demonstrates how to use the Python Rich library to add formatting to your console applications.
Chat
X
Pocketmags ondersteuning