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