theme.1 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .\" %A%
  2. .\"
  3. .Dd January 23, 2008
  4. .Dt THEME 1
  5. .Os MASTODON
  6. .Sh NAME
  7. .Nm theme
  8. .Nd create a web page from a template file
  9. .Sh SYNOPSIS
  10. .Nm
  11. .Op Fl d Pa root
  12. .Op Fl E
  13. .Op Fl f
  14. .Op Fl o Pa file
  15. .Op Fl p Pa pagename
  16. .Op Fl t Pa template
  17. .Op Fl V
  18. .Op Pa textfile
  19. .Sh DESCRIPTION
  20. The
  21. .Nm
  22. utility takes a
  23. .Xr markdown 7 Ns -formatted
  24. .Pa textfile
  25. .Pq or stdin if not specified,
  26. compiles it, and combines it with a
  27. .Em template
  28. .Po
  29. .Pa page.theme
  30. by default
  31. .Pc
  32. to produce a web page. If a path to the
  33. template is not specified,
  34. .Nm
  35. looks for
  36. .Pa page.theme
  37. in the current directory, then each parent directory up to the
  38. .Pa "document root"
  39. .Po
  40. set with
  41. .Fl d
  42. or, if unset, the
  43. .Em "root directory"
  44. of the system.
  45. .Pc
  46. If
  47. .Pa page.theme
  48. is found,
  49. .Nm
  50. copies it to the output, looking for
  51. .Em "<?theme action?>"
  52. html tags and processing the embedded
  53. .Ar action
  54. as appropriate.
  55. .Pp
  56. .Nm
  57. processes the following actions:
  58. .Bl -tag -width "include("
  59. .It Ar author
  60. Prints the author name(s) from the
  61. .Xr mkd_doc_author 3
  62. function.
  63. .It Ar body
  64. Prints the formatted
  65. .Xr markdown 7
  66. input file.
  67. .It Ar date
  68. Prints the date returned by
  69. .Xr mkd_doc_date 3
  70. or, if none, the
  71. date the input file was last modified.
  72. .It Ar dir
  73. Prints the directory part of the pagename
  74. .It Ar include Ns Pq Pa file
  75. Prints the contents of
  76. .Pa file .
  77. .Xr Markdown 7
  78. translation will
  79. .Em NOT
  80. be done on this file.
  81. .It Ar source
  82. The filename part of the pagename.
  83. .It Ar style
  84. Print any stylesheets
  85. .Pq see Xr mkd-extensions 7
  86. found in the input file.
  87. .It Ar title
  88. Print the title returned by
  89. .Xr mkd_doc_title 3 ,
  90. or, if that does not exist, the source filename.
  91. .It Ar version
  92. Print the version of
  93. .Xr discount 7
  94. that this copy of theme was compiled with.
  95. .El
  96. .Pp
  97. If input is coming from a file and the output was not set with the
  98. .Fl o
  99. option,
  100. .Nm writes the output to
  101. .Pa file-sans-text.html
  102. .Pq if
  103. .Ar file
  104. has a
  105. .Pa .text
  106. suffix, that will be stripped off and replaced with
  107. .Pa .html ;
  108. otherwise a
  109. .Pa .html
  110. will be appended to the end of the filename.)
  111. .Pp
  112. The options are as follows:
  113. .Bl -tag -width "-o file"
  114. .It Fl d Pa root
  115. Set the
  116. .Em "document root"
  117. to
  118. .Ar root
  119. .It Fl E
  120. Normally
  121. theme will not expand
  122. .Pa "<?theme body?>"
  123. or
  124. .Pa "<?theme toc?>"
  125. in the
  126. .Pa "<head>"
  127. section, or
  128. .Pa "<?theme style?>"
  129. in the
  130. .Pa "<body>"
  131. section, but the
  132. .Fl E
  133. option overrides this and allows expansions everywhere.
  134. .It Fl f
  135. Forcibly overwrite existing html files.
  136. .It Fl o Pa filename
  137. Write the output to
  138. .Ar filename .
  139. .It Fl p Ar path
  140. Set the pagename to
  141. .Ar path .
  142. .It Fl t Ar filename
  143. Use
  144. .Ar filename
  145. as the template file.
  146. .El
  147. .Sh RETURN VALUES
  148. The
  149. .Nm
  150. utility exits 0 on success, and >0 if an error occurs.
  151. .Sh SEE ALSO
  152. .Xr markdown 1 ,
  153. .Xr markdown 3 ,
  154. .Xr markdown 7 ,
  155. .Xr mkd-extensions 7 .
  156. .Sh AUTHOR
  157. .An David Parsons
  158. .Pq Li [email protected]