[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] templating with Org?
Re: [O] templating with Org?
Mon, 10 Aug 2015 08:01:44 -0400
In reviewing these, I discovered I reinvented (and probably not as
well!) the function s-format from s.el
(https://github.com/magnars/s.el). It might be another option for you.
Eric Abrahamsen writes:
> John Kitchin <address@hidden> writes:
>> I don't have the impression you would need to hijack the export
>> process. It seems like you would need to call a function that gets
>> data from some source (e.g the org document) and then populates a
>> template with that data, and once that is done, call a regular export
>> function. There are a number of template solutions:
>> http://www.emacswiki.org/emacs/CategoryTemplates. I am not sure these
>> are too easy to adapt to what you describe.
> That's an interesting idea: going from the base Org file to a massaged
> Org buffer, and then exporting that. I'll try that out for a bit. Thanks
> for that, and for the links!
>> I played around with some ideas for this here:
>> Something like these could be used to populate a template I think.
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> On Sat, Aug 8, 2015 at 12:48 AM, Eric Abrahamsen
>> <address@hidden> wrote:
>> Exporting org files and subtrees is awfully flexible, given all
>> possible customizations, but for a long while I've occasionally
>> felt the
>> need to come at the "export" process from the other direction:
>> of customizing the export appearance of a series of headings,
>> starting with a common block of export text, and interpolating
>> from the headings into that text -- ie, templating.
>> I've felt this need off and on for a couple of years, most
>> recently when
>> organizing a small literary festival. I really need to keep all
>> information about the events in a single place, otherwise I know
>> information will go stale right away. But I need the information
>> in a
>> series of such wildly-varying formats that I can't imagine setting
>> (and switching between) export filters in a way that wouldn't make
>> cry. Not to mention that the different "export" use-cases all have
>> own per-heading boilerplate text, and there's no way I'm going to
>> all that different boilerplate under each heading.
>> Obviously there's many ways this could be done. I could somehow
>> the export process -- in many cases it would be nice too make use
>> of the
>> skeleton document structures that export provides.
>> Or maybe dynamic blocks? I've never used them before. Or maybe
>> just a
>> plain old `org-map-entries', which reads the template text from an
>> external file and then steals some of the macro expansion
>> functions to
>> fill out the values.
>> Has anyone wanted to do this before? Has anyone actually done it?
>> thoughts or suggestions would be much appreciated!
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213