emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: example filter for code blocks?
Date: Fri, 27 Sep 2013 14:44:40 -0400	[thread overview]
Message-ID: <CAJ51ETqghwLoF7YpXNAxhfaXdmFgYOu8rQ8aG6F=w7ATs5YWSw@mail.gmail.com> (raw)

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

That is a pretty interesting pdf. I cannot think of a way to do this
simply. I think that filters get an info argument, which contains the parse
tree. Maybe you could use that to build up a table of which blocks refer to
each other somehow. I guess you would need some syntax in the src-block to
indicate which blocks were referred to. then, use filters to modify the
output of the rendered src-block by inserting the links in.

From: "Sebastien Vauban" <sva-news@mygooglest.com>
To: emacs-orgmode@gnu.org
Cc:
Date: Fri, 27 Sep 2013 09:42:39 +0200
Subject: Re: [O] example filter for code blocks?
Hello,

John Kitchin wrote:
> Thanks for  the tips in using export filters for code blocks. I thought I
> would share my current solution. The goal was to export all the code
blocks
> in an org-file to files systematically named part1/script-%d.py where %d
is
> a number. I didnot want to tangle exactly, because I wanted to avoid
naming
> the code block tangle files.
>
> Then, I wanted to insert a pdf link that would open the file, after the
> syntax highlighted code.

Thanks for sharing your wonderful solution!

Related to such things, something I'd like to have for long (but never found
time investigating it more) is that the PDF produced by Org would resemble
more
the PDF produced by Noweb.

In the attached example file (sent on this ML in... 2009), you see that the
Noweb extension to LaTeX

- generated a code block number: page number + order (if there are multiple
  code blocks on the same page);

- for each code block, attached a reference to all code blocks using it.

In the example, you see that code block "sql-init.sql" (defined on page 2)
gets
the number 2a (in that export [1]), and is used in code blocks 2c and 3. And
all those references are hyperlinks.

I found that very handy for reading your LP (or RR) document.

Best regards,
  Seb

[1] It could change if text or code is added in the documentation.

--
Sebastien Vauban
John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

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

             reply	other threads:[~2013-09-27 18:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 18:44 John Kitchin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-27 12:59 example filter for code blocks? John Kitchin
2013-09-27 15:24 ` Alan Schmitt
2013-09-27 15:34   ` John Kitchin
2013-09-30  7:49     ` Alan Schmitt
2013-09-26 17:57 John Kitchin
2013-09-26 19:43 ` Thomas S. Dye
2013-09-26 19:48   ` John Kitchin
2013-09-26 20:58     ` Thomas S. Dye
2013-09-27  7:42 ` Sebastien Vauban
2013-09-30  0:33 ` Thomas S. Dye
2013-09-30  0:45   ` John Kitchin
2013-09-30  2:58     ` Thomas S. Dye
2013-09-30  7:34     ` Achim Gratz
2013-09-30 17:48       ` Thomas S. Dye
2013-09-26  0:03 John Kitchin
2013-09-26  8:40 ` Daniele Pizzolli
2013-09-26  9:04 ` Marcin Borkowski
2013-09-26 12:18 ` Eric Schulte
2013-09-26 18:31   ` Cook, Malcolm
2013-09-26 19:34     ` John Kitchin

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='CAJ51ETqghwLoF7YpXNAxhfaXdmFgYOu8rQ8aG6F=w7ATs5YWSw@mail.gmail.com' \
    --to=jkitchin@andrew.cmu.edu \
    --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).