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>

    <pre class="src src-ruby">puts <span class="org-string">"Hello,
world"</span>
    </pre>
    </div>

However, I already do a lot of post-processing on the exported HTML, so I'm
thinking that a simpler, more general solution would be sufficient:

    <div class="org-src-container" data-org-header-args="ruby :tangle
foo/bar.rb">

    <pre class="src src-ruby">puts <span class="org-string">"Hello,
world"</span>
    </pre>
    </div>

As you can see, in this version the header arguments are inserted,
unchanged, into a new data-org-header-args attribute. This would give me
enough information to munge the final HTML into the form I need.

So my question is: can anyone give me pointers on how to accomplish this?
Thanks!
-- 
Avdi Grimm
http://avdi.org

Reply via email to