emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Richard Riley <rileyrgdev@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Template org files, org-babel.
Date: Thu, 04 Feb 2010 10:08:31 -0700	[thread overview]
Message-ID: <87mxzpudww.fsf@gmail.com> (raw)
In-Reply-To: <hkdbv4$1ph$1@ger.gmane.org> (Richard Riley's message of "Thu, 04 Feb 2010 03:38:27 +0100")

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

Hi Richard,

That's an interesting idea.  I know that Tom Dye has done something very
similar with LaTeX templates, see [1] for an example.

Given that babel supports output of raw Org-mode text, it shouldn't be
overly difficult to define templates in your favorite scripting language
and either write the results to new files, or dump the results into the
current org-mode file.  Here a small example I've worked up, I wonder
how close it comes to what you had envisaged?


[-- Attachment #2: template.org --]
[-- Type: application/octet-stream, Size: 577 bytes --]


An example of using templates

* tasks
  DEADLINE: <2010-02-04 Thu>

You can change the values in the following table and the use the
=template= source-code block to create new subtasks.

#+tblname: template-data
| name     | example subtask  |
| due date | <2010-02-11 Thu> |
| note     | simple example   |

#+begin_src emacs-lisp :var data=template-data :results org
  (format
  "** %s
     DEADLINE: %s
  %s
  "
  (second (first data))
  (second (second data))
  (second (third data)))
#+end_src

#+results:
** example subtask
   DEADLINE: <2010-02-11 Thu>
simple example

[-- Attachment #3: Type: text/plain, Size: 1188 bytes --]


I'll have to take a look at xiki.

Cheers -- Eric

Richard Riley <rileyrgdev@gmail.com> writes:

> What are the possibilities for auto creating an org file based on a
> template so that all todo items are auto scheduled based on an arbitrary
> start date? Or would this be strictly a job for sed/awk or something?
>
> Having just seen a screencast of xiki,
> http://xiki.org/screencasts/web_development.html, I got to thinking of a
> template workflow with the org-babel being used to perform steps e.g
> create myql db, add user, update hosts file, etc etc etc. It would be
> nice if that template flow could somehow inherit/prompt for init
> parameters used throughout e.g start date, webname etc. Any ideas or
> pointers in the right direction welcome. Hope that makes some sense. An
> example of babel snippets setting/retrieving and sharing values between
> them would be great. Possible?
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  http://orgmode.org/worg/org-contrib/babel/uses.php#sec-3


[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

      reply	other threads:[~2010-02-04 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04  2:38 Template org files, org-babel Richard Riley
2010-02-04 17:08 ` Eric Schulte [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=87mxzpudww.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rileyrgdev@gmail.com \
    /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).