emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Need info about code block header arguments in (HTML) export


From: Rick Frankel
Subject: Re: [O] Need info about code block header arguments in (HTML) export
Date: Tue, 12 Aug 2014 11:43:36 -0400
User-agent: Roundcube Webmail/0.9.0

On 2014-08-11 10:58, Avdi Grimm wrote:
Hi there, Org experts!

I write books in org-mode, and one of the features I've really started
to need is to be able to automatically include filename information
when exporting source code listings. That is, given some Org source
like this:

    #+BEGIN_SRC ruby :tangle foo/bar.rb
      puts "hello, world"
    #+END_SRC

...the final HTML might look something like this:

    <div class="org-src-container">
    <div class="src-path">foo/bar.rb</div>


Currently, you can acheive similar html output by using the
`#+CAPTION' header argument;

#+CAPTION: foo/bar.pl
#+BEGIN_SRC perl :exports code
print "foo\n";
#+END_SRC

which would generate this html:

#+BEGIN_SRC html
<div class="org-src-container">
<label class="org-src-name">foo/bar.pl</label>
<pre class="src src-perl"><span style="color: #458b00;">print</span> <span style="color: #006400;">"foo\n"</span>;
</pre>
</div>
#+END_SRC

I don't see a way to get the `:tangle' keyword during export, as the
parser does not include that in list passed to the src-block export
function.


rick



reply via email to

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