Re: [Orgmode] Re: Is there a good way to use org as blog system?
2009/11/11 Ben Finney ben+em...@benfinney.id.au: Rick Moynihan rick.moyni...@gmail.com writes: I'm looking for an org-mode based static blogging solution that's more robust than blorg […] Writing an online journal from Org mode is on my list of things to do, but I haven't got around to investigating ‘blorg’. What about it is insufficiently robust? The primary problems I have experienced are that it is has some rather serious problems unresolved problems with html export, specifically link generation. Everything seems ok with org-mode links rendered correctly as HTML, but then non-deterministically an export from what as far as I can tell is the same state as before results in broken links with them rendered in the html org-mode style, i.e. [[foo][http://foobar.com/]]. It is also currently without a maintainer as Bastien believes it needs a complete rewrite to use org-publish... IIRC. I did spend a short while trying to debug the link generation issue, but never got to the bottom of it, as I'm largely unfamiliar with elisp. R. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Is there a good way to use org as blog system?
Manoj Srivastava wrote: On Wed, Sep 30 2009, Water Lin wrote: I want to mantain a local static html blog system on my local computer. I think org is good enough to organise the stuff. Is there any special function for me to use org as blog system? I need a reference to start.. With the following Ikiwiki plugin, I have been using org as my Ikiwiki input mechanism (so I write all my blog posts as org-mode files, and Ikiwiki transforms tehm into html and rss. manoj --8---cut here---start-8--- #!/usr/bin/perl # File: org.pm # Time-stamp: 2009-02-06 12:10:28 srivasta # # Copyright (C) 2008 by Manoj Srivastava # # Author: Manoj Srivastava # # Description: # This allows people to write Ikiwiki content using Emacs and org-mode # (requires Emacs 23), and uses the html export facility of org-mode to # create the output. Some bits based on otl.pm. package IkiWiki::Plugin::org; use warnings; use strict; use Carp; use IkiWiki 3.00; use File::Temp qw/ tempfile tempdir /; # sub import { hook(type = getsetup, id = org, call = \getsetup); hook(type = htmlize, id = org, call = \htmlize); } # sub getsetup () { return plugin = { safe = 0, rebuild = undef, advanced = 1, }, emacs_binary = { type = string, example = /usr/bin/emacs-snapshot, description = location of an emacs binary with org-mode, advanced = 1, safe = 0, rebuild = undef, }, } sub htmlize (@) { my %params = @_; my $dir = File::Temp-newdir(); my $ret = open(INPUT, $dir/contents.org); unless (defined $ret) { debug(failed to open $dir/contents.org: $@); return $params{content}; } my $emacs = '/usr/bin/emacs-snapshot'; if (exists $config{emacs_binary} -x $config{emacs_binary}) { $emacs = $config{emacs_binary}; } print INPUT $params{content}; close INPUT; $ret = open(INPUT, /tmp/contents.org); print INPUT $params{content}; close INPUT; my $args = $emacs --batch -l org . --eval '(setq org-export-headline-levels 3 org-export-with-toc nil org-export-author-info nil )' . --visit=$dir/contents.org . '--funcall org-export-as-html-batch /dev/null 21'; if (system($args)) { debug(failed to convert $params{page}: $@); return $params{content}; } $ret = open(OUTPUT, $dir/contents.html); unless (defined $ret) { debug(failed find html output for $params{page}: $@); return $params{content}; } local $/ = undef; $ret = OUTPUT; close OUTPUT; $ret=~s/(.*h1 class=title){1}?//s; $ret=~s/^(.*\/h1){1}?//s; $ret=~s/div id=postamble.*//s; $ret=~s/(\/div\s*$)//s; open(OUTPUT, /tmp/contents.html); print OUTPUT $ret; close OUTPUT; return $ret; } # 1; # modules have to return a true value --8---cut here---end---8--- Thanks for this great plugin. I had a couple of problems with UTF8 encodings not working. I have patched the plugin to fix this (code below). Warning I am not a Perl programmer, don't blame me if the patch eats your blog:) Ian. #!/usr/bin/perl # File: org.pm # Time-stamp: 2009-02-06 12:10:28 srivasta # # Copyright (C) 2008 by Manoj Srivastava # # Author: Manoj Srivastava # # Description: # This allows people to write Ikiwiki content using Emacs and org-mode # (requires Emacs 23), and uses the html export facility of org-mode to # create the output. Some bits based on otl.pm. # 2009-11-10 Patch by Ian Barton to fix some Unicode problems. package IkiWiki::Plugin::org; use warnings; use strict; use Carp; use IkiWiki 3.00; use File::Temp qw/ tempfile tempdir /; # sub import { hook(type = getsetup, id = org, call = \getsetup); hook(type = htmlize, id = org, call = \htmlize); } # sub getsetup () { return plugin = { safe = 0, rebuild = undef, advanced = 1, }, emacs_binary = { type = string, example = /usr/bin/emacs-snapshot, description = location of an emacs binary with org-mode, advanced = 1, safe = 0, rebuild = undef, }, } sub htmlize (@) { my %params = @_; my $dir = File::Temp-newdir(); my $ret = open(INPUT, $dir/contents.org); binmode (INPUT, :utf8); unless (defined $ret) { debug(failed to open $dir/contents.org: $@); return $params{content}; } my $emacs = '/usr/bin/emacs-snapshot'; if (exists $config{emacs_binary} -x $config{emacs_binary}) { $emacs =
[Orgmode] Re: Is there a good way to use org as blog system?
On Tue, Nov 10 2009, Ian Barton wrote: Manoj Srivastava wrote: On Wed, Sep 30 2009, Water Lin wrote: I want to mantain a local static html blog system on my local computer. I think org is good enough to organise the stuff. Is there any special function for me to use org as blog system? I need a reference to start.. With the following Ikiwiki plugin, I have been using org as my Ikiwiki input mechanism (so I write all my blog posts as org-mode files, and Ikiwiki transforms tehm into html and rss. manoj Thanks for this great plugin. I had a couple of problems with UTF8 encodings not working. I have patched the plugin to fix this (code below). Warning I am not a Perl programmer, don't blame me if the patch eats your blog:) Thanks for the patch. I have applied it, with one minor tweak: I used binmode (OUTPUT, :encoding(utf8)); for the output streams, so that the perl strings are actually checked for correct encoding. I'll send the (rebased) branch upstream, and see if it sticks this time (since emacs 23 has entered Debian) manoj -- Majorities, of course, start with minorities. Robert Moses Manoj Srivastava sriva...@acm.org http://www.golden-gryphon.com/ 1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Is there a good way to use org as blog system?
On Thu, Oct 1, 2009 at 7:13 AM, Eric Schulte schulte.e...@gmail.com wrote: I started down this path some months ago and generated the following as a sort of tentative exploration http://github.com/eschulte/simple-server which makes use of http://www.emacswiki.org/emacs/EmacsEchoServer and httpd.el at http://emarsden.chez.com/downloads/ It is certainly possible to go further... Thanks Eric. We will try to use them and get back to you. it is currently possible to hand single elisp statements to Emacs in batch mode, however startup time (starting Emacs, loading all elisp files, and implementing any .emacs customization) is an issue. To the best of my knowledge there is nothing like an elisp REPL currently implemented, although it would be possible and there has been scattered discussion on this topic yes, using batchmode will have high latency. I will give a serious attempt to further this line of work. It is useful for us. -- Nagarjuna G. http://www.gnowledge.org/ ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Is there a good way to use org as blog system?
On Wed, Sep 30 2009, Water Lin wrote: I want to mantain a local static html blog system on my local computer. I think org is good enough to organise the stuff. Is there any special function for me to use org as blog system? I need a reference to start.. With the following Ikiwiki plugin, I have been using org as my Ikiwiki input mechanism (so I write all my blog posts as org-mode files, and Ikiwiki transforms tehm into html and rss. manoj --8---cut here---start-8--- #!/usr/bin/perl # File: org.pm # Time-stamp: 2009-02-06 12:10:28 srivasta # # Copyright (C) 2008 by Manoj Srivastava # # Author: Manoj Srivastava # # Description: # This allows people to write Ikiwiki content using Emacs and org-mode # (requires Emacs 23), and uses the html export facility of org-mode to # create the output. Some bits based on otl.pm. package IkiWiki::Plugin::org; use warnings; use strict; use Carp; use IkiWiki 3.00; use File::Temp qw/ tempfile tempdir /; # sub import { hook(type = getsetup, id = org, call = \getsetup); hook(type = htmlize, id = org, call = \htmlize); } # sub getsetup () { return plugin = { safe = 0, rebuild = undef, advanced = 1, }, emacs_binary = { type = string, example = /usr/bin/emacs-snapshot, description = location of an emacs binary with org-mode, advanced = 1, safe = 0, rebuild = undef, }, } sub htmlize (@) { my %params = @_; my $dir = File::Temp-newdir(); my $ret = open(INPUT, $dir/contents.org); unless (defined $ret) { debug(failed to open $dir/contents.org: $@); return $params{content}; } my $emacs = '/usr/bin/emacs-snapshot'; if (exists $config{emacs_binary} -x $config{emacs_binary}) { $emacs = $config{emacs_binary}; } print INPUT $params{content}; close INPUT; $ret = open(INPUT, /tmp/contents.org); print INPUT $params{content}; close INPUT; my $args = $emacs --batch -l org . --eval '(setq org-export-headline-levels 3 org-export-with-toc nil org-export-author-info nil )' . --visit=$dir/contents.org . '--funcall org-export-as-html-batch /dev/null 21'; if (system($args)) { debug(failed to convert $params{page}: $@); return $params{content}; } $ret = open(OUTPUT, $dir/contents.html); unless (defined $ret) { debug(failed find html output for $params{page}: $@); return $params{content}; } local $/ = undef; $ret = OUTPUT; close OUTPUT; $ret=~s/(.*h1 class=title){1}?//s; $ret=~s/^(.*\/h1){1}?//s; $ret=~s/div id=postamble.*//s; $ret=~s/(\/div\s*$)//s; open(OUTPUT, /tmp/contents.html); print OUTPUT $ret; close OUTPUT; return $ret; } # 1; # modules have to return a true value --8---cut here---end---8--- -- UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity. -Dennis Ritchie Manoj Srivastava sriva...@acm.org http://www.golden-gryphon.com/ 1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Is there a good way to use org as blog system?
Hi, Water. Water Lin water...@ymail.com writes: I want to mantain a local static html blog system on my local computer. I think org is good enough to organise the stuff. Is there any special function for me to use org as blog system? Take a look at worg; it'll do ya: http://orgmode.org/worg/worg-about.php - Bob ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Is there a good way to use org as blog system?
org offers multiple ways of solving problems. worg, blorg, and Manoj's perl script, and I am sure there will be others. I am now thinking on the following idea: Using the new features (babel) added in the fresh release of org, it is indeed possible to provide a minor mode in gnowsys-mode (see the other thread posted on 30th October) to publish the notes with relations and attributes (tagging, categorizing) etc. in Plone (gnowsys currently uses Zope/Plone for webservices). It is high time that we should work on a emacs-engine (as a webservice) that performs elisp functions so that several of the org functions can be used independently. This will proliferate org's use beyond imagination. Doesn't such an emacs-engine already exist? Couldn't we use emacs in batchmode to achieve this? Any guidance is welcome. Nagarjuna ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Is there a good way to use org as blog system?
Nagarjuna G. nagar...@gnowledge.org writes: org offers multiple ways of solving problems. worg, blorg, and Manoj's perl script, and I am sure there will be others. I am now thinking on the following idea: Using the new features (babel) added in the fresh release of org, it is indeed possible to provide a minor mode in gnowsys-mode (see the other thread posted on 30th October) to publish the notes with relations and attributes (tagging, categorizing) etc. in Plone (gnowsys currently uses Zope/Plone for webservices). It is high time that we should work on a emacs-engine (as a webservice) that performs elisp functions so that several of the org functions can be used independently. This will proliferate org's use beyond imagination. I started down this path some months ago and generated the following as a sort of tentative exploration http://github.com/eschulte/simple-server which makes use of http://www.emacswiki.org/emacs/EmacsEchoServer and httpd.el at http://emarsden.chez.com/downloads/ It is certainly possible to go further... Doesn't such an emacs-engine already exist? Couldn't we use emacs in batchmode to achieve this? Any guidance is welcome. it is currently possible to hand single elisp statements to Emacs in batch mode, however startup time (starting Emacs, loading all elisp files, and implementing any .emacs customization) is an issue. To the best of my knowledge there is nothing like an elisp REPL currently implemented, although it would be possible and there has been scattered discussion on this topic Best -- Eric ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode