Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Subject: I reached limit of 'html-tag-alist' in html-mode. Need advice for template engine.
Newsgroups: gmane.emacs.help
Date: Sunday 13th January 2013 15:17:04 UTC (over 3 years ago)
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" \n
           "" \n
           "" (setq str (read-input "Title: ")) "\n"
           "\n"
           "\n

" str "

" "\n
" \n "" (user-full-name) "" \n "
" \n "\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: ... 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!
 
CD: 4ms