Asci­idoc­tor: A Fun Way of Learn­ing Asci­idoc

Asci­idoc­tor is an open source im­ple­men­ta­tion of Asci­idoc in Ruby. It is a fast, open source text pro­ces­sor and pub­lish­ing tool. It is packed as a Ruby gem and is in­cluded in sev­eral Linux dis­tros.

OpenSource For You - - Contents -

Writ­ing is not an easy task but has evolved into an es­sen­tial one. In the tech in­dus­try, doc­u­men­ta­tion is very im­por­tant for any soft­ware, as it con­tains in­for­ma­tion such as system re­quire­ments, the in­tro­duc­tion of the soft­ware, its fea­tures, lim­i­ta­tions, pro­vi­sions for ex­ten­sion in its op­er­a­tions, etc.

Writ­ing emails is one thing, but writ­ing tech­ni­cal doc­u­men­ta­tion or any for­mal doc­u­ment is an­other mat­ter al­to­gether. Pre­sen­ta­tion plays a huge role while writ­ing any doc­u­ment. When you are writ­ing an email, you fo­cus only on the con­tent. Peo­ple sel­dom worry about the for­mat in their emails, but in a tech­ni­cal doc­u­ment, for­mat­ting your con­tent has some sig­nif­i­cance. The font type and size, colour, spac­ing, in­den­ta­tion, line spac­ing, spa­ces be­tween para­graphs, lists, etc, are all very im­por­tant in a doc­u­ment.

So when you are typ­ing your con­tent in a word pro­ces­sor, your flow of thoughts tends to get in­ter­rupted by the con­tin­u­ous for­mat­ting re­quired in it. Asci­idoc­tor is a

Ruby im­ple­men­ta­tion of Asci­idoc, which helps you to write tech doc­u­ments as eas­ily as writ­ing a plain text doc­u­ment. Asci­idoc­tor is based on the Ruby lan­guage. It comes with all the sim­plic­ity that any typ­i­cal Ruby code pos­sesses—it is easy to learn and you will be able to write con­tent in Asci­idoc­tor in no time.

In­stal­la­tion

Asci­idoc­tor is a Ruby gem; so its in­stal­la­tion is like any other Ruby gem you’ve in­stalled in your system. Is­sue the fol­low­ing com­mand in your Linux ter­mi­nal: $sudo gem in­stall asci­idoc­tor

Text for­mat­ting

Type the fol­low­ing con­tent in the text edi­tor and save the file as favs.asc:

= My Favourite Books

The Scar­let Pim­per­nel

The Count of Monte Cristo The Christ­mas Carol

The Tale of Two Cities

Now open your ter­mi­nal and is­sue the com­mand: $asci­idoc­tor favs.asc

Then re­turn to the cur­rent work­ing direc­tory, where you will find an HTML file with the same name as your Asci­idoc­tor file, which you need to open in your browser.

You will find all the book names in one sin­gle line, one af­ter the other, but the out­put would be a lit­tle bit more read­able if each name was in a sin­gle line. To do this, add the ‘+’ at the end of each book name as fol­lows:

The Scar­let Pim­per­nel +

The Count of Monte Cristo + The Christ­mas Carol +

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.