From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: templating with Org? Date: Sat, 08 Aug 2015 12:48:01 +0800 Message-ID: <8737zumlmm.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNw3N-000205-CM for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 00:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNw3I-00071H-CM for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 00:48:17 -0400 Received: from plane.gmane.org ([80.91.229.3]:51893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNw3I-0006zj-4h for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 00:48:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZNw3G-0008Ca-6s for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 06:48:10 +0200 Received: from 222.128.163.139 ([222.128.163.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 06:48:10 +0200 Received: from eric by 222.128.163.139 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Aug 2015 06:48:10 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Exporting org files and subtrees is awfully flexible, given all the possible customizations, but for a long while I've occasionally felt the need to come at the "export" process from the other direction: instead of customizing the export appearance of a series of headings, instead starting with a common block of export text, and interpolating values 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 the information about the events in a single place, otherwise I know that 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 up (and switching between) export filters in a way that wouldn't make me cry. Not to mention that the different "export" use-cases all have their own per-heading boilerplate text, and there's no way I'm going to repeat all that different boilerplate under each heading. Obviously there's many ways this could be done. I could somehow hijack 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? Any thoughts or suggestions would be much appreciated! Yours, Eric