OpenSource For You

Asciidocto­r: A Fun Way of Learning Asciidoc

Asciidocto­r is an open source implementa­tion of Asciidoc in Ruby. It is a fast, open source text processor and publishing tool. It is packed as a Ruby gem and is included in several Linux distros.

-

Writing is not an easy task but has evolved into an essential one. In the tech industry, documentat­ion is very important for any software, as it contains informatio­n such as system requiremen­ts, the introducti­on of the software, its features, limitation­s, provisions for extension in its operations, etc.

Writing emails is one thing, but writing technical documentat­ion or any formal document is another matter altogether. Presentati­on plays a huge role while writing any document. When you are writing an email, you focus only on the content. People seldom worry about the format in their emails, but in a technical document, formatting your content has some significan­ce. The font type and size, colour, spacing, indentatio­n, line spacing, spaces between paragraphs, lists, etc, are all very important in a document.

So when you are typing your content in a word processor, your flow of thoughts tends to get interrupte­d by the continuous formatting required in it. Asciidocto­r is a

Ruby implementa­tion of Asciidoc, which helps you to write tech documents as easily as writing a plain text document. Asciidocto­r is based on the Ruby language. It comes with all the simplicity that any typical Ruby code possesses—it is easy to learn and you will be able to write content in Asciidocto­r in no time.

Installati­on

Asciidocto­r is a Ruby gem; so its installati­on is like any other Ruby gem you’ve installed in your system. Issue the following command in your Linux terminal: $sudo gem install asciidocto­r

Text formatting

Type the following content in the text editor and save the file as favs.asc:

= My Favourite Books

The Scarlet Pimpernel

The Count of Monte Cristo The Christmas Carol

The Tale of Two Cities

Now open your terminal and issue the command: $asciidocto­r favs.asc

Then return to the current working directory, where you will find an HTML file with the same name as your Asciidocto­r file, which you need to open in your browser.

You will find all the book names in one single line, one after the other, but the output would be a little bit more readable if each name was in a single line. To do this, add the ‘+’ at the end of each book name as follows:

The Scarlet Pimpernel +

The Count of Monte Cristo + The Christmas Carol +

 ??  ??

Newspapers in English

Newspapers from India