docbook-snippets

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

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

DocBook Snippets for Emacs

Description

The emacs-docbook-snippets repository provides a complete set of Emacs snippets for the DocBook 4.5 XML language according to DocBook: The Definitive Guide, version 2.0.17.

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 docbook-snippets package:

M-x package-refresh-contents
M-x package-install docbook-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/nxml-mode/ ~/.emacs.d/snippets/

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 the nxml-mode. To enable it for the current buffer, use the following Emacs command:

M-x nxml-mode

To expand a snippet, type the corresponding keyword and press the trigger key (the Tab key by default). The tables below provide 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 DocBook 4.5 Elements

Keyword Description
abbrev <abbrev>...</abbrev>
abstract <abstract>...</abstract>
accel <accel>...</accel>
ackno <ackno>...</ackno>
acronym <acronym>...</acronym>
action <action>...</action>
address <address>...</address>
affiliation <affiliation>...</affiliation>
alt <alt>...</alt>
anchor <anchor id="..." />
answer <answer>...</answer>
appendixinfo <appendixinfo>...</appendixinfo>
appendix <appendix id="...">...</appendix>
application <application>...</application>
area <area id="..." coords="..." />
areaset <areaset id="...">...</areaset>
areaspec <areaspec units="...">...</areaspec>
arg <arg>...</arg>
articleinfo <articleinfo>...</articleinfo>
article <article id="...">...</article>
artpagenums <artpagenums>...</artpagenums>
attribution <attribution>...</attribution>
audiodata <audiodata fileref="..." />
audioobject <audioobject>...</audioobject>
authorblurb <authorblurb>...</authorblurb>
authorgroup <authorgroup>...</authorgroup>
authorinitials <authorinitials>...</authorinitials>
author <author>...</author>
beginpage <beginpage pagenum="..." />
bibliocoverage <bibliocoverage>...</bibliocoverage>
bibliodiv <bibliodiv>...</bibliodiv>
biblioentry <biblioentry>...</biblioentry>
bibliographyinfo <bibliographyinfo>...</bibliographyinfo>
bibliography <bibliography id="...">...</bibliography>
biblioid <biblioid class="...">...</biblioid>
bibliolist <bibliolist>...</bibliolist>
bibliomisc <bibliomisc>...</bibliomisc>
bibliomixed <bibliomixed>...</bibliomixed>
bibliomset <bibliomset relation="...">...</bibliomset>
biblioref <biblioref linkend="..." />
bibliorelation <bibliorelation type="..." class="...">...</bibliorelation>
biblioset <biblioset relation="...">...</biblioset>
bibliosource <bibliosource class="...">...</bibliosource>
blockinfo <blockinfo>...</blockinfo>
blockquote <blockquote>...</blockquote>
bookinfo <bookinfo>...</bookinfo>
book <book id="...">...</book>
bridgehead <bridgehead id="...">...</bridgehead>
calloutlist <calloutlist>...</calloutlist>
callout <callout arearefs="...">...</callout>
caption <caption>...</caption>
caution <caution>...</caution>
chapterinfo <chapterinfo>...</chapterinfo>
chapter <chapter id="...">...</chapter>
citation <citation>...</citation>
citebiblioid <citebiblioid class="...">...</citebiblioid>
citerefentry <citerefentry>...</citerefentry>
citetitle <citetitle pubwork="...">...</citetitle>
city <city>...</city>
classname <classname>...</classname>
classsynopsisinfo <classsynopsisinfo>...</classsynopsisinfo>
classsynopsis <classsynopsis class="..." language="...">...</classsynopsis>
cmdsynopsis <cmdsynopsis>...</cmdsynopsis>
code <code language="...">...</code>
colgroup <colgroup>...</colgroup>
collab <collab>...</collab>
collabname <collabname>...</collabname>
col <col>...</col>
colophon <colophon id="...">...</colophon>
colspec <colspec colname="..." colnum="..." colwidth="..." />
command <command>...</command>
computeroutput <computeroutput>...</computeroutput>
co <co label="..." linkends="..." />
confdates <confdates>...</confdates>
confgroup <confgroup>...</confgroup>
confnum <confnum>...</confnum>
confsponsor <confsponsor>...</confsponsor>
conftitle <conftitle>...</conftitle>
constant <constant>...</constant>
constructorsynopsis <constructorsynopsis language="...">...</constructorsynopsis>
contractnum <contractnum>...</contractnum>
contractsponsor <contractsponsor>...</contractsponsor>
contrib <contrib>...</contrib>
copyright <copyright>...</copyright>
coref <coref label="..." linkend="..." />
corpauthor <corpauthor>...</corpauthor>
corpcredit <corpcredit>...</corpcredit>
corpname <corpname>...</corpname>
country <country>...</country>
database <database class="...">...</database>
date <date>...</date>
dedication <dedication>...</dedication>
destructorsynopsis <destructorsynopsis language="...">...</destructorsynopsis>
edition <edition>...</edition>
editor <editor>...</editor>
email <email>...</email>
emphasis <emphasis>...</emphasis>
entry <entry>...</entry>
entrytbl <entrytbl cols="...">...</entrytbl>
envar <envar>...</envar>
epigraph <epigraph>...</epigraph>
equation <equation>...</equation>
errorcode <errorcode>...</errorcode>
errorname <errorname>...</errorname>
errortext <errortext>...</errortext>
errortype <errortype>...</errortype>
example <example id="...">...</example>
exceptionname <exceptionname>...</exceptionname>
fax <fax>...</fax>
fieldsynopsis <fieldsynopsis language="...">...</fieldsynopsis>
figure <figure id="...">...</figure>
filename <filename>...</filename>
firstname <firstname>...</firstname>
firstterm <firstterm>...</firstterm>
footnote <footnote>...</footnote>
footnoteref <footnoteref linkend="..." />
foreignphrase <foreignphrase>...</foreignphrase>
formalpara <formalpara>...</formalpara>
funcdef <funcdef>...</funcdef>
funcparams <funcparams>...</funcparams>
funcprototype <funcprototype>...</funcprototype>
funcsynopsisinfo <funcsynopsisinfo>...</funcsynopsisinfo>
funcsynopsis <funcsynopsis>...</funcsynopsis>
function <function>...</function>
glossaryinfo <glossaryinfo>...</glossaryinfo>
glossary <glossary id="...">...</glossary>
glossdef <glossdef>...</glossdef>
glossdiv <glossdiv>...</glossdiv>
glossentry <glossentry>...</glossentry>
glosslist <glosslist>...</glosslist>
glossseealso <glossseealso otherterm="...">...</glossseealso>
glosssee <glosssee otherterm="...">...</glosssee>
glossterm <glossterm>...</glossterm>
graphicco <graphicco>...</graphicco>
graphic <graphic fileref="..." />
group <group>...</group>
guibutton <guibutton>...</guibutton>
guiicon <guiicon>...</guiicon>
guilabel <guilabel>...</guilabel>
guimenuitem <guimenuitem>...</guimenuitem>
guimenu <guimenu>...</guimenu>
guisubmenu <guisubmenu>...</guisubmenu>
hardware <hardware>...</hardware>
highlights <highlights>...</highlights>
holder <holder>...</holder>
honorific <honorific>...</honorific>
imagedata <imagedata fileref="..." format="..." scalefit="..." />
imageobjectco <imageobjectco>...</imageobjectco>
imageobject <imageobject>...</imageobject>
important <important>...</important>
indexdiv <indexdiv>...</indexdiv>
indexentry <indexentry>...</indexentry>
indexinfo <indexinfo>...</indexinfo>
index <index id="...">...</index>
indexterm <indexterm>...</indexterm>
informalequation <informalequation>...</informalequation>
informalexample <informalexample>...</informalexample>
informalfigure <informalfigure>...</informalfigure>
informaltable <informaltable>...</informaltable>
initializer <initializer>...</initializer>
inlineequation <inlineequation>...</inlineequation>
inlinegraphic <inlinegraphic fileref="..." format="..." scalefit="..." />
inlinemediaobject <inlinemediaobject>...</inlinemediaobject>
interface <interface>...</interface>
interfacename <interfacename>...</interfacename>
invpartnumber <invpartnumber>...</invpartnumber>
isbn <isbn>...</isbn>
issn <issn>...</issn>
issuenum <issuenum>...</issuenum>
itemizedlist <itemizedlist>...</itemizedlist>
itermset <itermset>...</itermset>
jobtitle <jobtitle>...</jobtitle>
keycap <keycap>...</keycap>
keycode <keycode>...</keycode>
keycombo <keycombo>...</keycombo>
keysym <keysym>...</keysym>
keyword <keyword>...</keyword>
keywordset <keywordset>...</keywordset>
label <label>...</label>
legalnotice <legalnotice>...</legalnotice>
lineage <lineage>...</lineage>
lineannotation <lineannotation>...</lineannotation>
link <link linkend="...">...</link>
listitem <listitem>...</listitem>
literallayout <literallayout>...</literallayout>
literal <literal>...</literal>
lotentry <lotentry linkend="...">...</lotentry>
lot <lot>...</lot>
manvolnum <manvolnum>...</manvolnum>
markup <markup>...</markup>
mathphrase <mathphrase>...</mathphrase>
medialabel <medialabel>...</medialabel>
mediaobjectco <mediaobjectco>...</mediaobjectco>
mediaobject <mediaobject>...</mediaobject>
member <member>...</member>
menuchoice <menuchoice>...</menuchoice>
methodname <methodname>...</methodname>
methodparam <methodparam>...</methodparam>
methodsynopsis <methodsynopsis language="...">...</methodsynopsis>
modespec <modespec application="...">...</modespec>
modifier <modifier>...</modifier>
mousebutton <mousebutton>...</mousebutton>
msgaud <msgaud>...</msgaud>
msgentry <msgentry>...</msgentry>
msgexplan <msgexplan>...</msgexplan>
msginfo <msginfo>...</msginfo>
msglevel <msglevel>...</msglevel>
msgmain <msgmain>...</msgmain>
msg <msg>...</msg>
msgorig <msgorig>...</msgorig>
msgrel <msgrel>...</msgrel>
msgset <msgset>...</msgset>
msgsub <msgsub>...</msgsub>
msgtext <msgtext>...</msgtext>
note <note>...</note>
objectinfo <objectinfo>...</objectinfo>
olink <olink targetdocent="...">...</olink>
ooclass <ooclass>...</ooclass>
ooexception <ooexception>...</ooexception>
oointerface <oointerface>...</oointerface>
optional <optional>...</optional>
option <option>...</option>
orderedlist <orderedlist>...</orderedlist>
orgdiv <orgdiv>...</orgdiv>
orgname <orgname>...</orgname>
otheraddr <otheraddr>...</otheraddr>
othercredit <othercredit>...</othercredit>
othername <othername>...</othername>
package <package>...</package>
pagenums <pagenums>...</pagenums>
paramdef <paramdef>...</paramdef>
parameter <parameter class="...">...</parameter>
para <para>...</para>
partinfo <partinfo>...</partinfo>
partintro <partintro>...</partintro>
part <part id="...">...</part>
personblurb <personblurb>...</personblurb>
personname <personname>...</personname>
phone <phone>...</phone>
phrase <phrase>...</phrase>
pob <pob>...</pob>
postcode <postcode>...</postcode>
prefaceinfo <prefaceinfo>...</prefaceinfo>
preface <preface id="...">...</preface>
primaryie <primaryie>...</primaryie>
primary <primary>...</primary>
printhistory <printhistory>...</printhistory>
procedure <procedure id="...">...</procedure>
productname <productname class="...">...</productname>
productnumber <productnumber>...</productnumber>
programlistingco <programlistingco>...</programlistingco>
programlisting <programlisting language="...">...</programlisting>
prompt <prompt>...</prompt>
property <property>...</property>
pubdate <pubdate>...</pubdate>
publisher <publisher>...</publisher>
publishername <publishername>...</publishername>
pubsnumber <pubsnumber>...</pubsnumber>
qandadiv <qandadiv>...</qandadiv>
qandaentry <qandaentry>...</qandaentry>
qandaset <qandaset>...</qandaset>
question <question>...</question>
quote <quote>...</quote>
refclass <refclass>...</refclass>
refdescriptor <refdescriptor>...</refdescriptor>
refentryinfo <refentryinfo>...</refentryinfo>
refentry <refentry>...</refentry>
refentrytitle <refentrytitle>...</refentrytitle>
referenceinfo <referenceinfo>...</referenceinfo>
reference <reference>...</reference>
refmeta <refmeta>...</refmeta>
refmiscinfo <refmiscinfo>...</refmiscinfo>
refnamediv <refnamediv>...</refnamediv>
refname <refname>...</refname>
refpurpose <refpurpose>...</refpurpose>
refsect1info <refsect1info>...</refsect>
refsect1 <refsect1 id="...">...</refsect>
refsect2info <refsect2info>...</refsect>
refsect2 <refsect2 id="...">...</refsect>
refsect3info <refsect3info>...</refsect>
refsect3 <refsect3 id="...">...</refsect>
refsectioninfo <refsectioninfo>...</refsectioninfo>
refsection <refsection id="...">...</refsection>
refsynopsisdivinfo <refsynopsisdivinfo>...</refsynopsisdivinfo>
refsynopsisdiv <refsynopsisdiv>...</refsynopsisdiv>
releaseinfo <releaseinfo>...</releaseinfo>
remark <remark>...</remark>
replaceable <replaceable>...</replaceable>
returnvalue <returnvalue>...</returnvalue>
revdescription <revdescription>...</revdescription>
revhistory <revhistory>...</revhistory>
revision <revision>...</revision>
revnumber <revnumber>...</revnumber>
revremark <revremark>...</revremark>
row <row>...</row>
sbr <sbr />
screenco <screenco>...</screenco>
screeninfo <screeninfo>...</screeninfo>
screen <screen>...</screen>
screenshot <screenshot>...</screenshot>
secondaryie <secondaryie>...</secondaryie>
secondary <secondary>...</secondary>
sect1info <sect1info>...</sect>
sect1 <sect1 id="...">...</sect>
sect2info <sect2info>...</sect>
sect2 <sect2 id="...">...</sect>
sect3info <sect3info>...</sect>
sect3 <sect3 id="...">...</sect>
sect4info <sect4info>...</sect>
sect4 <sect4 id="...">...</sect>
sect5info <sect5info>...</sect>
sect5 <sect5 id="...">...</sect>
sectioninfo <sectioninfo>...</sectioninfo>
section <section id="...">...</section>
seealsoie <seealsoie>...</seealsoie>
seealso <seealso>...</seealso>
seeie <seeie>...</seeie>
see <see>...</see>
seglistitem <seglistitem>...</seglistitem>
segmentedlist <segmentedlist>...</segmentedlist>
seg <seg>...</seg>
segtitle <segtitle>...</segtitle>
seriesvolnums <seriesvolnums>...</seriesvolnums>
setindexinfo <setindexinfo>...</setindexinfo>
setindex <setindex>...</setindex>
setinfo <setinfo>...</setinfo>
set <set>...</set>
sgmltag <sgmltag>...</sgmltag>
shortaffil <shortaffil>...</shortaffil>
shortcut <shortcut>...</shortcut>
sidebarinfo <sidebarinfo>...</sidebarinfo>
sidebar <sidebar>...</sidebar>
simpara <simpara>...</simpara>
simplelist <simplelist>...</simplelist>
simplemsgentry <simplemsgentry>...</simplemsgentry>
simplesect <simplesect id="...">...</simplesect>
spanspec <spanspec spanname="..." namest="..." nameend="..." />
state <state>...</state>
stepalternatives <stepalternatives>...</stepalternatives>
step <step>...</step>
street <street>...</street>
structfield <structfield>...</structfield>
structname <structname>...</structname>
subject <subject>...</subject>
subjectset <subjectset>...</subjectset>
subjectterm <subjectterm>...</subjectterm>
subscript <subscript>...</subscript>
substeps <substeps>...</substeps>
subtitle <subtitle>...</subtitle>
superscript <superscript>...</superscript>
surname <surname>...</surname>
symbol <symbol>...</symbol>
synopfragment <synopfragment id="...">...</synopfragment>
synopfragmentref <synopfragmentref linkend="...">...</synopfragmentref>
synopsis <synopsis>...</synopsis>
systemitem <systemitem>...</systemitem>
table <table id="...">...</table>
task <task id="...">...</task>
taskprerequisites <taskprerequisites>...</taskprerequisites>
taskrelated <taskrelated>...</taskrelated>
tasksummary <tasksummary>...</tasksummary>
tbody <tbody>...</tbody>
td <td>...</td>
termdef <termdef>...</termdef>
term <term>...</term>
tertiaryie <tertiaryie>...</tertiaryie>
tertiary <tertiary>...</tertiary>
textdata <textdata fileref="..." />
textobject <textobject>...</textobject>
tfoot <tfoot>...</tfoot>
tgroup <tgroup cols="...">...</tgroup>
thead <thead>...</thead>
th <th>...</th>
tip <tip>...</tip>
titleabbrev <titleabbrev>...</titleabbrev>
title <title>...</title>
tocback <tocback linkend="...">...</tocback>
tocchap <tocchap>...</tocchap>
tocentry <tocentry linkend="...">...</tocentry>
tocfront <tocfront linkend="...">...</tocfront>
toclevel1 <toclevel1>...</toclevel>
toclevel2 <toclevel2>...</toclevel>
toclevel3 <toclevel3>...</toclevel>
toclevel4 <toclevel4>...</toclevel>
toclevel5 <toclevel5>...</toclevel>
toc <toc>...</toc>
tocpart <tocpart>...</tocpart>
token <token>...</token>
trademark <trademark class="...">...</trademark>
tr <tr>...</tr>
type <type>...</type>
ulink <ulink url="...">...</ulink>
uri <uri>...</uri>
userinput <userinput>...</userinput>
varargs <varargs />
variablelist <variablelist>...</variablelist>
varlistentry <varlistentry>...</varlistentry>
varname <varname>...</varname>
videodata <videodata fileref="..." scalefit="..." />
videoobject <videoobject>...</videoobject>
void <void />
volumenum <volumenum>...</volumenum>
warning <warning>...</warning>
wordasword <wordasword>...</wordasword>
xref <xref linkend="..." />
year <year>...</year>

