Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hober committed Jul 4, 2009
0 parents commit ca8de60
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
@@ -0,0 +1,8 @@
syntax:
svn co http://svn.versiondude.net/whattf/syntax/trunk/ syntax

clean:
rm *~ *.elc

distclean:
rm -rf syntax
18 changes: 18 additions & 0 deletions README.markdown
@@ -0,0 +1,18 @@
This project provides the ability to use `nxml-mode` to edit XHTML5
documents with validation. First, you'll need to fetch the RELAX NG
schema from the WHAT Task Force subversion repository; a simple `make`
in this directory should do the trick.

Next, you'll need to add this directory to your `load-path`. Let's
assume you've placed it in `~/code/html5-el/`.

(add-to-list 'load-path "~/code/html5-el/")

Finally, wire this stuff into `nxml-mode` like so, altering the path to
`schemas.xml` appropriately.

(eval-after-load "rng-loc"
'(add-to-list 'rng-schema-locating-files "~/code/html5-el/schemas.xml"))

(eval-after-load "rng-dt"
'(require 'whattf-dt))
8 changes: 8 additions & 0 deletions schemas.xml
@@ -0,0 +1,8 @@
<!-- RELAX NG Schema for HTML 5: schema locating rules for nxml-mode -->
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<uri pattern="*.html" typeId="XHTML5"/>
<uri pattern="*.xhtml" typeId="XHTML5"/>
<namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML5"/>
<documentElement localName="html" typeId="XHTML5"/>
<typeId id="XHTML5" uri="syntax/relaxng/xhtml5.rnc"/>
</locatingRules>
51 changes: 51 additions & 0 deletions whattf-dt.el
@@ -0,0 +1,51 @@
;;; whattf-dt.el --- WHAT Task Force datatype library for Emacs Lisp

;; Copyright (C) 2009 Edward O'Connor

;; Author: Edward O'Connor <hober0@gmail.com>
;; Keywords: hypermedia

;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
;; "Software"), to deal in the Software without restriction, including
;; without limitation the rights to use, copy, modify, merge, publish,
;; distribute, sublicense, and/or sell copies of the Software, and to
;; permit persons to whom the Software is furnished to do so, subject to
;; the following conditions:

;; The above copyright notice and this permission notice shall be
;; included in all copies or substantial portions of the Software.

;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
;; SOFTWARE.

;;; Commentary:

;; Eventually, this file will contain elisp definitions for the various
;; WHATTF datatypes <URL:http://hsivonen.iki.fi/html5-datatypes/>.

;; For now, this file provides a dummy datatype validator to
;; `nxml-mode', so that you can use the WHATTF HTML5 RELAX-NG schema for
;; validating your markup.

;;; Code:

(put 'http://whattf.org/datatype-draft
'rng-dt-compile
'whattf-dt-compile)

(defun whattf-dt-compile (name params)
"Provides WHAT Task Force datatypes as a RELAX NG datatypes library.
NAME is a symbol giving the local name of the datatype. PARAMS is a list
of pairs (PARAM-NAME . PARAM-VALUE) where PARAM-NAME is a symbol giving
the name of the parameter and PARAM-VALUE is a string giving its value."
(list t 'identity))

(provide 'whattf-dt)
;;; whattf-dt.el ends here

0 comments on commit ca8de60

Please sign in to comment.