"Dirk-Jan C. Binnema" <djcb.b...@gmail.com> writes:

> Hi all,
>
> I sometimes use blocks of code in my org-files; currently, to make them
> look nice, I put the code in a buffer with their major mode (e.g, a blog
> perl in a buffer with perl-mode), then convert it to html with htmlize,
> and copy the result html back in an org-mode html block.
>
> #+BEGIN_HTML
> <pre></pre>
> #+END_HTML
>
> I seems that I should be able to automate that a bit... ie., maybe
> something like:
>
> #+BEGIN_CODE(perl)
> print "hello, world!";
> #+END_CODE
>
> And *somehow* make that execute the steps I mentioned, and get something
> like; so I'd need to cut-out only the stuff within <pre></pre> the
> htmlize-generated html (it generates top-level html stuff which we
> should ignore I guess).
>  
> <pre>
> <span class="cperl-nonoverridable">print</span> <span class="string">"hello, 
> world!\n"</span>;</pre>
>
>
> But I'm not really sure if that would be the best approach. Did anyone
> do something like this before?

Hi Dirk,

I think what you are describing is achieved by

* some heading
#+BEGIN_SRC perl
print "hello, world!";
#+END_SRC

Then you just export the buffer as HTML.

See 

http://orgmode.org/manual/Literal-examples.html#Literal-examples

Sorry if I've misunderstood.

Dan


>  Any tips?
>
> Thanks,
> Dirk.


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

Reply via email to