mallard-mode

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

git clone 'git://github.com/jhradilek/emacs-mallard-mode.git'
0

Major Mode for Mallard

Description

The emacs-mallard-mode repository provides mallard-mode, a major mode for editing Mallard pages in Emacs. When enabled, mallard-mode loads the RELAX NG schema for Mallard, sets appropriate indentation rules, and enables automatic line wrapping. In addition, it provides a number of commands and key bindings that integrate it with the yelp-check utility in order to provide maximum comfort when editing Mallard pages.

Installation

Installing mallard-mode Using package.el

To install mallard-mode by using the package.el package manager for Emacs, add the following lines to your ~/.emacs.d/init.el file 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-mode package:

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

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

Installing mallard-mode Manually

To install mallard-mode manually, change to the directory with your local copy of this repository and copy its contents to the ~/.emacs.d/mallard-mode/ directory:

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

Then add the following lines to your ~/.emacs.d/init.el file to enable it:

(add-to-list 'load-path "~/.emacs.d/mallard-mode")
(require 'mallard-mode)

Configuration

mallard-mode provides a number of customizable variables that allow you to adjust its behavior. To view or change these variables, run the following Emacs command:

M-x customize-mode

The available variables are as follows:

Variable Description
mallard-mode-comments-buffer The name of the buffer for editorial comments. The default value is *mallard-comments*.
mallard-mode-comments-command The command to display editorial comments. The default value is yelp-check comments.
mallard-mode-hrefs-buffer The name of the buffer for broken external links. The default value is *mallard-hrefs*.
mallard-mode-hrefs-command The command to display broken external links. The default value is yelp-check hrefs.
mallard-mode-status-buffer The name of the buffer for the page status. The default value is *mallard-status*.
mallard-mode-status-command The command to display the page status. The default value is yelp-check status.
mallard-mode-validate-buffer The name of the buffer for validation errors. The default value is *mallard-validate*.
mallard-mode-validate-command The command to validate the page. The default value is yelp-check validate.

Refer to the GNU Emacs manual for more information on how to customize major modes in Emacs.

Usage

To use mallard-mode, either open a file with the .page or .page.stub file extension, or enable it for the current buffer by running the following Emacs command:

M-x mallard-mode

Refer to the GNU Emacs manual for more information on how to enable and configure major modes in Emacs.

Available Commands and Key Bindings

mallard-mode inherits commands and key bindings from nxml-mode. In addition, it defines a number of commands and key bindings that integrate it with the yelp-check utility in order to provide maximum comfort when editing Mallard pages. To run any of these commands in Emacs, type:

M-x COMMAND

The available commands are as follows:

Command Key Binding Description
mallard-comments C-c C-c Displays editorial comments in the currently edited Mallard page.
mallard-hrefs C-c C-h Displays broken external links in the currently edited Mallard page.
mallard-status C-c C-s Displays the status of the currently edited Mallard page.
mallard-validate C-c C-v Validates the currently edited Mallard page.
mallard-version Displays the current version of mallard-mode in the minibuffer.

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

The RELAX NG schema for Mallard is licensed by Shaun McCance under a Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0 US).