emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rick Frankel <rick@rickster.com>
To: Avdi Grimm <avdi@avdi.org>
Cc: emacs-orgmode Org-Mode <emacs-orgmode@gnu.org>
Subject: Re: Need info about code block header arguments in (HTML) export
Date: Tue, 12 Aug 2014 11:43:36 -0400	[thread overview]
Message-ID: <11915c05b36aa2470acae70599b415bb@mail.rickster.com> (raw)
In-Reply-To: <CA+XG7-hpQ_mit9TV0q3vM+x_oK7KNwWhDAP7cBxOnCyOuCbG0w@mail.gmail.com>

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	other threads:[~2014-08-12 15:43 UTC|newest]

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

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=11915c05b36aa2470acae70599b415bb@mail.rickster.com \
    --to=rick@rickster.com \
    --cc=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).