emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Avdi Grimm <avdi@avdi.org>
To: emacs-orgmode Org-Mode <emacs-orgmode@gnu.org>
Subject: Need info about code block header arguments in (HTML) export
Date: Mon, 11 Aug 2014 10:58:16 -0400	[thread overview]
Message-ID: <CA+XG7-hpQ_mit9TV0q3vM+x_oK7KNwWhDAP7cBxOnCyOuCbG0w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1903 bytes --]

             reply	other threads:[~2014-08-11 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 14:58 Avdi Grimm [this message]
2014-08-12 15:43 ` Need info about code block header arguments in (HTML) export Rick Frankel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+XG7-hpQ_mit9TV0q3vM+x_oK7KNwWhDAP7cBxOnCyOuCbG0w@mail.gmail.com \
    --to=avdi@avdi.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).