PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/doc/English/tags-reference.t2t

http://txt2tags.googlecode.com/
Unknown | 2149 lines | 1409 code | 740 blank | 0 comment | 0 complexity | 33937581c5ab2b012173eb94e87c01ef MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, WTFPL

Large files files are truncated, but you can click here to view the full file

  1. All TAGS Reference
  2. =Introduction=[Introduction]
  3. This document is a reference for all available TAGS available to
  4. developers for adding new targets, as found in the //getTags()// function.
  5. It is intended for **advanced users** and **developers** who wish to
  6. add a new target to Txt2tags without needing to know the source code
  7. in detail.
  8. This reference will describe all available tags, including how and
  9. where they will appear in the final tagged document, how the various
  10. rules in the //getRules()// function affect them, and what special
  11. characters and macros are expanded in the output.
  12. Txt2tags has fairly complex rules and gotchas, and it can be
  13. difficult searching through the entire source code to see exactly
  14. what each tag does. Often, when creating a new target, a developer
  15. is surprised when the output is not quite how it was expected to be,
  16. and in particular that certain tags did not behave as expected. It
  17. is hoped that this reference will make it easier to create new
  18. targets with fewer bugs and surprises, so txt2tags can continue to
  19. grow as "one source, many targets".
  20. +The Parts of a Document+[chapter-ThePartsofaDocument]
  21. Before looking at the individual tags, it is important to understand
  22. exactly how the different parts of a document fit together.
  23. A document is built from a **template**, which is filled with the
  24. document's **headers**, **body**, and an optional **table of contents**.
  25. ++Template++[section-Template]
  26. The template of a document consists of the basic opening and closing
  27. markup that all examples of that type of file must have. All
  28. supported targets have a default template included in the source
  29. code, in the //HEADER_TEMPLATE// area. Alternatively, the user may
  30. use a custom header using the //--template// command line option.
  31. Templates should make use of the **%(HEADER1)s**, **%(HEADER2)s**,
  32. and **%(HEADER3)s** macros, as well as **%(ENCODING)s** and
  33. **%(STYLE)s** if the target supports character encodings and
  34. external stylesheets. These macros will be replaced with the
  35. appropriate values from the source document. If any value is blank,
  36. the entire line including the macro is removed unless the target has
  37. included the rule ['keepblankheaderline' #keepblankheaderline].
  38. It is not required, but by convention **HEADER1** refers to the title,
  39. **HEADER2** to the author, and **HEADER3** to the date the document was
  40. created. Several targets reflect this convention in their use of the
  41. **HEADER** metadata in their default templates.
  42. Custom templates must also include the **%(BODY)s** macro, which
  43. will be expanded to the fully tagged body of the document. The
  44. default template should not include this, as it is automatically
  45. added to the end of the //HEADER_TEMPLATE// text.
  46. ++Body Text++[section-BodyText]
  47. The body of a document consists of the fully tagged text converted
  48. from the original source document. It is nothing more or less than
  49. the original document with all txt2tags markup removed, and replaced
  50. with the target-specific markup. All of the tags from //getTags()//
  51. end up in this section, along with all user text.
  52. The document is parsed into blocks, and each block is processed line
  53. by line. Note that this seraration of lines is kept throughout the
  54. process, and in nearly all cases the final tagged text is broken in
  55. the same locations as the original. This is important to remember,
  56. as several tags depend on this line by line behaviour, and their
  57. output changes that line it self, not the block.
  58. ++Table of Contents++[section-TableofContents]
  59. Txt2tags is able to add a table of contents to the output document.
  60. If the target supports creating a table of contents itself, Txt2tags
  61. can take advantage of that. Otherwise, Txt2tags can generate a table
  62. of contents automatically and insert it where appropriate.
  63. If the command line option //--toc// is used, Txt2tags will add a
  64. table of contents to the output. If the command line option
  65. //--toc-only// is used, then the table of contents will be the only
  66. thing output, and the rest of the body text will not.
  67. By default, the table of contents will be emitted as the first text
  68. in the body of the document. That is, it will be emitted directly
  69. after [bodyOpen #bodyOpen] and before the main text. If this is not
  70. appropriate, the user can insert the **%%toc** macro into the source
  71. text, and it will be emitted there instead.
  72. Full details on how the table of contents is emitted is given in the
  73. section on the Table of Contents tags.
  74. ++Escapes++[section-Escapes]
  75. One final note, though this is not really part of the document
  76. structures. Most text is processed throught the functions
  77. //doEscape()// and //doFinalEscape()// before being emitted in the
  78. final output. This is used to allow certain characters that may give
  79. problems in Txt2tags, such as backslashes or characters that are the
  80. same as Txt2tags markup.
  81. The emitted tags are not processed by these functions at all. Some
  82. tags also prevent parts of the text from being processed by these
  83. functions. The reference will note when this is the case.
  84. +Basic Blocks+[chapter-BasicBlocks]
  85. ++Paragraphs++[section-Paragraphs]
  86. Paragraphs are the most common, and most basic of all text blocks.
  87. They are the simple, regular body text of the document.
  88. If the rule ['blanksaroundpara' #blanksaroundpara] is defined, an empty line will be
  89. emitted before and after the paragraph and tags.
  90. If the rule ['onelinepara' #onelinepara] is defined, the paragraph text will have
  91. all newlines removed and replaced with spaces, emitting the
  92. paragraph as a single line.
  93. ===paragraphOpen===[paragraphOpen]
  94. This tag is emitted, on its own line, before each paragraph of body
  95. text. If this tag (and [paragraphClose #paragraphClose]) are not defined for a
  96. target, the body text is simply printed as unadorned plain text,
  97. much like the source document.
  98. : Macros:
  99. : **~D~**
  100. If this macro is included in the tag, it will be expanded to the
  101. value of the depth of that particular paragraph. Most paragraphs
  102. have depth '1', pargraphs inside a top-level list will have
  103. depth level '2', and so on.
  104. If the rule ['blockdepthmultiply' #blockdepthmultiply] is defined for the target,
  105. the depth value will be multiplied by that amount before being
  106. emitted. If the rule ['depthmultiplyplus' #depthmultiplyplus] is defined, then that
  107. value will be added to the depth before multiplying by
  108. ['blockdepthmultiply' #blockdepthmultiply], but only if used with
  109. ['blockdepthmultiply' #blockdepthmultiply].
  110. If the rule ['zerodepthpara' #zerodepthpara] is defined, then top-level
  111. paragraphs (those not nested inside a list) will always have
  112. **~D~** replaced with '0', regardless of the other rules.
  113. ===paragraphClose===[paragraphClose]
  114. This tag is emitted, on its own line, after each paragraph of body
  115. text.
  116. : Macros
  117. None
  118. ++Block Quotations++[section-BlockQuotations]
  119. Block quotes are paragraphs that are set apart from regular
  120. paragraphs, usually to show that they are quoted from some external
  121. source.
  122. Note that, at this time, Txt2tags is not able to emit multiple
  123. paragraphs within a single block quote. Each separate paragraph
  124. will be emitted as a separate block quote with Open and Close tags.
  125. Nested block quotes are allowed, unless the rule ['quotenotnested' #quotenotnested]
  126. is defined for the target.
  127. If the rule ['keepquoteindent' #keepquoteindent] is defined, then each line of the
  128. block quote will have tab characters added before the text equal to
  129. the depth of that quote.
  130. If the rule ['blanksaroundquote' #blanksaroundquote] is defined, an extra blank line is
  131. emitted before and after the block quote.
  132. ===blockQuoteOpen===[blockQuoteOpen]
  133. This tag is emitted, on its own line, before each paragraph of a
  134. block quote.
  135. The block depth is given by a number of tab characters.
  136. ``blockQuoteOpen`` will have these tabs inserted before the tag,
  137. unless the rule ['tagnotindentable' #tagnotindentable] is defined.
  138. : Macros:
  139. : **~D~**
  140. If this macro is included in the tag, it will be expanded to the
  141. value of the depth of that particular block quote paragraph. The
  142. first Block Quote has a depth level of '1'. A quote nested
  143. within the first will have a depth of '2', and so on.
  144. If the rule ['blockdepthmultiply' #blockdepthmultiply] is defined for the target,
  145. the depth value will be multiplied by that amount before being
  146. emitted. If the rule ['depthmultiplyplus' #depthmultiplyplus] is defined, then that
  147. value will be added to the depth before multiplying by
  148. ['blockdepthmultiply' #blockdepthmultiply], but only if used with
  149. ['blockdepthmultiply' #blockdepthmultiply].
  150. ===blockQuoteLine===[blockQuoteLine]
  151. If this tag is present, it will be added before each line of the
  152. block quote.
  153. This tag is emitted multiple times for nested quotes, one copy of
  154. the tag for each level of depth. For example, if the quote is
  155. defined as '*', then for a third-level nested quote each line
  156. will begin with '***'.
  157. If the rule ['keepquoteindent' #keepquoteindent] is defined, all copies of this tag
  158. are emitted after the tab characters and before the quote text.
  159. : Macros:
  160. None
  161. ===blockQuoteClose===[blockQuoteClose]
  162. This tag is emitted, on its own line, at the end of each block
  163. quote.
  164. The block depth is given by a number of tab characters.
  165. ``blockQuoteClose`` will have these tabs inserted before the tag,
  166. unless the rule ['tagnotindentable' #tagnotindentable] is defined.
  167. : Macros:
  168. None
  169. ++Verbatim Blocks++[section-VerbatimBlocks]
  170. Verbatim blocks are used when the user needs to keep control over
  171. the spaces and line breaks of a block of text. Verbatim blocks are
  172. usually emitted in a monospace font, and all spaces and line breaks
  173. will be the same as in the source text. It is commonly used for
  174. ASCII art and for source code listings.
  175. Note that this is not the same as raw text. Raw text blocks are
  176. emitted exactly as they are in the source text, with no processing.
  177. Verbatim blocks are processed, and are emitted so that they
  178. //appear// the same as in the source text.
  179. By default, verbatim blocks are passed through //doEscape()// but
  180. not //doFinalEscape()//. If the rule ['verbblocknotescaped' #verbblocknotescaped] is
  181. defined, the text will not be passed through //doEscape()//. If the
  182. rule ['verbblockfinalescape' #verbblockfinalescape] is defined, then the text will be be
  183. passed through //doFinalEscape()//.
  184. If the rule ['indentverbblock' #indentverbblock] is defined, then each line of the
  185. text will be emitted with two spaces inserted before the text.
  186. If the rule ['blanksaroundverb' #blanksaroundverb] is defined, an extra blank line
  187. will be emitted before and after the verbatim block.
  188. Note that the entire verbatim area is emitted as a single block.
  189. Blank lines within a verbatim block do not separate paragraphs.
  190. ===blockVerbOpen===[blockVerbOpen]
  191. This tag is emitted, on its own line, before each block of verbatim
  192. text.
  193. : Macros:
  194. None
  195. ===blockVerbLine===[blockVerbLine]
  196. This tag is emitted before each line of text in the verbatim block.
  197. Some targets require this to keep the entire verbatim block
  198. together, or to maintain formatting.
  199. If the rule ['indentverbblock' #indentverbblock] is defined, this tag is emitted
  200. after the spaces used for the indent, before the block text.
  201. : Macros:
  202. None
  203. ===blockVerbSep===[blockVerbSep]
  204. This tag is emitted, on a line by itself, in between each line of
  205. text in the verbatim block.
  206. : Macros:
  207. None
  208. ===blockVerbClose===[blockVerbClose]
  209. This tag is emitted, on its own line, after each block of verbatim
  210. text.
  211. : Macros:
  212. None
  213. +Inline Tags+[chapter-InlineTags]
  214. These tags are used to add additional formatting to text within the
  215. basic blocks. They are useable within regular paragraphs and block
  216. quotes, and unless otherwise noted, within lists and tables as
  217. well.
  218. All of these tags are inline, meaning that they do not begin or end
  219. blocks and do not add or remove lines of text.
  220. ++Text Beautifiers++[section-TextBeautifiers]
  221. These are the simple tags used to change how text appears in the
  222. final output.
  223. None of these tags use any special macros.
  224. ===fontItalicOpen, fontItalicClose===[fontItalic]
  225. These tags are emitted, respectively, immediately before and after
  226. some text that should appear in //italics// for emphasis.
  227. ===fontBoldOpen, fontBoldClose===[fontBold]
  228. These tags are emitted, respectively, immediately before and after
  229. some text that should appear in **bold** for strong emphasis.
  230. ===fontUnderlineOpen, fontUnderlineClose===[fontUnderline]
  231. These tags are emitted, respectively, immediately before and after
  232. some text that should appear __underlined__.
  233. ===fontStrikeOpen, fontStrikeClose===[fontStrike]
  234. These tags are emitted, respectively, immediately before and after
  235. some text that should appear --struck out--.
  236. ===fontMonoOpen, fontMonoClose===[fontMono]
  237. These tags are emitted, respectively, immediately before and after
  238. some text that should appear in a ``monospaced`` font, such as
  239. inline source code.
  240. ++Links++[section-Links]
  241. These tags are used to insert links to external files, pages, or
  242. resources, as well as internal links within the document itself.
  243. The link text itself is a **url**. Ordinarily, urls are not escaped
  244. so as to preserve all characters within it exactly as typed. It the
  245. rule ['escapeurl' #escapeurl] is defined for a target, the url will be passed
  246. through //doEscape()// after all. Additionally, if the rule
  247. ['linkable' #linkable] is not defined, signalling that this target does not
  248. support true links, then the url will be escaped as well.
  249. ===url===[url]
  250. This tag is used to insert a bare url without a label.
  251. : Macros:
  252. : **\a**
  253. This mark within the tag will be expanded into the text of the
  254. url itself. For example, if the ``url`` tag is '[url=\a]'
  255. and the url in the source document in 'example.com', then
  256. the text '[url=example.com]' will be emitted.
  257. ===urlMark===[urlMark]
  258. This tag is used for a link with a label. The label will appear in
  259. the final document, possibly formatted differently to set it apart,
  260. but it will function as a link to the url.
  261. : Macros:
  262. : **\a**
  263. This mark should appear twice in the tag. The first instance is
  264. expanded to the text of the url, the second instance is expanded
  265. to the text of the label.
  266. If the rule ['labelbeforelink' #labelbeforelink] is defined for the target, then
  267. the first instance is the label, and the second instance is the
  268. url.
  269. If the rule ['imglinkable' #imglinkable] is defined for the target, then an
  270. [img #img] tag (see below) is allowed as the label.
  271. ===urlMarkAnchor===[urlMarkAnchor]
  272. This tag is used if the url begins with a '#', designating an
  273. internal link to an anchor within the document. Some targets require
  274. a different tag for internal links than for external links.
  275. This tag otherwise behaves identically as [urlMark #urlMark], with the same
  276. macro definitions.
  277. ===email===[email]
  278. This tag is used if the url is detected as being for an email
  279. address rather than to a webpage or file. Ordinarily Txt2tags will
  280. detect automatically that the url represents an email address.
  281. Just like [url #url], this tag is used for a plain email with no label
  282. defined.
  283. : Macros:
  284. : **\a**
  285. This mark is expanded to the full text of the email address.
  286. ===emailMark===[emailMark]
  287. Similar to [urlMark #urlMark], this tag is used for email addresses that
  288. are assigned a label in the source document.
  289. : Macros:
  290. : **\a**
  291. This mark appears twice in the tag, just like [urlMark #urlMark]. The
  292. first instance is expanded to the text of the email address, and
  293. the second instance to the text of the label. If the rule
  294. ['labelbeforelink' #labelbeforelink] is defined, then the first instance is the
  295. label and the second instance is the email address.
  296. ++Images++[section-Images]
  297. Many targets allow images to be included in documents, often with a
  298. syntax similar to that of links. These tags are used to insert
  299. images into your documents
  300. ===img===[img]
  301. This is the basic tag used to insert an image into the output
  302. document. The image is represented by a file path to the image file,
  303. and is linked into the document.
  304. The filename is not escaped, and is assumed to represent a real file
  305. on the same filesystem as the document. As this time, links to
  306. remote files are not supported.
  307. : Macros:
  308. : **\a**
  309. This mark is expanded to the text of the file path pointing to
  310. the inserted image.
  311. : **~A~**
  312. This mark represents the alignment of the image. If the rule
  313. ['imgalignable' #imgalignable] is defined for the target, then this mark will
  314. be replaced with the contents of [_imgAlignLeft, _imgAlignRight, or _imgAlignCenter #_imgAlign] as appropriate. (Note
  315. the underscore at the beginning of each tag.)
  316. ===_imgAlignLeft, _imgAlignRight, _imgAlignCenter===[_imgAlign]
  317. These tags are used to add alignment to the [img #img] tag. If the rule
  318. ['imgalignable' #imgalignable] is defined, then whichever of these tags is
  319. appropriate will replace the **~A~** mark within the [img #img] tag.
  320. Note the underscores at the beginning of the tag names. Do not
  321. confuse these with the [imgAlignLeft, imgAlignRight, and imgAlignCenter #imgAlign] tags, explained below.
  322. : Macros:
  323. None
  324. ===imgAlignLeft, imgAlignRight, imgAlignCenter===[imgAlign]
  325. These tags are used if the alignment changes the image tags too much
  326. to simply use [img #img] and [_imgAlign* #_imgAlign].
  327. If the rule ['imgalignable' #imgalignable] is defined and these tags are defined,
  328. then they will be used //instead of// the [img #img] tag. Each of these
  329. tags should have whatever markup is needed for image align in them,
  330. and they will not have **~A~** expanded.
  331. : Macros:
  332. : **\a**
  333. This mark is expanded to the file path of the image file, just
  334. as in the [img #img] tag.
  335. ===imgEmbed===[imgEmbed]
  336. This tag is used to embed image data directly into the document
  337. itself, rather than to link to the image file externally. If the
  338. command-line option //--embed-images// is used, then this tag will be
  339. used //instead of// the [img #img] tag.
  340. Currently this is only used by the **RTF** target, and will require
  341. additional functionality to be added to Txt2tags to add support to
  342. another target.
  343. : Macros:
  344. : **\a**
  345. This mark is expanded into the full file data of the embedded
  346. image file, as well as whatever additional markup may be
  347. required to make it work with the target.
  348. +Titles and Sections+[chapter-TitlesandSections]
  349. Txt2tags allows you to specify markup for separating documents into
  350. sections, and for adding titles or headings to each section. It
  351. accomplishes both these tasks with the ``title`` family of tags.
  352. There are two methods used, depending on the tags and rules
  353. specified. By default, the [title* #title1] tags are used simply to mark
  354. up each section heading or subsection heading. Sections are implied
  355. by these headings, but do not have explicit markup.
  356. If the rule ['titleblocks' #titleblocks] is defined for the target, then the
  357. [title*Open* #title1Open] and [blockTitle*Open* #blockTitle1Open] family of tags is used
  358. instead. These explicitly separate sections and subsections and
  359. allow additional markup for section commands as needed.
  360. Either way, the titles are used to generate the automatic table of
  361. contents, if desired. If the target supports its own table of
  362. contents, then markup to add the titles/sections to it should be
  363. included in the tags.
  364. The title text itself does not support any additional Txt2tags
  365. markup. That is, the user may not apply ''//italics//'' to the
  366. title, as the marks will simply appear in the title as is. The title
  367. text is escaped with the //doEscape()// function and, if the rule
  368. ['finalescapetitle' #finalescapetitle] is defined, it is escaped by
  369. //doFinalEscape()// as well.
  370. ++The Anchor++[section-TheAnchor]
  371. ===anchor===[anchor]
  372. This tag is used to add a linkable anchor the title heading, if the
  373. target supports internal links. This should include all needed
  374. markup to allow a [urlMark #urlMark] or [urlMarkAnchor #urlMarkAnchor] tag to link
  375. directly to it from another part of the document.
  376. If the command-line option //--toc// is specified, then all titles
  377. will have anchors added to them (if they do not have one already)
  378. and the table of contents will include direct links to each section
  379. of the document.
  380. : Macros:
  381. : **\a**
  382. This mark is expanded into the label text for the anchor, as
  383. specified by the user or generated automatically by Txt2tags if
  384. none has been specified and the //--toc// option is in effect.
  385. ++Titles++[section-Titles]
  386. The basic title tags are only used if the rule ['titleblocks' #titleblocks] is
  387. not defined for the target. These are for simple markup of headings,
  388. or simple section separators, for targets that do not require any
  389. complicated markup for sections and subsections.
  390. ===title1, title2, title3, title4, title5===[title1]
  391. These tags are for basic standard headings. ``title1`` is considered
  392. the top level heading, ``title2`` the next level below it, and so
  393. on.
  394. If the rule ['blanksaroundtitle' #blanksaroundtitle] is defined, and extra blank line
  395. will be emitted before and after this tag.
  396. : Macros:
  397. : **\a**
  398. This mark is expanded into the text of the title itself,
  399. unchanged excepts for necessary escapes from the source
  400. document.
  401. : **~A~**
  402. This mark is expanded into the value of the [anchor #anchor] tag,
  403. along with the text of the label for that anchor. It is removed
  404. if the title does not have a label specified, and if txt2tags is
  405. not creating a tabel of contents.
  406. ===numtitle1, numtitle2, numtitle3, numtitle4, numtitle5===[numtitle1]
  407. These tags are used for sections heading that should be numbered.
  408. They are otherwise treated the same as [title* #title1].
  409. If the rule ['autonumbertitle' #autonumbertitle] is defined, then these tags are
  410. simply emitted as is, and the target is assumed to add the needed
  411. numbers. If this rule is not defined for the target, then it is
  412. assumed that the target does not have automatic numbering. In that
  413. case, Txt2tags will automatically generate the correct
  414. section/heading numbers and add that at the beginning of the title
  415. text.
  416. If the rule ['blanksaroundnumtitle' #blanksaroundnumtitle] is defined, an extra blank line
  417. will be emitted before and after this tag.
  418. : Macros:
  419. : **\a**
  420. This mark is expanded into the text of the title itself,
  421. unchanged excepts for necessary escapes from the source
  422. document.
  423. : **~A~**
  424. This mark is expanded into the value of the [anchor #anchor] tag,
  425. along with the text of the label for that anchor. It is removed
  426. if the title does not have a label specified, and if txt2tags is
  427. not creating a tabel of contents.
  428. ++Sectioning Tags++[section-SectioningTags]
  429. If the rule ['titleblocks' #titleblocks] is defined for the target, then the
  430. above [title* #title1] tags are not used. Instead, the tags below are used
  431. to separate the sections as a whole while also marking up the
  432. section headings as needed.
  433. ===title1Open, title2Open, title3Open, title4Open, title5Open===[title1Open]
  434. These tags are used to mark the beginning of a section or
  435. subsection, as well as to mark up the heading for that section. They
  436. work very similarly to the [title* #title1] tags above.
  437. If the rule ['blanksaroundtitle' #blanksaroundtitle] is defined, an extra blank line
  438. will be emitted before and after this tag.
  439. : Macros:
  440. : **\a**
  441. This mark is expanded into the text of the title itself,
  442. unchanged excepts for necessary escapes from the source
  443. document.
  444. : **~A~**
  445. This mark is expanded into the value of the [anchor #anchor] tag,
  446. along with the text of the label for that anchor. It is removed
  447. if the title does not have a label specified, and if txt2tags is
  448. not creating a tabel of contents.
  449. ===title1Close, title2Close, title3Close, title4Close, title5Close===[title1Close]
  450. These tags are used to mark the end of a section that has been
  451. opened with [title*Open* #title1Open]. It is emitted just before the opening
  452. tag of the next section, as well as at the end of the document to
  453. close all still-open sections.
  454. Note that sections nest. If a second level section is specified just
  455. after a first level section, and then another first level section,
  456. the order of the tags will be: ``title1Open``, ``title2Open``,
  457. ``title2Close``, ``title1Close``, ``title1Open``, and so on.
  458. : Macros:
  459. None
  460. ===blocktitle1Open, blocktitle2Open, blocktitle3Open===[blocktitle1Open]
  461. These tags are used to open a group of sections that are at the
  462. same level. If multiple sections/titles are given in a row at the
  463. same level, then the same level ``blocktitle*Open`` tag will be emitted
  464. before the first [title*Open* #title1Open].
  465. : Macros:
  466. None
  467. ===blocktitle1Close, blocktitle2Close, blocktitle3Close===[blocktitle1Close]
  468. These tags are used to close a group of sections that are at the
  469. same level. If multiple sections/titles are given in a row at the
  470. same level, then the same level ``blocktitle*Close`` tag will be emitted
  471. after the last [title*Close* #title1Close].
  472. : Macros:
  473. None
  474. +Lists+[chapter-Lists]
  475. Lists are used to add structure to small groups of items. They can
  476. be numbered or unnumbered, and they can be nested.
  477. If the rule ['compactlist' #compactlist] is defined for a target, then lists will
  478. be considered compact or wide, depending on whether or not an
  479. item in the list includes multiple paragraphs. If even a simple list
  480. item has more then one paragraph (that is, a blank line in the item
  481. that is not immediately followed by another list item), then the
  482. entire list is considered a wide list. If each item in the list is
  483. contained within a single paragraph, then the list is considered
  484. compact.
  485. If the rule ['compactlist' #compactlist] is //not// defined, then there is no
  486. difference bewteen wide and compact lists, and all lists are treated
  487. as wide lists.
  488. If the rule ['parainsidelist' #parainsidelist] is defined for a target, then the
  489. blank lines in wide lists are emitted as an empty paragraph. That
  490. is, [paragraphOpen #paragraphOpen] followed immediately by [paragraphClose #paragraphClose].
  491. The rule ['spacedlistitem' #spacedlistitem] appears to be intended to show that a
  492. target supports wide or spaced lists. However, at this time the rule
  493. appears to be unused by Txt2tags, and does not affect output at all.
  494. The rule ['listmaxdepth' #listmaxdepth] is used to tell Txt2tags how many levels
  495. of lists may be nested within one another for each target.
  496. If the rule ['listnotnested' #listnotnested] is defined for a target, then it does
  497. not support nested lists. Nested lists in the source are emitted as
  498. if all items belonged to the same, top-level list.
  499. If the rule ['listitemnotnested' #listitemnotnested] is defined for a target, then
  500. list items are closed before emitting a nested list, rather than wrapping
  501. around the nested list.
  502. ++Unordered Lists++[section-UnorderedLists]
  503. These lists do not use numbers to separate each item. Typically each
  504. list item is set off with a bullet symbol, though this can vary for
  505. different targets.
  506. If the rule ['blanksaroundlist' #blanksaroundlist] is defined for a target, an extra
  507. blank line is emitted before and after the top level list. No
  508. additional lines are emitted for nested lists with this rule.
  509. If the rule ['blanksaroundnestedlist' #blanksaroundnestedlist] is defined for a target, an
  510. extra blank line is emitted before and after all lists, including
  511. nested lists.
  512. ===listOpen===[listOpen]
  513. This tag is emitted to mark the start of a new bulleted list.
  514. By default this tag is emitted on its own line. The rule
  515. ['notbreaklistopen' #notbreaklistopen] is intended to allow
  516. ``listOpen`` to be on the same line as its first item, however
  517. this rule is not yet supported and does not affect the output.
  518. By default, the indent of a nested list is added (in spaces) at the
  519. beginning of the line this tag is on. If the rule
  520. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  521. not defined, these spaces are removed.
  522. If the rule ['compactlist' #compactlist] is defined for a target, then this tag
  523. is only used for wide lists. Otherwise it is used for both.
  524. : Macros:
  525. None
  526. ===listCompactOpen===[listCompactOpen]
  527. This tag marks the beginning of a new compact bulleted list.
  528. This tag is only used if the rule ['compactlist' #compactlist] is defined.
  529. By default, the indent of a nested list is added (in spaces) at the
  530. beginning of the line this tag is on. If the rule
  531. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  532. not defined, these spaces are removed.
  533. : Macros:
  534. None
  535. ===listClose, listCompactClose===[listClose]
  536. These tags are emitted, on their own line, to close the list opened
  537. by the previous tags.
  538. By default, the indent of a nested list is added (in spaces) at the
  539. beginning of the line this tag is on. If the rule
  540. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  541. not defined, these spaces are removed.
  542. : Macros:
  543. None
  544. ===listItemOpen===[listItemOpen]
  545. This tag is emitted before each item within a bullet list.
  546. By default, the indent of a nested list is added (in spaces) at the
  547. beginning of the line this tag is on. If the rule
  548. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  549. not defined, these spaces are removed.
  550. If the tag [listItemLine #listItemLine] is defined, it will be emitted
  551. immediately before ``listItemOpen``. If the rule
  552. ['listlineafteropen' #listlineafteropen] is defined,
  553. [listItemLine #listItemLine] will be emitted after ``listItemOpen``.
  554. If the rule ['spacedlistitemopen' #spacedlistitemopen] is defined, then two spaces will
  555. be emitted after ``listItemOpen`` and [listItemLine #listItemLine], before the
  556. list item text.
  557. : Macros:
  558. : **~D~**
  559. If this macro is included in the tag, it will be expanded to the
  560. value of the depth of that particular list. Top level lists
  561. have depth '1', a nested list inside the top level would have
  562. depth level '2', and so on.
  563. If the rule ['blockdepthmultiply' #blockdepthmultiply] is defined for the target,
  564. the depth value will be multiplied by that amount before being
  565. emitted. If the rule ['depthmultiplyplus' #depthmultiplyplus] is defined, then that
  566. value will be added to the depth before multiplying by
  567. ['blockdepthmultiply' #blockdepthmultiply], but only if used with
  568. ['blockdepthmultiply' #blockdepthmultiply].
  569. : **~V~**
  570. This macro will be expanded to the nesting level of the list. It
  571. is not affected by ['blockdepthmultiply' #blockdepthmultiply], so the numbers will
  572. always count one by one.
  573. If the rule ['listlevelzerobased' #listlevelzerobased] is defined for a target, then
  574. the top level lists will be level '0', the next level '1',
  575. and so on. Otherwise, the top level is '1' and the next level
  576. '2' and so on.
  577. ===listItemLine===[listItemLine]
  578. This tag is emitted for each item in the list. It is emitted either
  579. right before or after [listItemOpen #listItemOpen] (see above).
  580. This is emitted a number of times equal to the depth level of the
  581. list. For example, if ``listItemLine`` is defined as '*', then
  582. each item in a list nested three levels deep would begin with
  583. '***'.
  584. Despite the name, this is only emitted at the beginning of each
  585. item, and not for every line of the item.
  586. : Macros:
  587. None
  588. ===listItemClose===[listItemClose]
  589. This tag is emitted after each item in the list.
  590. : Macros:
  591. None
  592. ++Numbered Lists++[section-NumberedLists]
  593. Numbered lists behave much like unordered lists, except (as their
  594. name implies) they have numbers instead of bullets.
  595. Each item in the list will have its own number, counting from '1'.
  596. By default, nested lists will use a dotted number format, as in
  597. '1.', '2.', and so on. This can vary between different
  598. targets, however.
  599. If the rule ['blanksaroundnumlist' #blanksaroundnumlist] is defined for a target, an extra
  600. blank line is emitted before and after the top level list. No
  601. additional lines are emitted for nested lists.
  602. If the rule ['blanksaroundnestedlist' #blanksaroundnestedlist] is defined for a target, an
  603. extra blank line is emitted before and after all lists, including
  604. nested lists.
  605. ===numlistOpen===[numlistOpen]
  606. This tag is emitted to mark the start of a new numbered list.
  607. By default this tag is emitted on its own line. The rule
  608. ['notbreaklistopen' #notbreaklistopen] is intended to allow
  609. ``numlistOpen`` to be on the same line as its first item, however
  610. this rule is not yet supported and does not affect the output.
  611. By default, the indent of a nested list is added (in spaces) at the
  612. beginning of the line this tag is on. If the rule
  613. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  614. not defined, these spaces are removed.
  615. If the rule ['compactlist' #compactlist] is defined for a target, then this tag
  616. is only used for wide lists. Otherwise it is used for both.
  617. : Macros:
  618. None
  619. ===numlistCompactOpen===[numlistCompactOpen]
  620. This tag marks the beginning of a new compact numbered list.
  621. This tag is only used if the rule ['compactlist' #compactlist] is defined.
  622. By default, the indent of a nested list is added (in spaces) at the
  623. beginning of the line this tag is on. If the rule
  624. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  625. not defined, these spaces are removed.
  626. : Macros:
  627. None
  628. ===numlistClose, numlistCompactClose===[numlistClose]
  629. These tags are emitted, on their own line, to close the list opened
  630. by the previous tags.
  631. By default, the indent of a nested list is added (in spaces) at the
  632. beginning of the line this tag is on. If the rule
  633. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  634. not defined, these spaces are removed.
  635. : Macros:
  636. None
  637. ===numlistItemOpen===[numlistItemOpen]
  638. This tag is emitted before each item within a numbered list.
  639. If the rule ['autonumberlist' #autonumberlist] is defined, then the target is
  640. assumed to put the numbers in itself. In this case Txt2Tags simply
  641. emits this tag just like [listItemOpen #listItemOpen]. If it is not defined,
  642. then the correct number is calculated and inserted by Txt2tags. It
  643. uses the default number format given at the beginning of this
  644. subsection above.
  645. By default, the indent of a nested list is added (in spaces) at the
  646. beginning of the line this tag is on. If the rule
  647. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  648. not defined, these spaces are removed.
  649. If the tag [numlistItemLine #numlistItemLine] is defined, it will be emitted
  650. immediately before ``numlistItemOpen``. If the rule
  651. ['listlineafteropen' #listlineafteropen] is defined, [numlistItemLine #numlistItemLine] will be emitted
  652. after ``numlistItemOpen``.
  653. If the rule ['spacednumlistitemopen' #spacednumlistitemopen] is defined, then two spaces will
  654. be emitted after ``numlistItemOpen`` and [numlistItemLine #numlistItemLine], before the
  655. list item text.
  656. : Macros:
  657. : **\a**
  658. If the rule ['autonumberlist' #autonumberlist] is //not// defined, then this
  659. mark is expanded into the correct number for this list item.
  660. : **~D~**
  661. If this macro is included in the tag, it will be expanded to the
  662. value of the depth of that particular list. Top level lists
  663. have depth '1', a nested list inside the top level would have
  664. depth level '2', and so on.
  665. If the rule ['blockdepthmultiply' #blockdepthmultiply] is defined for the target,
  666. the depth value will be multiplied by that amount before being
  667. emitted. If the rule ['depthmultiplyplus' #depthmultiplyplus] is defined, then that
  668. value will be added to the depth before multiplying by
  669. ['blockdepthmultiply' #blockdepthmultiply], but only if used with
  670. ['blockdepthmultiply' #blockdepthmultiply].
  671. : **~V~**
  672. This macro will be expanded to the nesting level of the list. It
  673. is not affected by ['blockdepthmultiply' #blockdepthmultiply], so the numbers will
  674. always count one by one.
  675. If the rule ['listlevelzerobased' #listlevelzerobased] is defined for a target, then
  676. the top level lists will be level '0', the next level '1',
  677. and so on. Otherwise, the top level is '1' and the next level
  678. '2' and so on.
  679. ===numlistItemLine===[numlistItemLine]
  680. This tag is emitted for each item in the list. It is emitted either
  681. right before or after [numlistItemOpen #numlistItemOpen] (see above).
  682. This is emitted a number of times equal to the depth level of the
  683. list. For example, if ``numlistItemLine`` is defined as '+', then
  684. each item in a list nested three levels deep would begin with
  685. '+++'.
  686. Despite the name, this is only emitted at the beginning of each
  687. item, and not for every line of the item.
  688. : Macros:
  689. None
  690. ===numlistItemClose===[numlistItemClose]
  691. This tag is emitted after each item in the list.
  692. : Macros:
  693. None
  694. ++Definition Lists++[section-DefinitionLists]
  695. Definition lists work a little bit differently from standard lists.
  696. Each list item has two parts: the item or word to be defined, and
  697. the definition itself.
  698. If the rule ['deflisttextstrip' #deflisttextstrip] is defined, then each line of the
  699. definition will have extra spaces stripped off, even if
  700. ['keeplistindent' #keeplistindent] is also defined.
  701. If the rule ['blanksarounddeflist' #blanksarounddeflist] is defined for a target, an extra
  702. blank line is emitted before and after the top level list. No
  703. additional lines are emitted for nested lists.
  704. If the rule ['blanksaroundnestedlist' #blanksaroundnestedlist] is defined for a target, an
  705. extra blank line is emitted before and after all lists, including
  706. nested lists.
  707. ===deflistOpen===[deflistOpen]
  708. This tag is emitted to mark the start of a new definition list.
  709. By default this tag is emitted on its own line. The rule
  710. ['notbreaklistopen' #notbreaklistopen] is intended to allow [listOpen #listOpen] to be on the
  711. same line as its first item, however this rule is not yet supported
  712. and does not affect the output.
  713. By default, the indent of a nested list is added (in spaces) at the
  714. beginning of the line this tag is on. If the rule
  715. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  716. not defined, these spaces are removed.
  717. If the rule ['compactlist' #compactlist] is defined for a target, then this tag
  718. is only used for wide lists. Otherwise it is used for both.
  719. : Macros:
  720. None
  721. ===deflistCompactOpen===[deflistCompactOpen]
  722. This tag marks the beginning of a new compact definition list.
  723. This tag is only used if the rule ['compactlist' #compactlist] is defined.
  724. By default, the indent of a nested list is added (in spaces) at the
  725. beginning of the line this tag is on. If the rule
  726. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  727. not defined, these spaces are removed.
  728. : Macros:
  729. None
  730. ===deflistClose, deflistCompactClose===[deflistClose]
  731. These tags are emitted, on their own line, to close the list opened
  732. by the previous tags.
  733. By default, the indent of a nested list is added (in spaces) at the
  734. beginning of the line this tag is on. If the rule
  735. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  736. not defined, these spaces are removed.
  737. : Macros:
  738. None
  739. ===deflistItem1Open===[deflistItem1Open]
  740. This tag is emitted before each item within a definition list. It is
  741. specifically meant to go before the term to be defined.
  742. By default, the indent of a nested list is added (in spaces) at the
  743. beginning of the line this tag is on. If the rule
  744. ['tagnotindentable' #tagnotindentable] is defined, or the rule ['keeplistindent' #keeplistindent] is
  745. not defined, these spaces are removed.
  746. If the rule ['imgasdefterm' #imgasdefterm] is defined, then a linked image is
  747. allowed as the term to be defined. Otherwise, only text is allowed.
  748. : Macros:
  749. : **~D~**
  750. If this macro is included in the tag, it will be expanded to the
  751. value of the depth of that particular list. Top level lists
  752. have depth '1', a nested list inside the top level would have
  753. depth level '2', and so on.
  754. If the rule ['blockdepthmultiply' #blockdepthmultiply] is defined for the target,
  755. the depth value will be multiplied by that amount before being
  756. emitted. If the rule ['depthmultiplyplus' #depthmultiplyplus] is defined, then that
  757. value will be added to the depth before multiplying by
  758. ['blockdepthmultiply' #blockdepthmultiply], but only if used with
  759. ['blockdepthmultiply' #blockdepthmultiply].
  760. : **~V~**
  761. This macro will be expanded to the nesting level of the list. It
  762. is not affected by ['blockdepthmultiply' #blockdepthmultiply], so the numbers will
  763. always count one by one.
  764. If the rule ['listlevelzerobased' #listlevelzerobased] is defined for a target, then
  765. the top level lists will be level '0', the next level '1',
  766. and so on. Otherwise, the top level is '1' and the next level
  767. '2' and so on.
  768. ===deflistItem1Close===[deflistItem1Close]
  769. This tag is emitted after each definition term, but before the
  770. definition itself, for each item in the list.
  771. : Macros:
  772. None
  773. ===deflistItem2Open===[deflistItem2Open]
  774. This tag is emitted directly after [deflistItem1Close #deflistItem1Close], and is
  775. used right before the definition text of the item.
  776. : Macros:
  777. None
  778. ===deflistItem2LinePrefix===[deflistItem2LinePrefix]
  779. This tag is emitted at the beginning of each line of the definition
  780. text for each item.
  781. Note that it is not multiplied for nexted lists. It is the same for
  782. every level of a nested list.
  783. If the rule ['keeplistindent' #keeplistindent] is defined and ['deflisttextstrip' #deflisttextstrip]
  784. is not defined, then this is emitted after the indent for each line
  785. of the list.
  786. : Macros:
  787. None
  788. ===deflistItem2Close===[deflistItem2Close]
  789. This tag is emitted at the end of each definition, and therefor at
  790. the end of each item of the definition list.
  791. For examples, the tags for a definition list are emitted as follows:
  792. ``deflistOpen``, ``deflistItem1Open``, ``deflistItem1Close``,
  793. ``deflistItem2Open``, (``deflistItem2LinePrefix`` for each line),
  794. ``deflistItem2Close``, ``deflistItem1Open``, and so on for the
  795. entire list.
  796. : Macros:
  797. None
  798. +Tables+[chapter-Tables]
  799. Tables allow the user to arrange data in rows and columns for better
  800. organization. Some targets support very complicated tables, while
  801. others only support limited options within tables or do not support
  802. tables at all. Txt2tags is limited to the most basic and most common
  803. table options usable by the greatest number of targets.
  804. If the rule ['tableable' #tableable] is //not// defined, then the table markup
  805. is emitted unchanged from the source document and put inside a
  806. verbatim block.
  807. If the rule ['blanksaroundtable' #blanksaroundtable] is defined, then an extra blank
  808. line will be emitted before and after the table markup.
  809. ++Macros++[section-Macros]
  810. Because of how complicated most table markup can be, there are
  811. several macro tags that can be defined that may be expanded by
  812. several other tags. These tags will all be defined here to be easier
  813. to find in this reference.
  814. ===_tableBorder===[_tableBorder]
  815. This tag may be inserted into the outer table and row tags to
  816. designate that this table should have a border.
  817. For tags that support it, it will replace the macro **~B~**.
  818. ===_tableCellBorder===[_tableCellBorder]
  819. This tag may be inserted into the markup of each individual cell to
  820. designate that this table should have a border.
  821. It will replace the macro **~B~**.
  822. ===_tableAlignLeft, _tableAlignCenter===[_tableAlign]
  823. These tags may be inserted into the outer table and row tags to
  824. designate how the entire table should be aligned within the
  825. document, if the target supports table alignment.
  826. Note that Txt2tags does not currently allow right-aligned tables.
  827. Whichever tag is appropriate will replace the macro **~A~**.
  828. ===_tableColAlignLeft, _tableColAlignRight, _tableColAlignCenter===[_tableColAlign]
  829. If the rule ['tablecellaligntype' #tablecellaligntype] is set to the value ['column' #column]
  830. for the target, then these tags may be inserted into the outer table
  831. or row tags for that table.
  832. These alignment settings will be used for each cell in the column,
  833. for targets that do not support per-cell alignment.
  834. The column alignment 'group' is made out of several copies of these
  835. tags, one for each column in the table. They may be separated by
  836. [tableColAlignSep #tableColAlignSep]. Then the entire group is inserted into the
  837. appropriate opening tags of the table.
  838. The column alignment group will replace the macro **~C~**.
  839. ===tableColAlignSep===[tableColAlignSep]
  840. If the table has a border, then each item in the column alignment
  841. group (see above) will be separated by this tag. It is also used in
  842. multicolumn cells (see below) for the same purpose.
  843. Note that, if the table does not have a border, then not only will
  844. this tag not be inserted into the alignment group, but any copies of
  845. the tag already in the relevant tags of the table will also be
  846. removed.
  847. ===_tableCellAlignLeft, _tableCellAlignRight, _tableCellAlignCenter===[_tableCellAlign]
  848. If the rule ['tablecellaligntype' #tablecellaligntype] is set to the value ['cell' #cell]
  849. for the target, then these tags may be inserted into the cell tags
  850. for the table. This is for targets that support per-cell alignment.
  851. The alignment tag will replace the macro **~A~**.
  852. ===_tableCellColSpan===[_tableCellColSpan]
  853. If the rule ['tablecellspannable' #tablecellspannable] is defined for a target, then
  854. this tag will be inserted into cells that span more than one column.
  855. It replaces the macro **~S~**.
  856. : Macros:
  857. : **\a**
  858. This mark is used inside the tag to give the span of the cell.
  859. It is replaced with the numeric value of the number of columns
  860. that this cell spans.
  861. ``_tableCellColSpan`` will only be emitted for cells that have a
  862. span value greater than '1'.
  863. If the rule ['cellspancumulative' #cellspancumulative] is defined for a target, then
  864. this value will grow for each cell in a row. That is, cell '1'
  865. will have a span value of '1', cell '2' will have a span value of
  866. '2', and so on, with spanned cells increasing the value more.
  867. If the rule ['cellspanmultiplier' #cellspanmultiplier] is defined for a target, then
  868. the span value will be multiplied by this value, after
  869. accumulation if appropriate.
  870. ===_tableCellColSpanChar===[_tableCellColSpanChar]
  871. If the rule ['tablecellspannable' #tablecellspannable] is defined for a target and this
  872. tag is also defined, it will be used instead of
  873. [_tableCellColSpan #_tableCellColSpan].
  874. This tag will be emitted the same number of times as columns that
  875. the cell spans, //minus 1//. For example, if the tag is defined as
  876. '|', and a cell spans three columns, then '||' will be emitted.
  877. The tag, however many need to be emitted, will replace the macro
  878. **~S~**.
  879. ===_tableAttrDelimiter===[_tableAttrDelimiter]
  880. This tag may be inserted into cells that have either a cell
  881. alignment or a cell span to insert. This may be used to separate the
  882. cell attributes from the body of the cell itself.
  883. If the cell has neither an alignment or span to insert, then the
  884. macro for this tag is removed.
  885. This tag will replace the macro **~Z~**.
  886. ++Table Structure++[section-TableStructure]
  887. ===tableOpen, tableClose===[tableOpen]
  888. These tags are the first and last tag emitted for a table. They are
  889. emitted on lines of their own, and are emitted only once for each table.
  890. : Macros:
  891. : **~A~**
  892. This will be replaced with [_tableAlign* #_tableAlign] for a left or center
  893. aligned table.
  894. : **~B~**
  895. This will be replaced with the [_tableBorder #_tableBorder] tag for tables
  896. that have a border, or removed otherwise.
  897. : **~C~**
  898. If the rule ['tablecellaligntype' #tablecellaligntype] is set to ['column' #column], then
  899. this will be replaced with the column alignment group for the
  900. table. (See [_tableColAlign* #_tableColAlign] above.)
  901. ===tableRowOpen===[tableRowOpen]
  902. This tag is emitted at the beginning of each row of cells.
  903. By default each row is emitted on a single line. If the rule
  904. ['breaktablelineopen' #breaktablelineopen] is defined, then a linebreak will be emitted
  905. after this tag before the cells.
  906. : Macros:
  907. : **~A~**
  908. This will be replaced with [_tableAlign* #_tableAlign] for a left or center
  909. aligned table.
  910. : **~B~**
  911. This will be replaced with the [_tableBorder #_tableBorder] tag for tables
  912. that have a border, or removed otherwise.
  913. : **~C~**
  914. If the rule ['tablecellaligntype' #tablecellaligntype] is set to ['column' #column], then
  915. this will be replaced with the column alignment group for the
  916. table. (See [_tableColAlign* #_tableColAlign] above.)
  917. ===tableTitleRowOpen===[tableTitleRowOpen]
  918. This tag, if defined, will be used instead of [tableRowOpen #tableRowOpen] for
  919. title rows. If it is not defined, [tableRowOpen #tableRowOpen] will be used for
  920. all rows.
  921. Note that title rows are not required, and do not need to be the
  922. first row of a table.
  923. If the rule ['breaktablelineopen' #breaktablelineopen] is defined, then a linebreak will
  924. be emitted after this tag before the cells.
  925. : Macros:
  926. : **~A~**
  927. This will be replaced with [_tableAlign* #_tableAlign] for a left or center
  928. aligned table.
  929. : **~B~**
  930. This will be replaced with the [_tableBorder #_tableBorder] tag for tables
  931. that have a border, or r

Large files files are truncated, but you can click here to view the full file