Release this as Muse 3.00.90 (RC1).
[muse-el.git] / examples / QuickStart
blobbd99e0b25ff84b568e9b0a82bd2c193ddaeb4e5e
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 * About this document
13 This document provides an example of Muse markup and also functions as
14 a quickstart for Muse.
16 To see what it looks like when published, type =make examples=.  You
17 will then get an Info document, an HTML document, and a PDF document
18 (provided you have an implementation of LaTeX installed with the
19 necessary fonts).
21 <contents>
23 * Getting Started
25 To use Muse, add the directory containing its files to your
26 =load-path= variable, in your =.emacs= file.  Then, load in the
27 authoring mode, and the styles you wish to publish to.  For example:
29 <example>
30 (add-to-list 'load-path "<path to Muse>")
32 (require 'muse-mode)     ; load authoring mode
34 (require 'muse-html)     ; load publishing styles I use
35 (require 'muse-latex)
36 (require 'muse-texinfo)
37 (require 'muse-docbook)
38 </example>
40 Once loaded, the command =M-x muse-publish-this-file= will publish an
41 input document to any available style.  If you enable =muse-mode=
42 within a buffer, by typing =M-x muse-mode=, this command will be bound
43 to =C-c C-t=.
45 * Creating a Muse project
47 Often you will want to publish all the files within a directory to a
48 particular set of output styles automatically.  To support, Muse
49 allows for the creations of "projects".  Here is a sample project, to
50 be defined in your =.emacs= file:
52 <example>
53 (require 'muse-project)
55 (setq muse-project-alist
56       '(("website"                      ; my various writings
57          ("~/Pages" :default "index")
58          (:base "html" :path "~/public_html")
59          (:base "pdf" :path "~/public_html/pdf"))))
60 </example>
62 The above defines a project named "website", whose files are located
63 in the directory =~/Pages=.  The default page to visit is =index=.
64 When this project is published, each page will be output as HTML to
65 the directory =~/public_html=, and as PDF to the directory
66 =~/public_html/pdf=.  Within any project page, you may create a link
67 to other pages using the syntax =[[pagename]]=.
69 * Markup rules
71 A Muse document uses special, contextual markup rules to determine how
72 to format the output result.  For example, if a paragraph is indented,
73 Muse assumes it should be quoted.
75 There are not too many markup rules, and all of them strive to be as
76 simple as possible so that you can focus on document creation, rather
77 than formatting.
79 ** Paragraphs
81 Separate paragraphs in Muse must be separate by a blank line.
83 For example, the input text used for this section is:
85 <example>
86 Separate paragraphs in Muse must be separate by a blank line.
88 For example, the input text used for this section is:
89 </example>
91 ** Centered paragraphs and quotations
93 A line that begins with six or more columns of whitespace (either tabs
94 or spaces) indicates a centered paragraph.
96 <comment>
97                            This is centered
98 </comment>
100   But if a line begins with whitespace, though less than six columns,
101   it indicates a quoted paragraph.
103 ** Headings
105 A heading becomes a chapter or section in printed output -- depending
106 on the style.  To indicate a heading, start a new paragraph with one
107 to three asterices, followed by a space and the heading title.  Then
108 begin another paragraph to enter the text for that section.
110 <example>
111 * First level
113 ** Second level
115 *** Third level
116 </example>
118 ** Horizontal rules
120 Four or more dashes indicate a horizontal rule.  Be sure to put blank
121 lines around it, or it will be considered part of the proceeding or
122 following paragraph!
124 ----
126 The separator above was produced by typing:
128 <example>
129 ----
130 </example>
132 ** Emphasizing text
134 To emphasize text, surround it with certain specially recognized
135 characters:
137 <example>
138 *emphasis*
139 **strong emphasis**
140 ***very strong emphasis***
141 _underlined_
142 =verbatim and monospace=
143 </example>
145 The above list renders as:
147 <verse>
148 *emphasis*
149 **strong emphasis**
150 ***very strong emphasis***
151 _underlined_
152 =verbatim and monospace=
153 </verse>
155 ** Adding footnotes
157 A footnote reference is simply a number in square
158 brackets<verbatim>[1]</verbatim>.[1] To define the footnote, place
159 this definition at the bottom of your file.  =footnote-mode= can be
160 used to greatly facilitate the creation of these kinds of footnotes.
162 <example>
163  Footnotes:
164  [1]  Footnotes are defined by the same number in brackets
165       occurring at the beginning of a line.  Use footnote-mode's
166       C-c ! a command, to very easily insert footnotes while
167       typing.  Use C-x C-x to return to the point of insertion.
168 </example>
170 ** Verse
172 Poetry requires that whitespace be preserved, but without resorting to
173 monospace.  To indicate this, use the following markup, reminiscent of
174 e-mail quotations:
176 <example>
177 > A line of Emacs verse;
178 >   forgive its being so terse.
179 </example>
181 The above is rendered as:
183 > A line of Emacs verse;
184 >   forgive its being so terse.
186 You can also use the =<literal><verse></literal>= tag, if you prefer:
188 <example>
189 <verse>
190 A line of Emacs verse;
191   forgive its being so terse.
192 </verse>
193 </example>
195 ** Literal paragraphs
197 The =<literal><example></literal>= tag is used for examples, where
198 whitespace should be preserved, the text rendered in monospace, and
199 any characters special to the output style escaped.
201 There is also the =<literal><literal></literal>= tag, which causes a
202 marked block to be entirely left alone.  This can be used for
203 inserting a hand-coded HTML blocks into HTML output, for example.
205 ** Lists
207 Lists are given using special characters at the beginning of a line.
208 Whitespace must occur before bullets or numbered items, to distinguish
209 from the possibility of those characters occurring in a real sentence.
211 The supported kinds of lists are:
213 <example>
214   - bullet item one
215   - bullet item two
217   1. Enumerated item one
218   2. Enumerated item two
220 Term1 :: A definition one
222 Term2 :: A definition two
223 </example>
225 These are rendered as a bullet list:
227   - bullet item one
228   - bullet item two
230 An enumerated list:
232   1. Enum item one
233   2. Enum item two
235 And a definition list:
237 Term1 ::
238   This is a first definition
239   And it has two lines;
240   no, make that three.
242 Term2 ::
243   This is a second definition
245 <comment>
246 ** Tables
248 Only very simple tables are supported.  The syntax is:
250 <example>
251   Double bars  || Separate header fields
253   Single bars   | Separate body fields
254   Here are more | body fields
256   Triple bars ||| Separate footer fields
257 </example>
259 The above is rendered as:
261 Double bars  || Separate header fields
263 Single bars   | Separate body fields
264 Here are more | body fields
266 Triple bars ||| Separate footer fields
268 <comment>
269 Double bars  || Separate header fields
271 Single bars   | Separate body fields
272 Here are more | body fields
274 Triple bars ||| Separate footer fields
275 </comment>
277 ** Anchors and tagged links
279 =#example= If you begin a line with "#anchor" -- where "anchor" can be
280 any word that doesn't contain whitespace -- it defines an anchor at
281 that point into the document.  This point can be referenced using
282 "page#anchor" as the target in a Muse link (see below).
284 ** URLs and E-mail addresses
286 A URL or e-mail address encountered in the input text is published as
287 a hyperlink if the output style supports it.  If it is an image URL,
288 it will be inlined if possible.  For example, the latest Muse source
289 can be downloaded at
290 http://www.newartisans.com/johnw/Emacs/muse.tar.gz and mail may be
291 sent to johnw@gnu.org
293 ** Links
295 A hyperlink can reference a URL, or another page within a Muse
296 project.  In addition, descriptive text can be specified, which should
297 be displayed rather than the link text in output styles that supports
298 link descriptions.  The syntax is:
300 <example>
301 [[link target][link description]]
302 [[link target without description]]
303 </example>
305 Thus, Muse can be downloaded [[http://www.newartisans.com/johnw/Emacs/muse.tar.gz][here]], or at
306 [[http://www.newartisans.com/johnw/Emacs/muse.tar.gz]].
308 ** Embedded lisp
310 Arbitrary kinds of markup can be achieved using the
311 =<literal><lisp></literal>= tag, which is the only Muse tag supported
312 in a style's header and footer text.  With the
313 =<literal><lisp></literal>= tag, you may generated whatever output
314 text you wish.  The inserted output will get marked up, if the
315 =<literal><lisp></literal>= tag appears within the main text of the
316 document.
318 <example>
319 <lisp>(concat "This form gets " "inserted")</lisp>
320 </example>
322 The above renders as: <lisp>(concat "This form gets " "inserted")</lisp>.
324 * Authoring mode
326 * Publishing styles
328 One of the principle features of Muse is the ability to publish a
329 simple input text to a variety of different output styles.  Muse also
330 makes it easy to create new styles, or derive from an existing style.
332 ** Deriving from an existing style
334 To create a new style from an existing one, use =muse-derive-style=:
336 <example>
337 (muse-derive-style DERIVED-NAME BASE-NAME STYLE-PARAMETERS)
338 </example>
340 The derived name is a string defining the new style, such as
341 "my-html".  The base name must identify an existing style, such as
342 "html" -- if you have loaded =muse-html=.  The style parameters are
343 the same as those used to create a style, except that they override
344 whatever definitions exist in the base style.  However, some
345 definitions only partially override.  Those which support partial
346 overriding are:
348 :functions ::
349   If a markup function is not found in the derived style's function
350   list, the base style's function list will be queried.
352 :strings ::
354 :before ::
356 :before-end ::
358 :after ::
360 ** Overriding an existing style
362 ** Creating a new style
364 Footnotes:
365 [1]  This is a footnote.