<em><a href="Non-Sumou.html">Other GNU Emacs tips</a></em></p>
To create your own tags, which you can use in your Muse documents as shortcuts and which will then be substituted for customized HTML markup when publishing to the web, i.e. create custom tables for instance, use the following template, it's very easy.</p> <pre class="example"> (add-to-list 'muse-publish-markup-tags
'("blackcode" t t t 'ignore)) ;; add the tag at publication level. (add-to-list 'muse-html-markup-tags '("blackcode" t t t muse-blackcode-tag)) ;; adds the function that does stuff when publishing to HTML. ;; ;; And this function does the actual work. In this case, it puts the ;; stuff inside the tag into a table which I stylesheet to look right. (defun muse-blackcode-tag (beg end attrs) (muse-blackcode-table-tag beg end)) (defun muse-blackcode-table-tag (beg end) (save-excursion (goto-char beg) (muse-insert-markup "<table bgcolor=\"#000000\" border=\"1\"> <tr><td border=\"0\"><font color=\"#FFFF00\"><b>$ ") (goto-char end) (muse-insert-markup "</b></td></tr></table>"))) </pre>
The above code takes the text between the <strong>blackcode</strong> tags and inserts it into a customized black table with yellow text in the published HTML Muse document. <!— Page published by Emacs Muse ends here —> </div> <i>To send me feedback about this page, use the below email.</i><br /> <b>© sumoudou.org 2010</b><br /> <img style="border:0" alt="sumoudou.org" src="email.gif" width="129" height="10" /><br /> <a href="http://www.gnu.org/" style="text-decoration: none;"><img style="border:0" alt="GNU" src="powered-by-gnu.png" />]] <a href="http://www.gnu.org/software/emacs/emacs.html" style="text-decoration: none;"><img style="border:0" alt="GNU Emacs" src="made-with-emacs.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hcoop-proud-member.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hosted-by-hcoop.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="made-with-muse.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="powered-by-muse.png" />]] <br /> <a href="http://www.fsf.org/resources/formats/playogg" style="text-decoration: none;"><img style="border:0" alt="Ogg" src="play-ogg.png" />]] <a href="http://www.catb.org/hacker-emblem/" style="text-decoration: none;"><img style="border:0" alt="Glider" src="glider.png" />]] <a href="http://ubuntu.com/" style="text-decoration: none;"><img style="border:0" alt="Ubuntu" src="ubuntu.png" />]] <a href="http://validator.w3.org/check?uri=referer" style="text-decoration: none;"><img style="border:0" alt="Valid XHTML 1.0 Strict!" src="valid-xhtml10-blue.png" />]] <a href="http://jigsaw.w3.org/css-validator/check/referer" style="text-decoration: none;"><img style="border:0" alt="Valid CSS!" src="valid-css-blue.png" />]] <br />Last updated 2009-11-13-14-00
</div> <br />. </body> </html>