[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] org-publish with latest changes?
From: |
David Maus |
Subject: |
Re: [Orgmode] org-publish with latest changes? |
Date: |
Sun, 17 Oct 2010 18:09:53 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Wed, 13 Oct 2010 10:54:01 +0200,
Guy Wiener wrote:
> Hello everyone,
> I am using org-publish to publish some document on my web page. I would
> really like to add to that some notification of the latest changes - E.g.,
> an RSS of the recently changed headlines. Is there some way to hack that? I
> can use diff and get the textual changes from the latest version, but I
> think that some way to mark the headlines whose content has changed will be
> better.
>
> Any ideas?
For publishing news about changed headlines you might use the
still-prepared-for-inclusion-damn-i-am-late-with-the-documentation Org
to Atom exporter[1]. It uses a property called :atom_updated: that is
used for the atom:updated element which indicates ... an update.
The somewhat tricky part is how to determine whether an entry has
changed or not. Maybe something like this:
- define the things that count as a changed entry (e.g. entry title,
text, scheduled date, keyword)
- write a function that grabs these things, does some normalization
(e.g. remove whitespace and control characters, remove text
properties), concat them together, and calculate a sha1 checksum
for the resulting string
- compare this sha1 with the previus sha1 which is stored in a define
property
- if the hashes differ, store the new one and update the atom_updated
property
- hook this function in the exporter, maybe via
`org-export-first-hook'
Best,
-- David
[1] http://ictsoc.de/code/org-atom.html
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpEZhW4SZsZK.pgp
Description: PGP signature