mallard-snippets

https://github.com/jhradilek/emacs-mallard-snippets.git

git clone 'git://github.com/jhradilek/emacs-mallard-snippets.git'
1

Mallard Snippets for Emacs

Description

The emacs-mallard-snippets repository provides Emacs snippets for the Mallard XML language according to the Mallard 1.0 specification.

Installation

Important: A working installation of the YASnippet template system for Emacs is required for these snippets to work. Refer to the YASnippet repository for information on how to install, configure, and use it.

Installing the Snippets Using package.el

To install the snippets by using the package.el package manager for Emacs, add the following lines to your ~/.emacs.d/init.el to enable the Milkypostman's Emacs Lisp Package Archive (MELPA) repository:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)

Then run the following Emacs commands to install the mallard-snippets package:

M-x package-refresh-contents
M-x package-install mallard-snippets

Refer to the GNU Emacs manual for more information on how to download, install, update, and uninstall packages in this editor.

Installing the Snippets Manually

To install the snippets manually, change to the directory with your local copy of this repository and copy the snippets/nxml-mode/ directory into the directory you configured for snippets. For example, to install the snippets to the ~/.emacs.d/snippets/ directory, type:

cp -R snippets/mallard-mode/ ~/.emacs.d/snippets/

This installs the snippets for mallard-mode. If you do not have this major mode installed and do not want it, install these snippets in the nxml-mode directory instead. For example:

cp -R snippets/mallard-mode/ ~/.emacs.d/snippets/nxml-mode/

To load the snippets in Emacs, use the following Emacs command:

M-x yas-reload-all

Usage

Before using the snippets, make sure that you have the YASnippet template system configured. At minimum, add the following lines to your ~/.emacs.d/init.el file:

(require 'yasnippet)
(yas-global-mode 1)

Also make sure that you are using mallard-mode. To enable it for the current buffer, use the following Emacs command:

M-x mallard-mode

Note that if you performed manual installation and decided to install the snippets for nxml-mode, use the following Emacs command instead:

M-x nxml-mode

To expand a snippet, type the corresponding keyword and press the trigger key (the Tab key by default). The table below provides a comprehensive list of available keywords. Refer to the YASnippet repository for more information on how to configure and use this template system.

Snippets for Mallard 1.0 Elements

Keyword Description
app <app>...</app>
cite <cite>...</cite>
cite <cite date="...">...</cite>
cite <cite date="..." href="...">...</cite>
cmd <cmd>...</cmd>
code <code>...</code>
code <code mime="...">...</code>
colgroup <colgroup>...</colgroup>
col <col>...</col>
comment <comment>...</comment>
credit <credit type="...">...</credit>
desc <desc>...</desc>
desc <desc>...</desc>
email <email>...</email>
em <em>...</em>
example <example>...</example>
figure <figure>...</figure>
file <file>...</file>
gui <gui>...</gui>
gui <gui style="...">...</gui>
guiseq <guiseq>...</guiseq>
info <info>...</info>
input <input>...</input>
item <item>...</item>
key <key>...</key>
keyseq <keyseq>...</keyseq>
keyseq <keyseq type="...">...</keyseq>
license <license href="...">...</license>
link <link href="...">...</link>
link <link type="..." xref="..." />
link <link type="..." xref="..." group="..." />
link <link xref="..." />
links <links type="..." />
links <links type="..." groups="...">...</links>
links <links type="..." groups="..." style="...">...</links>
listing <listing>...</listing>
list <list>...</list>
list <list type="...">...</list>
media <media type="..." mime="..." src="...">...</media>
media <media type="..." mime="..." src="..." width="..." height="...">...</media>
media <media type="..." mime="..." src="..." />
media <media type="..." mime="..." src="..." width="..." height="..." />
name <name>...</name>
note <note>...</note>
note <note style="...">...</note>
output <output>...</output>
output <output style="...">...</output>
page <page id="...">...</page>
page <page type="..." id="...">...</page>
page <page type="..." style="..." id="...">...</page>
p <p>...</p>
quote <quote>...</quote>
revision <revision docversion="..." version="..." date="..." status="..." />
revision <revision pkgversion="..." version="..." date="..." status="..." />
revision <revision version="..." date="..." status="..." />
screen <screen>...</screen>
section <section id="...">...</section>
span <span>...</span>
steps <steps>...</steps>
subtitle <subtitle>...</subtitle>
synopsis <synopsis>...</synopsis>
sys <sys>...</sys>
table <table>...</table>
table <table frame="..." rules="..." shade="...">...</table>
tbody <tbody>...</tbody>
td <td>...</td>
td <td colspan="...">...</td>
td <td colspan="..." rowspan="...">...</td>
td <td rowspan="...">...</td>
terms <terms>...</terms>
tfoot <tfoot>...</tfoot>
thead <thead>...</thead>
title <title>...</title>
title <title type="...">...</title>
title <title type="..." role="...">...</title>
tree <tree>...</tree>
tree <tree style="...">...</tree>
tr <tr>...</tr>
var <var>...</var>
years <years>...</years>

See Also

Copyright and License

Copyright © 2013 Jaromir Hradilek

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.