PageRenderTime 37ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

Unknown | 321 lines | 219 code | 102 blank | 0 comment | 0 complexity | 642b20be303bbed2dc06ad0c114d4f2e MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, WTFPL
  1. Writing Books with Txt2tags
  2. by Aurelio Jargas
  3. %!target : xhtml
  4. %!style : writing-book.css
  5. %!options: -n --toc --css-sugar --css-inside -o writing-book.html
  6. %!preproc: URL_RE_BOOK
  7. %!preproc: URL_HTMLDOC
  8. %!preproc: SORRY txt2tags cannot help you
  9. %!postproc: URL_PC_BOOK
  10. This document is a quick guide showing the benefits of using
  11. the txt2tags tool on the book writing process. Also applicable
  12. for other large documents as Guides and Thesis.
  13. = Preface =
  14. I'm the txt2tags``[1]`` author and I wrote two published papers using
  15. it: a [Regular Expressions book URL_RE_BOOK] (96 pages) and a Shell
  16. Programming Course (108 pages). The writing process was smooth and
  17. painless, so I want to share this experience.
  18. A book is a real big work to get done, but it doesn't have to be a
  19. complicated process. To write is to organize ideas into text
  20. structures like sections, paragraphs and lists. Txt2tags is a tool
  21. that makes this task simple and easy.
  22. Writing alone or in a team, with or without version control, technical
  23. contents or not, text-only or graphics-enabled. In any case txt2tags
  24. can be used as the main tool for the book creation.
  25. There is [a book URL_PC_BOOK] being written right now, using txt2tags.
  26. ``[1]`` Txt2tags reads a text file with minimal markup as
  27. ""**bold**"" and ""//italic//"" and converts it to documents
  28. like HTML, LaTeX and Adobe PageMaker. More info:
  30. = Visual Editors VS Markup =
  31. The two common ways of writing a book are to use a Visual Editor
  32. (//Microsoft Word//, //Adobe Pagemaker//) or a Markup Language
  33. (//LaTeX//, //docbook//).
  34. In Visual Editors you write and format the contents at the same time.
  35. This approach is nice for small texts, but for a 300 pages book, the
  36. formatting consume time and distract the writer.
  37. In Markup Languages you write contents and mark it up, so an external
  38. program will convert it to the final form. The writer don't mind about
  39. formatting, but the process of including ``<tags></tags>`` and
  40. ``\more{tags}`` is error prone and very intrusive, making the contents
  41. hard to read on the sources.
  42. Txt2tags also uses the markup schema, but the big difference is that
  43. its marks are very minimal, some indeed are almost natural, as using
  44. the hyphen for list items. So the writer can focus on contents only
  45. and the source remains readable.
  46. = The Txt2tags Approach =
  47. Using txt2tags, the book writing process follow these steps:
  48. + The author(s) learn the very simple txt2tags markup rules.
  49. + The author writes the book contents, forgetting about noises
  50. like page margin, font face, colors and sizes.
  51. + The author (or the publisher) open the contents on a graphical text
  52. processor that reads HTML (or LaTeX or ...) and conclude the book
  53. formatting.
  54. Step 1 is fast, just a few minutes. Step 2 will take months, and step
  55. 3 can take days or weeks.
  56. Writing contents is when you will spend more time on the book, so it
  57. is really important to make this process a simple, productive and
  58. pleasant task.
  59. The following are arguments showing that txt2tags can be used to
  60. achieve that.
  61. = Fast and Furious =
  62. Time is the key. Using txt2tags you will experience a very high
  63. productivity period because you write contents, not formatting.
  64. - **Initial Release Fast**
  65. It is very difficult to start something, but txt2tags has a nice
  66. approach to this problem. Just sit and write plain text. When you're
  67. done, in a few minutes you can add all the txt2tags marks on the
  68. text and the document is ready to be converted and published.
  69. - **Fast Snapshot Preview**
  70. No matter which will be the final book format, HTML is the preferred
  71. format to use on the writing time. A snapshot of the current book
  72. state can be done at any time, converting the sources to an HTML
  73. page, so any system with a browser can read it. If you need a
  74. printable version, convert the HTML to PDF with the excellent
  75. [htmldoc URL_HTMLDOC] tool.
  76. - **Book Contents Overview**
  77. To quickly have a global overview of the book contents at any time,
  78. just use the txt2tags //TOC Only// feature. The program shows the
  79. current Table of Contents for the book, with the listing of chapters
  80. and sections, numbered or not, at any depth.
  81. - **Fast Writing**
  82. Txt2tags marks are simple and minimalist, very easy to learn. No
  83. names, no options, no parameters. You don't have to stop writing
  84. contents to insert marks, they flow together with the text. If you
  85. don't remember a specific mark at the moment, forget about it and
  86. keep writing. At the end you do a global review on the text and
  87. quickly insert the missing marks.
  88. - **Fast Conversion**
  89. Even if you have a 500 pages book, the conversion process will take
  90. just a moment. It is because txt2tags acts as a filter, converting
  91. from one format to another. It does not index, compile, calculate,
  92. compress, draw or do any strong processing on the sources. No more
  93. library, catalog, schema and DTD nightmares.
  94. = Organize the Sources in Folders =
  95. Txt2tags has a built in command to include external files in any part
  96. of a document, at conversion time. It makes possible to split the
  97. sources into several files.
  98. - **Each chapter in a folder**
  99. You can make a folder for each chapter, storing the sources in a
  100. structured tree. Inside the chapter folder, you can even create
  101. subfolders to store images, configuration and included files.
  102. - **No file conflicts**
  103. Separating chapters, different teams can work in different chapters
  104. with no interaction between them. Each team work on its own folder,
  105. avoiding file conflicts due concurrent changes.
  106. - **Flexible access control**
  107. Files and folders organized, you can implement access control rules,
  108. setting up properties and permissions for any file or chapter. Do
  109. use the standard system tools to configure the read/write
  110. permissions, like the "users and groups" schema.
  111. - **Global view of sources**
  112. Structuring the sources also helps to have a global view of the
  113. book, using any file browser to quickly know the amount of text and
  114. images of any chapter. (Hint: on UNIX, ``find`` and ``du`` commands)
  115. - **Work your chapter, forget the others**
  116. Separating sources into files, you can convert your chapter alone,
  117. not needing to wait for the full book processing. Besides faster
  118. to convert, the chapter alone can be sent to reviewers or be
  119. published alone, as a sample of the full book.
  120. - **You separate, txt2tags joins**
  121. When converting, txt2tags will automatically join all the chapters
  122. into the final book, no matter how deep or large is the folder
  123. tree.
  124. = Version Control Made Easy =
  125. Txt2tags helps the book version control with line based tools (as
  126. //CVS// and //Subversion//). The sources are plain text, not compiled
  127. data.
  128. - **Work with short lines**
  129. You can make short lines, breaking them at 72 columns. It will help
  130. on the revision control, because it is line based. If the final
  131. format needs that a paragraph is composed by a single long line (as
  132. PageMaker), txt2tags will join them to you automatically.
  133. - **Readable sources**
  134. With very minimal markup, the sources are readable. One can easily
  135. see what has changed from one version to another, the marks don't
  136. hide or pollute the text.
  137. - **Large contents, small sources**
  138. As plain text, you can have a huge amount of contents, with a low
  139. disk usage. People can do full checkouts and commits even in slow
  140. connections.
  141. - **Chapter versioning**
  142. As seen before, the sources can be organized into folders. This
  143. makes version control separated by chapter, or even sections of
  144. chapters, depending on how granulated you need the versioning.
  145. = Quality Matters =
  146. You can write a book. Or you can write THE book. Txt2tags has nice
  147. built in features to increase your work quality.
  148. - **Spell Check**
  149. As all txt2tags marks are symbols and not words, you can use any
  150. spell checker on the sources. It will take care of the text only,
  151. not trying to correct tags.
  152. - **Alias Database**
  153. Txt2tags has //Pre Processing Filters//, where you can define
  154. keyword/value pairs. Wherever the keyword is found on the sources, it
  155. is expanded to the given value at conversion time. For example, you
  156. do use the string ``URL_GOOGLE`` on your text and it will appear as
  157. ```` on the book. If the Google URL changes,
  158. you just change the filter definition and all occurrences of it will
  159. be updated. You can define as many keywords as needed, with no
  160. maximum limit.
  161. - **Dynamic Content**
  162. Txt2tags also has a command to include pre-formatted text into the
  163. document when converting it, for example, a software source code
  164. sample. This way you can keep this code sample separated from the
  165. book text and update it by hand or even automatically. A nice idea
  166. is to mark the software source code with special comments, and a
  167. little program extract these marked parts into separate files.
  168. - **Control Over the Result**
  169. Txt2tags has //Post Processing Filters//, where you can define rules
  170. that makes adjustments on the resulting document. So if the standard
  171. txt2tags conversion does not fully satisfy your needs, you can
  172. improve it with your own filters. You can use the power of the
  173. Regular Expressions to match patterns.
  174. = Other Advantages =
  175. And there is more!
  176. - **Separate Formatting from Contents**
  177. Using HTML as the development target format, you can also use CSS
  178. files to experiment different book looks. CSS defines formating for
  179. HTML pages, and there is graphical editors to create CSS files.
  180. A team of designers can work on doing CSS files for the book, while
  181. the writers keep writing.
  182. - **Include Complicated Structures**
  183. Txt2tags does have support for all the common structures used in
  184. texts: lists, definitions, quotation, verbatim area and tables. But
  185. if some parts of your book requires a more complicated structure,
  186. you can use the //Tagged Include// feature, where you insert text
  187. that is already tagged, like a real fancy HTML table. With txt2tags,
  188. exceptions are not a problem!
  189. - **Do Use Any Editor**
  190. As plain text source files, even the most modest text editor in the
  191. world can be used to write the book. It doesn't have to have any
  192. feature besides write and save text. If you use the editors with
  193. txt2tags support, you will have //Syntax Highlight//, which helps to
  194. identify the txt2tags marks. They are: Vim, Emacs, Kate, Nano, gedit
  195. and TextMate.
  196. - **Technical Support**
  197. Txt2tags has various channels to get technical support: two mailing
  198. lists (english and portuguese), an IRC channel and even an Orkut
  199. community. And for book projects, your can send direct e-mails to
  200. the program author, who will give priority on the answer.
  201. = No Tool Fits All Needs =
  202. There are some special cases where txt2tags is not a good tool for
  203. writing books.
  204. - **Very Complex Books**
  205. Books that uses lots of complicated tables, formulas or specific
  206. structures, needs a graphical editor or a more complex markup
  207. language, as LaTeX. If your book matches this description, SORRY.
  208. - **Footnotes**
  209. Txt2tags does not have footnotes support. If you will use just a
  210. few, you can add them later. But if you plan to make an intense
  211. footnotes use, SORRY.
  212. - **References for Pages, Tables and Images**
  213. One can use a graphical editor at the publishing time to include
  214. indexes for pages, tables and images, no problem at all. But if you
  215. plan to refer to them inside the text like
  216. "//See table 4.11 on page 35//", SORRY.
  217. ----------------------------------------------------------------------
  218. //Writing Books with Txt2tags - Oct/2004//
  219. ([see source %%infile])