emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Karl Voit <devnull@Karl-Voit.at>
To: emacs-orgmode@gnu.org
Subject: Using Org-mode file format for storing configuration data
Date: Sun, 30 Dec 2012 19:04:25 +0100	[thread overview]
Message-ID: <2012-12-30T18-55-46@devnull.Karl-Voit.at> (raw)

Hi!

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]

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

- why not using elisp-methods like "setq" or "defvar" or "defcustom"?
  - this weblog will be implemented in Python
  - Sorry, I do not have any elisp knowledge and it seems to be the
    case that this is not going to change within the next months.
  - In Python I have to parse a basic sub-set of Org-mode format
    anyhow. An additional parser would be more work to do.
  - Why not using Org-mode for end-user configuration as well?
    - It's more user-friendly for non elisp users like me.

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

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.


* Configuring Paths (in Drawers)
:PROPERTIES:
:COLUMNS:  %25ITEM %PATH
:END:

- advantages
  - usage of column view
  - easy to add comments for each setting
- disadvantages
  - Properties have to be the same
    - not that flexible in naming Properties

- possible name for property "VALUE" which makes it more general.

** Image-Path
:PROPERTIES:
:PATH: ~/images
:END:

In this folder, the Web log image files are placed after being
processed (resizing, ...).

** HTML-Path
:PROPERTIES:
:PATH: ~/blog/html
:END:



* Configuring Paths (in Tables)

| *Variable*      | *Value*       | *Comments*                                          |
|-----------------+---------------+-----------------------------------------------------|
| Image Path      | ~/images      | The path where the images should be placed in.      |
| HTML Path       | ~/blog/html   | Destination path for the HTML file folder structure |
| Another Setting | another value | This has to be very short.                          |

- advantages
  - easy to write and maintain
  - quick overview
- disadvantages
  - hard to add (long) comments for each setting



* Configuring Paths (with Tags)

- advantages
  - same settings can be shared through multiple tags on same value
  - easy to add comments for each setting
- disadvantages
  - seems strange at first glance; not sure if this really makes any
    sense at all
  - multiple word preference name has to be written in CamelCase or
    separated with dashes

** ~/images                                          :ImagePath:

** ~/blog/html                                        :HtmlPath:



  1. http://article.gmane.org/gmane.emacs.orgmode/49747/
-- 
Karl Voit

             reply	other threads:[~2012-12-30 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30 18:04 Karl Voit [this message]
2012-12-31 10:15 ` Using Org-mode file format for storing configuration data 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 ` Using Org-mode file format for storing configuration data Daniel Clemente
2013-01-02  9:43   ` 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=2012-12-30T18-55-46@devnull.Karl-Voit.at \
    --to=devnull@karl-voit.at \
    --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).