emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Template org files, org-babel.
@ 2010-02-04  2:38 Richard Riley
  2010-02-04 17:08 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Riley @ 2010-02-04  2:38 UTC (permalink / raw)
  To: emacs-orgmode


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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Template org files, org-babel.
  2010-02-04  2:38 Template org files, org-babel Richard Riley
@ 2010-02-04 17:08 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2010-02-04 17:08 UTC (permalink / raw)
  To: Richard Riley; +Cc: emacs-orgmode

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-04 17:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-04  2:38 Template org files, org-babel Richard Riley
2010-02-04 17:08 ` Eric Schulte

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).