[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a426434 23/23: * html5-schema: Add locating-rules.xml and
From: |
Stefan Monnier |
Subject: |
[elpa] master a426434 23/23: * html5-schema: Add locating-rules.xml and setup nxml to use it |
Date: |
Thu, 14 Jan 2016 19:22:41 +0000 |
branch: master
commit a42643459f0e32e3cda87d652c9f2602316f13b1
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* html5-schema: Add locating-rules.xml and setup nxml to use it
---
packages/html5-schema/html5-schema.el | 67 ++++++++++++++++++++++++++++++
packages/html5-schema/locating-rules.xml | 9 ++++
2 files changed, 76 insertions(+), 0 deletions(-)
diff --git a/packages/html5-schema/html5-schema.el
b/packages/html5-schema/html5-schema.el
new file mode 100644
index 0000000..5fff760
--- /dev/null
+++ b/packages/html5-schema/html5-schema.el
@@ -0,0 +1,67 @@
+;;; html5-schema.el --- Add HTML5 schemas for use by nXML -*-
lexical-binding: t; -*-
+
+;; Copyright (C) 2016 Free Software Foundation, Inc
+
+;; Author: Stefan Monnier <address@hidden>
+;; Keywords: html, xml
+;; Version: 0.1
+;; URL: https://github.com/validator/validator
+;; Package-Type: multi
+
+;; 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/>.
+
+;;; Commentary:
+
+;; The RelaxNG files are taken straight from
+;; https://github.com/validator/validator.git's via:
+;;
+;; git subtree -P schema/html5 split
+;;
+;; To which we manually add `locating-rules.xml` and this file.
+
+;;; Code:
+
+;;;###autoload
+(when load-file-name
+ (let* ((dir (file-name-directory load-file-name))
+ (file (expand-file-name "locating-rules.xml" dir)))
+ (eval-after-load 'rng-loc
+ `(progn
+ (add-to-list 'rng-schema-locating-files-default 'file)
+ ;; FIXME: We should only push to rng-schema-locating-files-default,
+ ;; since rng-schema-locating-files is a custom var, but by the time
+ ;; we run, rng-schema-locating-files has already been initialized
+ ;; from rng-schema-locating-files-default, so setting
+ ;; rng-schema-locating-files-default doesn't have any effect
+ ;; any more!
+ (add-to-list 'rng-schema-locating-files ,file)
+ (put 'http://whattf.org/datatype-draft 'rng-dt-compile
+ #'nxml-html5-dt-compile)))))
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.html?\\'" . nxml-mode))
+
+(defvar nxml-html5-dt-params nil)
+(defvar nxml-html5-dt-names nil)
+
+;;;###autoload
+(defun nxml-html5-dt-compile (name params)
+ ;; FIXME: How/when is `params' ever used? It seems to always be nil!
+ (add-to-list 'nxml-html5-dt-params params)
+ (add-to-list 'nxml-html5-dt-names name)
+ ;; FIXME: We currently don't do any actual validation of datatypes!
+ '(t identity))
+
+(provide 'html5-schema)
+;;; html5-schema.el ends here
diff --git a/packages/html5-schema/locating-rules.xml
b/packages/html5-schema/locating-rules.xml
new file mode 100644
index 0000000..86b2bb1
--- /dev/null
+++ b/packages/html5-schema/locating-rules.xml
@@ -0,0 +1,9 @@
+<!-- <?xml version="1.0"?> -->
+<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
+ <uri pattern="*.html" typeId="HTML5" />
+ <uri pattern="*.xhtml" typeId="XHTML5" />
+ <namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML5"/>
+ <documentElement localName="html" typeId="HTML5" />
+ <typeId id="XHTML5" uri="xhtml5.rnc" />
+ <typeId id="HTML5" uri="html5.rnc" />
+</locatingRules>
- [elpa] master c3b8596 14/23: Sync up with latest ARIA-in-HTML spec changes, (continued)
- [elpa] master c3b8596 14/23: Sync up with latest ARIA-in-HTML spec changes, Stefan Monnier, 2016/01/14
- [elpa] master 1c11a56 12/23: Add the "integrity" attribute, Stefan Monnier, 2016/01/14
- [elpa] master f1cac66 11/23: Refine some ARIA checking to sync w/ current spec, Stefan Monnier, 2016/01/14
- [elpa] master ae3a23b 19/23: Allow the "nonce" attribute, Stefan Monnier, 2016/01/14
- [elpa] master 44fe4a7 16/23: Allow "minlength", Stefan Monnier, 2016/01/14
- [elpa] master 67350aa 15/23: Allow ARIA role=switch, Stefan Monnier, 2016/01/14
- [elpa] master fec8cdf 20/23: Add CSP syntax checking for <meta> & HTTP header, Stefan Monnier, 2016/01/14
- [elpa] master 6e7c7c3 21/23: Make minlength checking behave as expected, Stefan Monnier, 2016/01/14
- [elpa] master 7635384 17/23: Align iframe[sandbox] checking with spec, Stefan Monnier, 2016/01/14
- [elpa] master 1f870ab 18/23: Align event-handler-attribute checking with spec, Stefan Monnier, 2016/01/14
- [elpa] master a426434 23/23: * html5-schema: Add locating-rules.xml and setup nxml to use it,
Stefan Monnier <=
- [elpa] master dcd917c 01/23: Consolidated all RelaxNG files into `/schema` dir., Stefan Monnier, 2016/01/14
- [elpa] master 07bcdb8 22/23: Add 'packages/html5-schema/' from commit '6e7c7c331e7f6692be6c7d39fb9485792f0d3513', Stefan Monnier, 2016/01/14