emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: news1142@Karl-Voit.at
Cc: emacs-orgmode@gnu.org
Subject: Re: Using Org-mode file format for storing configuration data
Date: Wed, 02 Jan 2013 03:03:19 +0100	[thread overview]
Message-ID: <87licc1guw.wl%n142857@gmail.com> (raw)
In-Reply-To: <2012-12-30T18-55-46@devnull.Karl-Voit.at>

El Sun, 30 Dec 2012 19:04:25 +0100 Karl Voit va escriure:
> 
> I plan to implement a new weblog system that parses Org-mode files
> and generates (static) HTML output. Yes, I am aware that there are
> other solutions out there but I do not like them for various
> reasons.[1]

  Nice! I also don't like existing solutions and I was thinking on writing some Python to do the export. But the complexities of exporting are so well resolved in elisp that it's much easier to invoke elisp code than to write your own in Python.


> 
> So for my new system, I am thinking of using Org-mode files for
> writing (and parsing) the user-defined preferences.

  I happened to be thinking the same two days ago. I wanted a place for scripts to store data as key→value pairs: e.g. configurations, or observations (like: file count on ~). Normally I would use lots of small hidden files for that. Now I wanted a central registry.
  I thought of using some cache server, or a small NoSQL database, or a system monitor for observations (e.g. collectd), and of course, org-mode. In the end, I think I will stay with the many small files; it's much easier!
  

>   - In Python I have to parse a basic sub-set of Org-mode format
>     anyhow. An additional parser would be more work to do.

  Don't do it from scratch; there are already some parsers which work. I tried: https://github.com/bjonnh/PyOrgMode


> - Possible methods to store configuration/settings of a weblog system
>   that scans Org-mode files to generate HTML:
>   - in drawers: see below
>   - in tables: see below
>   - in tags: see below
>   - other possibilities?
> 
   From the ones you say, I prefer property drawers. It's the most DB-like and it's analogous to storing data (well, strings).
   You don't need all the table benefits (reordering, exporting, formatting, formulae, …).
   Nor the tags benefits (search, multiple tags, …)


> What do you think of this?
> Can you imagine a better way of storing key-value-pairs in Org-mode?
> 
> My focus is user friendly maintenance and overview including in-line
> documentation of the preferences.

  Of course, storing configuration in .org is very utopic (being all .org), but I would prefer *not* to do it. I would use a simple ~/.file.conf with some variables in the usual style:

# a comment
path=~/web/
# where to export images
images=~/web/images


  I think this wins for usability and „friendly maintenance“, since people know it and it works. And it allows you to define many projects (e.g. check the configuration file for the program unison).

  There are even libraries to parse these simple files: http://docs.python.org/2/library/configparser.html

  And if you want to design an equivalent grammar for configuration files (beware! that's another adventure!), check http://augeas.net/ . It can manipulate configuration files in a format-agnostic way.


  But I think it's more important to center efforts in developing a good exporter web publisher. As you said, the current ones are not powerful enough.

  Good luck.

  parent reply	other threads:[~2013-01-02  2:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30 18:04 Using Org-mode file format for storing configuration data Karl Voit
2012-12-31 10:15 ` Bastien
2012-12-31 10:34   ` Org to RSS (was: Using Org-mode file format for storing configuration data) Karl Voit
2013-01-02  2:03 ` Daniel Clemente [this message]
2013-01-02  9:43   ` Using Org-mode file format for storing configuration data Karl Voit

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=87licc1guw.wl%n142857@gmail.com \
    --to=n142857@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=news1142@Karl-Voit.at \
    /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).