From: "Przemysław Wojnowski" <esperanto@cumego.com>
To: emacs-devel@gnu.org
Subject: [PATCH] Add basic HTML5 support to sgml-mode
Date: Tue, 28 Apr 2015 19:18:47 +0200 [thread overview]
Message-ID: <553FC0F7.7080603@cumego.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 146 bytes --]
Hello everybody,
The patch adds support for basic HTML5 tags and two templates: navigational
links and HTML5 initial page.
Cheers,
Przemysław
[-- Attachment #2: 0001-Add-basic-HTML5-tags-and-a-template.patch --]
[-- Type: text/x-patch, Size: 4684 bytes --]
From 7c6dd4ba9d349a977080055896eac6639891bbb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Przemys=C5=82aw=20Wojnowski?= <esperanto@cumego.com>
Date: Tue, 28 Apr 2015 19:10:01 +0200
Subject: [PATCH] Add basic HTML5 tags and a template
* lisp/textmodes/sgml-mode.el: Basic HTML5 support.
(html-tag-alist): Add HTML5 tags.
(html-tag-help): Add new tags descriptions.
(html-navigational-links): Template for nav links.
(html-html5-template): Template for a HTML5 page.
---
lisp/textmodes/sgml-mode.el | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index c71ecb4..2ffe9c1 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1828,6 +1828,8 @@ This takes effect when first loading the library.")
("array" (nil \n
("Item: " "<item>" str (if sgml-xml-mode "</item>") \n))
"align")
+ ("article" \n)
+ ("aside" \n)
("au")
("b")
("big")
@@ -1853,7 +1855,10 @@ This takes effect when first loading the library.")
"<dd>" (if sgml-xml-mode "</dd>") \n))
("em")
("fn" "id" "fn") ;; Footnotes were deprecated in HTML 3.2
+ ("footer" \n)
("head" \n)
+ ("header" \n)
+ ("hgroup" \n)
("html" (\n
"<head>\n"
"<title>" (setq str (read-input "Title: ")) "</title>\n"
@@ -1871,6 +1876,7 @@ This takes effect when first loading the library.")
("lang")
("li" ,(not sgml-xml-mode))
("math" \n)
+ ("nav" \n)
("nobr")
("option" t ("value") ("label") ("selected" t))
("over" t)
@@ -1880,6 +1886,7 @@ This takes effect when first loading the library.")
("rev")
("s")
("samp")
+ ("section" \n)
("small")
("span" nil
("class"
@@ -1910,6 +1917,8 @@ This takes effect when first loading the library.")
("acronym" . "Acronym")
("address" . "Formatted mail address")
("array" . "Math array")
+ ("article" . "An independent part of document or site")
+ ("aside" . "Secondary content related to surrounding content (e.g. page or article)")
("au" . "Author")
("b" . "Bold face")
("base" . "Base address for URLs")
@@ -1939,6 +1948,7 @@ This takes effect when first loading the library.")
("figt" . "Figure text")
("fn" . "Footnote") ;; No one supports special footnote rendering.
("font" . "Font size")
+ ("footer" . "Footer of a section")
("form" . "Form with input fields")
("group" . "Document grouping")
("h1" . "Most important section headline")
@@ -1948,6 +1958,8 @@ This takes effect when first loading the library.")
("h5" . "Unimportant section headline")
("h6" . "Least important section headline")
("head" . "Document header")
+ ("header" . "Header of a section")
+ ("hgroup" . "Group of headings - h1-h6 elements")
("hr" . "Horizontal rule")
("html" . "HTML Document")
("i" . "Italic face")
@@ -1960,8 +1972,9 @@ This takes effect when first loading the library.")
("li" . "List item")
("link" . "Link relationship")
("math" . "Math formula")
- ("menu" . "Menu list (obsolete)")
+ ("menu" . "List of commands")
("mh" . "Form mail header")
+ ("nav" . "Group of navigational links")
("nextid" . "Allocate new id")
("nobr" . "Text without line break")
("ol" . "Ordered list")
@@ -1975,6 +1988,7 @@ This takes effect when first loading the library.")
("rev" . "Reverse video")
("s" . "Strikeout")
("samp" . "Sample text")
+ ("section" . "Section of a document")
("select" . "Selection list")
("small" . "Font size")
("sp" . "Nobreak space")
@@ -2242,6 +2256,33 @@ HTML Autoview mode is a buffer-local minor mode for use with
"")))
\n))
+(define-skeleton html-navigational-links
+ "Group of navigational links."
+ nil
+ "<nav>" \n
+ "<ul>" \n
+ "<li><a href=\"" (skeleton-read "URL: " "#") "\">"
+ (skeleton-read "Title: ") "</a>"
+ (if sgml-xml-mode (if sgml-xml-mode "</li>")) \n
+ "</ul>" \n
+ "</nav>")
+
+(define-skeleton html-html5-template
+ "Initial HTML5 template"
+ nil
+ "<!DOCTYPE html>" \n
+ "<html lang=\"en\">" \n
+ "<head>" \n
+ "<meta charset=\"utf-8\">" \n
+ "<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">" \n
+ "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" \n
+ "<title>" (skeleton-read "Page Title: ") "</title>" \n
+ "</head>" \n
+ "<body>" \n
+ "<div id=\"app\"></div>" \n
+ "</body>" \n
+ "</html>")
+
(provide 'sgml-mode)
;;; sgml-mode.el ends here
--
2.1.0
next reply other threads:[~2015-04-28 17:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 17:18 Przemysław Wojnowski [this message]
2015-04-28 21:28 ` [PATCH] Add basic HTML5 support to sgml-mode Dmitry Gutov
2015-04-28 21:49 ` Przemysław Wojnowski
2015-05-10 16:51 ` Przemysław Wojnowski
2015-05-10 18:03 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=553FC0F7.7080603@cumego.com \
--to=esperanto@cumego.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.