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