| Domain | My Life | Resume | Documents | Calculators | Miscellaneous | Links | Projects | Site Methodology | Site Map |
|
Documentation
From my personal library, The Internet |
| Man Pages | RFC | HOWTO | SDK | Software |
Howtos-with-LinuxDoc-mini-HOWTODavid S. Lawyerv0.05, October 2005This is about how to write HOWTOs using the simple LinuxDoc markup. It's primarily for Linux Documentation Project authors (and future fledging authors who want to get started fast). If you want to use the more advanced DocBook markup (including XML) see the LDP Authoring Guide.
1. Introduction
2. Information on Writing a HOWTO
3. The Format of HOWTOs
4. Comparing LinuxDoc to DocBook
5. Learning LinuxDoc
6. Getting/Using the LinuxDoc Software
7. Writing the HOWTO
8. More Information1. Introduction1.1 If you want to start immediatelyTo only learn LinuxDoc, skip to Learning LinuxDoc. If you want to start writing immediately, then you may try a "fill in the blanks" template which will generate LinuxDoc formatted output. The LDP HOWTO Generator. You may use this to just start writing your Howto and then finish it later by using a text editor on your PC. 1.2 Copyright and LicenseCopyright (c) 2001-3 by David S. Lawyer. You may freely copy and distribute (sell or give away) this document. You may create a derivative work and distribute it provided that you license it in the spirit of this license and give proper credits. The author would like to receive your comments, suggestions, and plans for any derivative work based on this. 1.3 Should you write a HOWTO ?Do you know things about Linux for which no good free documentation is available and which would be useful to others? Even if you don't know the subject well, you can still write about it if you're eager, willing, and able to learn more about it. Can you write clearly using a word processor or editor? Do you want to help thousands of others and let them read what you write at no cost to them? Once you've written a document, are you willing to receive email suggestions from readers and selectively use this info for improving your HOWTO? Would you like to have your writings be available on hundreds of websites throughout the world? If you can answer yes to these, then you're encouraged to write something for the LDP. But be warned that it may take more time than you expected. 1.4 Why I wrote thisWhy did I write this when there is already an "LDP Authoring Guide"? Well, the LDP guide is a long and detailed work. If you want to get started quickly, you need something much simpler and shorter. Thanks to Matt Welsh for his example.sgml file which I used as a major source of info for the example sections. 2. Information on Writing a HOWTO2.1 CopyrightAll HOWTOs and other LDP documents are copyright by the authors so the LDP doesn't have any special rights to your writing. We only accept documents that have a license which permits anyone to copy and distribute the document. We encourage authors to also allow modification in their license. This way, if the author stops maintaining a document, someone else can do so. For more details see our Manifesto. 2.2 Choosing a topicIf you are not sure what to write about, take look at some of LDP's documents, including the ones in Unmaintained HOWTOs. Also you may find topics that you are interested in that are not adequately covered by existing documentation. If you find something already written and maintained that seems to need improvement, try to contact the author. 3. The Format of HOWTOs3.1 IntroductionOur HOWTOs are released to the public in various formats: Plain Text, HTML, PostScript, and PDF. Instead of having to write the same HOWTO in all of these formats, just one HOWTO is written in a source format which gets converted by computer into all of the others. To get an idea of what a source format looks like, take a look at the source file of a webpage (if you haven't already). You will see all sorts of words in <angle brackets>. These are called tags. These webpages (tags and all) are in html: Hypertext Markup Language. The LDP uses formats something like this for its documents. The markup languages LDP uses meet the requirements of either Standard Generalized Markup Language (SGML) or XML. The LDP now uses the following two flavors of sgml: LinuxDoc and DocBook as well as the DocBook flavor of XML. Interestingly, it turns out that html is still another flavor of sgml. This mini-HOWTO is all about using the simple LinuxDoc flavor of sgml. You may call it "LinuxDoc markup". It can be converted by computer to html, plain text, postscript, pdf, and DocBook. It's a lot easier than html or DocBook and you don't need a special editor for it as it's easy to type in the tags (or use macros for them). 4. Comparing LinuxDoc to DocBookOne way to do this is to go to the LDP site http://www.linuxdoc.org click on HOWTOs and then compare the sources of the same HOWTO in the two formats: LinuxDoc and DocBook. The DocBook tags are often longer than the equivalent LinuxDoc tags and there are sometimes more of them needed to do the same task. DocBook uses <para> and </para> tags to enclose each paragraph while LinuxDoc uses only a blank line to separate paragraphs (no tags needed). For some examples see Comparison of DocBook to LinuxDoc So there's much more to type with DocBook if you're typing in tags manually. But DocBook has all sorts of tags that don't exist in LinuxDoc so it's more advanced. Just using a subset of DocBook doesn't help as you can see from the above examples partly because DocBook nests tags (uses more tags to do the same thing). With a more and longer tags the DocBook source becomes harder to read unless you use an editor that hides them. But hiding them has it's drawbacks since it's nice to see what tags you've used. Still, the number of people who use DocBook greatly exceeds the number using LinuxDoc. But if you do decide to migrate to DocBook there's a program by Reuben Thomas (ld2db) which can help make the conversion. It's not 100% perfect and you may have to do some manual editing. The LDP also automatically converts a LinuxDoc HOWTO to DocBook after you submit it. 5. Learning LinuxDoc5.1 IntroductionLinuxDoc is a lot easier to learn than DocBook. But most of what you learn about LinuxDoc would also be useful for DocBook. So if you eventually decide to go for DocBook, most of the effort spent on learning LinuxDoc will not be wasted. One way to learn it is by examples. I've written 3 example files ranging from easy to intermediate. The contents of these files have been copied into this Howto. To turn them into individual files you may cut them out (start with the first tag) and write them to files. Then you could try turning one into text by using say sgml2txt -f to see what it looks like. Make sure the file names end in .sgml. If you want to look at some real examples you can just go to an LDP mirror site, find the HOWTOs and select LinuxDoc SGML. Or go to the main site directly: Howto Index (linuxdoc) Now for the first simple example. 5.2 Example 1 (file name: example1.sgml)
5.3 Example 2 (file name: example2.sgml)
5.4 Example 3
5.5 LinuxDoc Quick Reference SheetHeader Part
Body Layout
FontsThere are two ways to get these: <bf>boldface font</bf> <em>emphasis font</em> <sf>sans serif font</sf> <sl>slanted font</sl> <tt>typewriter font</tt> <it>italics font</it> <bf/boldface/ <em/emphasis/ <sf/sans serif/ <sl/slanted/ <tt/typewriter/ <it/italics/ Lists (nesting is OK)
Links
Newline, Verbatim, URLs
Character Codes (macros)You don't always need to use these.
Use of these are optional and I seldom use them.
Only use these if LinuxDoc complains about it or fails to generate them in the formated document. I've seldom had to use them.
6. Getting/Using the LinuxDoc SoftwareYou could write a LinuxDoc document without having any LinuxDoc software. However, it's likely that it would contain some errors in the tags (or their use) so that it would be returned to you for correction. Even if there were no errors, the results might not not look quite right. So it's best for you to have the software to convert your source code on your computer. The Debian distribution of Linux has a linuxdoc-tools package. There is also a rpm package for non-Debian distributions. It was formerly called sgml-tools. Don't use the sgmltools-2 package which is primarily for DocBook. To use it, you run converter programs on the *.sgml files. For example to get text output, type: "sgml2txt --pass="-P-bc" --blanks=1 my-HOWTO.sgml". To get html output, type: "sgml2html my-HOWTO.sgml". If it shows errors, it will show the line number and the column number where the error is in the source file. Typing "man -k sgml" should show you a number of other programs with a one-line description of each but not all of them are for linuxdoc-sgml. For sgml2txt, the option --pass="-P-bc" is needed to get pure text output since otherwise you get text output which puts emphasis on words that need emphasis: by overstriking for old impact printers (avoided by the "c" option in -bc), or by sending escape sequences (avoided by the "b" option in -bc) to terminals. In case you are interested, the --pass passes the -P-bc option to the groff program (used by sgml2txt) and the -P option of groff passes the -bc option to grotty (a post processor for groff forcing grotty to generate just plain text output. What a mess! The default should be plain text so that all of this passing of options wouldn't be needed. If you don't use this --pass ... option then if you use the Linux "cat" command to display the text, it looks great. But using pagers or editors on the text output file usually results in the escape characters being eaten so you see a bunch of unwanted characters in your texts that were supposed to be the "sequence" portion of the escape sequence. 7. Writing the HOWTO7.1 Before you start writingFirst email the HOWTO coordinator at mailto:linux-howto@metalab.unc.edu or mailto:feedback@linuxdoc.org. If you're taking over an unmaintained HOWTO, contact the former author. This may required by the copyright-license but you should do it out of courtesy even it it's not required. 7.2 GuidelinesThese are mostly by Tim Bynum (a former HOWTO coordinator).
7.3 Submitting the HOWTO, etc.After you have written the HOWTO, email the SGML source to submit@linuxdoc.org. Then all you need to do is to keep the HOWTO up-to date by submitting periodic updates to the same email as you used for the first edition. 8. More InformationThere's a HOWTO: Linuxdoc-Reference that covers it in much greater detail than this mini-HOWTO. |