emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] How to customize the org-mode's BEGIN_SRC HTML output


From: Erik Iverson
Subject: Re: [Orgmode] How to customize the org-mode's BEGIN_SRC HTML output
Date: Mon, 23 Aug 2010 14:03:23 -0500
User-agent: Thunderbird 2.0.0.23 (X11/20090812)

Hello Will,

I assume you don't want the htmlize.el functionality, which
syntax highlights the source code according to how you
have it in Emacs?

The way I ultimately ended up doing something similar was to
post-process the html file generated by the export process,
(there is probably a hook so you can do this automatically):

My wants required:

   (while (re-search-forward "<pre " nil t)
         (replace-match
          "<pre style=\"background-color:#FFFFE5; font-size:8pt\" "
          t nil))

You might also have to set org-export-htmlize-output-type to
something other than 'inline-css, but I'm not sure.

Hope this either helps, or that someone has a better way :).

--Erik


卓强 Will Zhuo wrote:
Hi,

Recently I start blogging using org-mode, it works pretty well, except that I would like to customize its output somehow and don't know how to make it work.

Here's one of the cusomization requirement:

when putting source code in blog, I would like to use the plugin: http://alexgorbatchev.com/SyntaxHighlighter/ which is basicly a javascript frontend engine turning the following HTML to a nice looking code snippet on the web brower.

<pre class="brush: js">
    /**
     * SyntaxHighlighter
     */
    function foo()
    {
        if (counter <= 10)
            return;
        // it works!
    }
</pre>
I would like to make my code snippets in the org files exporting exactly what SyntaxHighlighter required (with a <pre class="brush: %(lanangue name)> tag and plain source code in it only escape the special char)

However, I could not find a way:
using #+BEGIN_EXAMPLE give me a <pre> tag with class="example" and some <span> tag

using #+BEGIN_SRC give me a <pre> tag with class="src src-%(lanangue name)" and a bunch of <span> in the code itself.

using #+BEGIN_HTML give me nothing and it does not escape special chars like "<>" either.

And there seems no custmized variable which could control the "class" of the <pre> tag.

My questions are:
Is there some way to achive this?
If it need hack , where should I modify el files to be able to get the BEGIN_SRC works as my expected? Generally, how should one do this kind of customization and how to even add another export format, is there any tutorial to startup ?

thanks for your help,
ZHUO,Qiang


------------------------------------------------------------------------

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]