Snippets for DocBook 4.5 Element Aliases

Keyword Description
bold <emphasis role='bold'>...</emphasis>
cartridge <medialabel class="cartridge">...</medialabel>
cdrom <medialabel class="cdrom">...</medialabel>
daemon <systemitem class="daemon">...</systemitem>
devicefile <filename class="devicefile">...</filename>
directory <filename class='directory'>...</filename>
disk <medialabel class="disk">...</medialabel>
domainname <systemitem class="domainname">...</systemitem>
etheraddress <systemitem class="etheraddress">...</systemitem>
eventhandler <systemitem class="eventhandler">...</systemitem>
event <systemitem class="event">...</systemitem>
extension <filename class="extension">...</filename>
filesystem <systemitem class="filesystem">...</systemitem>
fqdomainname <systemitem class="fqdomainname">...</systemitem>
groupname <systemitem class="groupname">...</systemitem>
headerfile <filename class="headerfile">...</filename>
ipaddress <systemitem class="ipaddress">...</systemitem>
libraryfile <filename class="libraryfile">...</filename>
library <systemitem class="library">...</systemitem>
macro <systemitem class="macro">...</systemitem>
netmask <systemitem class="netmask">...</systemitem>
newsgroup <systemitem class="newsgroup">...</systemitem>
osname <systemitem class="osname">...</systemitem>
partition <filename class="partition">...</filename>
process <systemitem class="process">...</systemitem>
protocol <systemitem class="protocol">...</systemitem>
resource <systemitem class="resource">...</systemitem>
server <systemitem class="server">...</systemitem>
service <systemitem class="service">...</systemitem>
strong <emphasis role="strong">...</emphasis>
symlink <filename class="symlink">...</filename>
systemname <systemitem class="systemname">...</systemitem>
tape <medialabel class="tape">...</medialabel>
username <systemitem class="username">...</systemitem>

Snippets for Commonly Used XML Elements

Keyword Description
xml <?xml version='...' encoding='...' ?>
doctype <!DOCTYPE ...>
cdata <![CDATA[...]]>
xi:fallback <xi:fallback xmlns:xi="...">...</xi:fallback>
xi:include <xi:include href="..." xmlns:xi="..." />

See Also

Copyright

Copyright © 2012 Martin Prpič
Copyright © 2010–2015 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, version 3 of the License.

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/.