4
Emacs Muse is an authoring and publishing environment for Emacs. It
5
simplifies the process of writings documents and publishing them to
6
various output formats.
8
Muse consists of two main parts: an enhanced text-mode for authoring
9
documents and navigating within Muse projects, and a set of publishing
10
styles for generating different kinds of output.
14
This document provides an example of Muse markup and also functions as
15
a quickstart for Muse.
17
To see what it looks like when published, type =make examples=. You
18
will then get an Info document, an HTML document, and a PDF document
19
(provided you have an implementation of LaTeX installed with the
26
To use Muse, add the directory containing its files to your
27
=load-path= variable, in your =.emacs= file. Then, load in the
28
authoring mode, and the styles you wish to publish to. For example:
31
(add-to-list 'load-path "<path to Muse>")
33
(require 'muse-mode) ; load authoring mode
35
(require 'muse-html) ; load publishing styles I use
37
(require 'muse-texinfo)
38
(require 'muse-docbook)
41
Once loaded, the command =M-x muse-publish-this-file= will publish an
42
input document to any available style. If you enable =muse-mode=
43
within a buffer, by typing =M-x muse-mode=, this command will be bound
46
* Creating a Muse project
48
Often you will want to publish all the files within a directory to a
49
particular set of output styles automatically. To support, Muse
50
allows for the creations of "projects". Here is a sample project, to
51
be defined in your =.emacs= file:
54
(require 'muse-project)
56
(setq muse-project-alist
57
'(("website" ; my various writings
58
("~/Pages" :default "index")
59
(:base "html" :path "~/public_html")
60
(:base "pdf" :path "~/public_html/pdf"))))
63
The above defines a project named "website", whose files are located
64
in the directory =~/Pages=. The default page to visit is =index=.
65
When this project is published, each page will be output as HTML to
66
the directory =~/public_html=, and as PDF to the directory
67
=~/public_html/pdf=. Within any project page, you may create a link
68
to other pages using the syntax =[[pagename]]=.
72
A Muse document uses special, contextual markup rules to determine how
73
to format the output result. For example, if a paragraph is indented,
74
Muse assumes it should be quoted.
76
There are not too many markup rules, and all of them strive to be as
77
simple as possible so that you can focus on document creation, rather
82
Separate paragraphs in Muse must be separate by a blank line.
84
For example, the input text used for this section is:
87
Separate paragraphs in Muse must be separate by a blank line.
89
For example, the input text used for this section is:
92
** Centered paragraphs and quotations
94
A line that begins with six or more columns of whitespace (either tabs
95
or spaces) indicates a centered paragraph.
101
But if a line begins with whitespace, though less than six columns,
102
it indicates a quoted paragraph.
106
A heading becomes a chapter or section in printed output -- depending
107
on the style. To indicate a heading, start a new paragraph with one
108
to three asterices, followed by a space and the heading title. Then
109
begin another paragraph to enter the text for that section.
121
Four or more dashes indicate a horizontal rule. Be sure to put blank
122
lines around it, or it will be considered part of the proceeding or
127
The separator above was produced by typing:
135
To emphasize text, surround it with certain specially recognized
141
***very strong emphasis***
143
=verbatim and monospace=
146
The above list renders as:
151
***very strong emphasis***
153
=verbatim and monospace=
158
A footnote reference is simply a number in square
159
brackets<verbatim>[1]</verbatim>.[1] To define the footnote, place
160
this definition at the bottom of your file. =footnote-mode= can be
161
used to greatly facilitate the creation of these kinds of footnotes.
165
[1] Footnotes are defined by the same number in brackets
166
occurring at the beginning of a line. Use footnote-mode's
167
C-c ! a command, to very easily insert footnotes while
168
typing. Use C-x C-x to return to the point of insertion.
173
Poetry requires that whitespace be preserved, but without resorting to
174
monospace. To indicate this, use the following markup, reminiscent of
178
> A line of Emacs verse;
179
> forgive its being so terse.
182
The above is rendered as:
184
> A line of Emacs verse;
185
> forgive its being so terse.
187
You can also use the =<literal><verse></literal>= tag, if you prefer:
191
A line of Emacs verse;
192
forgive its being so terse.
196
** Literal paragraphs
198
The =<literal><example></literal>= tag is used for examples, where
199
whitespace should be preserved, the text rendered in monospace, and
200
any characters special to the output style escaped.
202
There is also the =<literal><literal></literal>= tag, which causes a
203
marked block to be entirely left alone. This can be used for
204
inserting a hand-coded HTML blocks into HTML output, for example.
208
Lists are given using special characters at the beginning of a line.
209
Whitespace must occur before bullets or numbered items, to distinguish
210
from the possibility of those characters occurring in a real sentence.
212
The supported kinds of lists are:
218
1. Enumerated item one
219
2. Enumerated item two
221
Term1 :: A definition one
223
Term2 :: A definition two
226
These are rendered as a bullet list:
236
And a definition list:
239
This is a first definition
240
And it has two lines;
244
This is a second definition
248
Only very simple tables are supported. The syntax is:
251
Double bars || Separate header fields
253
Single bars | Separate body fields
254
Here are more | body fields
256
Triple bars ||| Separate footer fields
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
269
Double bars || Separate header fields
271
Single bars | Separate body fields
272
Here are more | body fields
274
Triple bars ||| Separate footer fields
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
Click [[#example][here]] to go back to the previous paragraph.
286
** URLs and E-mail addresses
288
A URL or e-mail address encountered in the input text is published as
289
a hyperlink if the output style supports it. If it is an image URL,
290
it will be inlined if possible. For example, the latest Muse source
292
http://www.newartisans.com/johnw/Emacs/muse.tar.gz and mail may be
293
sent to johnw@gnu.org
297
A hyperlink can reference a URL, or another page within a Muse
298
project. In addition, descriptive text can be specified, which should
299
be displayed rather than the link text in output styles that supports
300
link descriptions. The syntax is:
303
[[link target][link description]]
304
[[link target without description]]
307
Thus, Muse can be downloaded [[http://download.gna.org/muse-el/][here]], or at
308
[[http://download.gna.org/muse-el/]].
312
Arbitrary kinds of markup can be achieved using the
313
=<literal><lisp></literal>= tag, which is the only Muse tag supported
314
in a style's header and footer text. With the
315
=<literal><lisp></literal>= tag, you may generated whatever output
316
text you wish. The inserted output will get marked up, if the
317
=<literal><lisp></literal>= tag appears within the main text of the
321
<lisp>(concat "This form gets " "inserted")</lisp>
324
The above renders as: <lisp>(concat "This form gets " "inserted")</lisp>.
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=:
337
(muse-derive-style DERIVED-NAME BASE-NAME STYLE-PARAMETERS)
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
348
- =:functions= -- If a markup function is not found in the derived
349
style's function list, the base style's function list will be
360
** Overriding an existing style
364
** Creating a new style
369
[1] This is a footnote.