Initial commit of muse.texi, nothing substantial
[muse-el.git] / README
blob23069da205a342ecf0d36ed8c678110ce01fa93c
1 #title The Emacs Muse
3 Emacs Muse is an authoring and publishing environment for Emacs.  It
4 simplifies the process of writings documents and publishing them to
5 various output formats.
7 Muse consists of two main parts: an enhanced text-mode for authoring
8 documents and navigating within Muse projects, and a set of publishing
9 styles for generating different kinds of output.
11 <contents>
13 * Getting Started
15 To use Muse, add the directory containing its files to your
16 =load-path= variable, in your =.emacs= file.  Then, load in the
17 authoring mode, and the styles you wish to publish to.  For example:
19 <example>
20 (add-to-list 'load-path "<path to Muse>")
22 (require 'muse-mode)     ; load authoring mode
24 (require 'muse-html)     ; load publishing styles I use
25 (require 'muse-latex)
26 (require 'muse-texinfo)
27 (require 'muse-docbook)
28 </example>
30 Once loaded, the command =M-x muse-publish-this-file= will publish an
31 input document to any available style.  If you enable =muse-mode=
32 within a buffer, by typing =M-x muse-mode=, this command will be bound
33 to =C-c C-t=.
35 * Creating a Muse project
37 Often you will want to publish all the files within a directory to a
38 particular set of output styles automatically.  To support, Muse
39 allows for the creations of "projects".  Here is a sample project, to
40 be defined in your =.emacs= file:
42 <example>
43 (require 'muse-project)
45 (setq muse-project-alist
46       '(("website"                      ; my various writings
47          ("~/Pages" :default "index")
48          (:base "html" :path "~/public_html")
49          (:base "pdf" :path "~/public_html/pdf"))))
50 </example>
52 The above defines a project named "website", whose files are located
53 in the directory =~/Pages=.  The default page to visit is =index=.
54 When this project is published, each page will be output as HTML to
55 the directory =~/public_html=, and as PDF to the directory
56 =~/public_html/pdf=.  Within any project page, you may create a link
57 to other pages using the syntax =[[pagename]]=.
59 * Markup rules
61 A Muse document uses special, contextual markup rules to determine how
62 to format the output result.  For example, if a paragraph is indented,
63 Muse assumes it should be quoted.
65 There are not too many markup rules, and all of them strive to be as
66 simple as possible so that you can focus on document creation, rather
67 than formatting.
69 ** Paragraphs
71 Separate paragraphs in Muse must be separate by a blank line.
73 For example, the input text used for this section is:
75 <example>
76 Separate paragraphs in Muse must be separate by a blank line.
78 For example, the input text used for this section is:
79 </example>
81 ** Centered paragraphs and quotations
83 A line that begins with six or more columns of whitespace (either tabs
84 or spaces) indicates a centered paragraph.
86 <comment>
87                            This is centered
88 </comment>
90   But if a line begins with whitespace, though less than six columns,
91   it indicates a quoted paragraph.
93 ** Headings
95 A heading becomes a chapter or section in printed output -- depending
96 on the style.  To indicate a heading, start a new paragraph with one
97 to three asterices, followed by a space and the heading title.  Then
98 begin another paragraph to enter the text for that section.
100 <example>
101 * First level
103 ** Second level
105 *** Third level
106 </example>
108 ** Horizontal rules
110 Four or more dashes indicate a horizontal rule.  Be sure to put blank
111 lines around it, or it will be considered part of the proceeding or
112 following paragraph!
114 ----
116 The separator above was produced by typing:
118 <example>
119 ----
120 </example>
122 ** Emphasizing text
124 To emphasize text, surround it with certain specially recognized
125 characters:
127 <example>
128 *emphasis*
129 **strong emphasis**
130 ***very strong emphasis***
131 _underlined_
132 =verbatim and monospace=
133 </example>
135 The above list renders as:
137 <verse>
138 *emphasis*
139 **strong emphasis**
140 ***very strong emphasis***
141 _underlined_
142 =verbatim and monospace=
143 </verse>
145 ** Adding footnotes
147 A footnote reference is simply a number in square
148 brackets<verbatim>[1]</verbatim>.[1] To define the footnote, place
149 this definition at the bottom of your file.  =footnote-mode= can be
150 used to greatly facilitate the creation of these kinds of footnotes.
152 <example>
153  Footnotes:
154  [1]  Footnotes are defined by the same number in brackets
155       occurring at the beginning of a line.  Use footnote-mode's
156       C-c ! a command, to very easily insert footnotes while
157       typing.  Use C-x C-x to return to the point of insertion.
158 </example>
160 ** Verse
162 Poetry requires that whitespace be preserved, but without resorting to
163 monospace.  To indicate this, use the following markup, reminiscent of
164 e-mail quotations:
166 <example>
167 > A line of Emacs verse;
168 >   forgive its being so terse.
169 </example>
171 The above is rendered as:
173 > A line of Emacs verse;
174 >   forgive its being so terse.
176 You can also use the =<literal><verse></literal>= tag, if you prefer:
178 <example>
179 <verse>
180 A line of Emacs verse;
181   forgive its being so terse.
182 </verse>
183 </example>
185 ** Literal paragraphs
187 The =<literal><example></literal>= tag is used for examples, where
188 whitespace should be preserved, the text rendered in monospace, and
189 any characters special to the output style escaped.
191 There is also the =<literal><literal></literal>= tag, which causes a
192 marked block to be entirely left alone.  This can be used for
193 inserting a hand-coded HTML blocks into HTML output, for example.
195 ** Lists
197 Lists are given using special characters at the beginning of a line.
198 Whitespace must occur before bullets or numbered items, to distinguish
199 from the possibility of those characters occurring in a real sentence.
201 The supported kinds of lists are:
203 <example>
204   - bullet item one
205   - bullet item two
207   1. Enumerated item one
208   2. Enumerated item two
210 Term1 :: A definition one
212 Term2 :: A definition two
213 </example>
215 These are rendered as a bullet list:
217   - bullet item one
218   - bullet item two
220 An enumerated list:
222   1. Enum item one
223   2. Enum item two
225 And a definition list:
227 Term1 ::
228   This is a first definition
229   And it has two lines;
230   no, make that three.
232 Term2 ::
233   This is a second definition
235 <comment>
236 ** Tables
238 Only very simple tables are supported.  The syntax is:
240 <example>
241   Double bars  || Separate header fields
243   Single bars   | Separate body fields
244   Here are more | body fields
246   Triple bars ||| Separate footer fields
247 </example>
249 The above is rendered as:
251 Double bars  || Separate header fields
253 Single bars   | Separate body fields
254 Here are more | body fields
256 Triple bars ||| Separate footer fields
258 <comment>
259 Double bars  || Separate header fields
261 Single bars   | Separate body fields
262 Here are more | body fields
264 Triple bars ||| Separate footer fields
265 </comment>
267 ** Anchors and tagged links
269 =#example= If you begin a line with "#anchor" -- where "anchor" can be
270 any word that doesn't contain whitespace -- it defines an anchor at
271 that point into the document.  This point can be referenced using
272 "page#anchor" as the target in a Muse link (see below).
274 ** URLs and E-mail addresses
276 A URL or e-mail address encountered in the input text is published as
277 a hyperlink if the output style supports it.  If it is an image URL,
278 it will be inlined if possible.  For example, the latest Muse source
279 can be downloaded at
280 http://www.newartisans.com/johnw/Emacs/muse.tar.gz and mail may be
281 sent to johnw@gnu.org
283 ** Links
285 A hyperlink can reference a URL, or another page within a Muse
286 project.  In addition, descriptive text can be specified, which should
287 be displayed rather than the link text in output styles that supports
288 link descriptions.  The syntax is:
290 <example>
291 [[link target][link description]]
292 [[link target without description]]
293 </example>
295 Thus, Muse can be downloaded [[http://www.newartisans.com/johnw/Emacs/muse.tar.gz][here]], or at
296 [[http://www.newartisans.com/johnw/Emacs/muse.tar.gz]].
298 ** Embedded lisp
300 Arbitrary kinds of markup can be achieved using the
301 =<literal><lisp></literal>= tag, which is the only Muse tag supported
302 in a style's header and footer text.  With the
303 =<literal><lisp></literal>= tag, you may generated whatever output
304 text you wish.  The inserted output will get marked up, if the
305 =<literal><lisp></literal>= tag appears within the main text of the
306 document.
308 <example>
309 <lisp>(concat "This form gets " "inserted")</lisp>
310 </example>
312 The above renders as: <lisp>(concat "This form gets " "inserted")</lisp>.
314 * Authoring mode
316 * Publishing styles
318 One of the principle features of Muse is the ability to publish a
319 simple input text to a variety of different output styles.  Muse also
320 makes it easy to create new styles, or derive from an existing style.
322 ** Deriving from an existing style
324 To create a new style from an existing one, use =muse-derive-style=:
326 <example>
327 (muse-derive-style DERIVED-NAME BASE-NAME STYLE-PARAMETERS)
328 </example>
330 The derived name is a string defining the new style, such as
331 "my-html".  The base name must identify an existing style, such as
332 "html" -- if you have loaded =muse-html=.  The style parameters are
333 the same as those used to create a style, except that they override
334 whatever definitions exist in the base style.  However, some
335 definitions only partially override.  Those which support partial
336 overriding are:
338 :functions ::
339   If a markup function is not found in the derived style's function
340   list, the base style's function list will be queried.
342 :strings ::
344 :before ::
346 :before-end ::
348 :after ::
350 ** Overriding an existing style
352 ** Creating a new style
354 Footnotes:
355 [1]  This is a footnote.