* I reached limit of 'html-tag-alist' in html-mode. Need advice for template engine.
@ 2013-01-13 15:17 Oleksandr Gavenko
0 siblings, 0 replies; only message in thread
From: Oleksandr Gavenko @ 2013-01-13 15:17 UTC (permalink / raw)
To: help-gnu-emacs
To quickly insert HTML template I use standard html-mode command sgml-tag (C-c
C-t). I modify standard template by own code:
(setq my-html-template
'("html"
(nil
"\n<head>" \n
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" (read-input "Charset: ") "\">" \n
"<title>" (setq str (read-input "Title: ")) "</title>\n"
"</head>\n"
"<body>\n<h1>" str "</h1>"
"\n<address>" \n
"<a href=\"mailto:" user-mail-address "\">" (user-full-name) "</a>" \n
"</address>" \n
"</body>\n"
))
)
(setq sgml-set-face t) ; for highlighting in sgml
(eval-after-load 'sgml-mode
'(progn
(unless (featurep 'psgml)
(setq html-tag-alist
(cons
my-html-template
(my-filter
(lambda (item) (not (equal (car item) "html")))
html-tag-alist)))
(add-to-list 'html-tag-alist '("script" (\n) ("type" "text/javascript") ))
(add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") ))
)))
But seems that I can't insert such code:
<!DOCTYPE html>
<html>
...
</html>
So I start look to Emacs general templating engine.
Simple search shown that most feature rich is yasnippet:
http://www.emacswiki.org/emacs/CategoryTemplates
I try this package before but it was hard to extend by own snippet. And I
dislike file naming convention (tag == file name) - it was very US/ASCII
specific.
Next thing that was interesting is SRecode which already in Emacs and use sane
syntax and can use Semantic info for completion.
But SRecode have no HTML templates implementation...
--
Best regards!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-13 15:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-13 15:17 I reached limit of 'html-tag-alist' in html-mode. Need advice for template engine Oleksandr Gavenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).