/contrib/groff/tmac/devtag.tmac

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 131 lines · 121 code · 10 blank · 0 comment · 0 complexity · 6f421c661c5c99befa61cd4ba385d896 MD5 · raw file

  1. .ig
  2. devtag.tmac - macro package for adding tags to roff documents.
  3. File position: <groff_source_top>/tmac/devtag.tmac
  4. Installed position: groff's main macro directory.
  5. ------------------------------------------------------------------------
  6. Legalize
  7. ------------------------------------------------------------------------
  8. This file is part of groff, the GNU roff type-setting system.
  9. Copyright (C) 2004 Free Software Foundation, Inc.
  10. written by Gaius Mulley <gaius@glam.ac.uk>.
  11. groff is free software; you can redistribute it and/or modify it under
  12. the terms of the GNU General Public License as published by the Free
  13. Software Foundation; either version 2, or (at your option) any later
  14. version.
  15. groff is distributed in the hope that it will be useful, but WITHOUT
  16. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  18. for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with groff; see the file COPYING. If not, write to the Free
  21. Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
  22. 02110-1301, USA.
  23. ------------------------------------------------------------------------
  24. Description
  25. ------------------------------------------------------------------------
  26. A simple set of macros to provide markup devices (currently only grohtml)
  27. with tags that define the meaning of the formatted text and also
  28. basic formatting instructions. It generalizes the tag concept used within
  29. grohtml and in the future it is hoped that more markup based devices
  30. can capitalize on this work. It also clearly defines those tags which are
  31. honoured by grohtml. Note that not all tags are included here. Some
  32. of the grohtml specific tags (header specific and jobname, etc.) are
  33. called directly from within www.tmac. The tags defined here are
  34. reasonably generic and could be applied to other devices.
  35. ..
  36. .
  37. .do if d DEVTAG-NH .nx
  38. .
  39. .nr _C \n(.C
  40. .cp 0
  41. .
  42. .\" --------------------------------------------------------------------
  43. .\" DEVTAG <name>
  44. .\"
  45. .\" Emit a tag <name>
  46. .\"
  47. .de DEVTAG
  48. . tag devtag:\\$*
  49. ..
  50. .\" --------------------------------------------------------------------
  51. .\" DEVTAG-NEXT <name>
  52. .\"
  53. .\" When the troff state changes, emit tag <name>
  54. .\"
  55. .de DEVTAG-NEXT
  56. . taga devtag:\\$*
  57. ..
  58. .
  59. .\" --------------------------------------------------------------------
  60. .\" SH <level>
  61. .\" NH <level>
  62. .\" tell device we are starting a numbered heading
  63. .\" Takes a single parameter <level>. <level> 1
  64. .\" is the outer most level.
  65. .
  66. .de DEVTAG-NH
  67. . DEVTAG ".NH \\$1"
  68. ..
  69. .als DEVTAG-SH DEVTAG-NH
  70. .
  71. .\" --------------------------------------------------------------------
  72. .\" COL <n>
  73. .\" indicate that the following text is aligned for the column <n>
  74. .\" n: [1..MAX(n)]
  75. .
  76. .de DEVTAG-COL
  77. . DEVTAG ".col \\$1"
  78. ..
  79. .
  80. .\" --------------------------------------------------------------------
  81. .\" EO-H
  82. .\" indicate that a header has finished.
  83. .
  84. .de DEVTAG-EO-H
  85. . DEVTAG ".eo.h"
  86. ..
  87. .\" --------------------------------------------------------------------
  88. .\" EO-TL
  89. .\" indicate that a title has finished.
  90. .
  91. .de DEVTAG-EO-TL
  92. . DEVTAG ".eo.tl"
  93. ..
  94. .\" --------------------------------------------------------------------
  95. .\" TL
  96. .\" indicate that the following text forms a title.
  97. .
  98. .de DEVTAG-TL
  99. . DEVTAG ".tl"
  100. ..
  101. .
  102. .\" --------------------------------------------------------------------
  103. .\" COL-NEXT <n>
  104. .\" emit a column tag just before the next glyph.
  105. .
  106. .de DEVTAG-COL-NEXT
  107. . DEVTAG-NEXT ".col \\$1"
  108. ..
  109. .
  110. .
  111. .cp \n[_C]
  112. .
  113. .
  114. .\" --------------------------------------------------------------------
  115. .\" Emacs settings
  116. .\" --------------------------------------------------------------------
  117. .
  118. .\" Local Variables:
  119. .\" mode: nroff
  120. .\" End:
  121. .\" EOF