Text::Markdown::Discount
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
2.8 KiB

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