emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Introducing Octopress Exporter
@ 2012-08-01 23:21 Tom Alexander
  2012-08-02  9:45 ` Aurélien Aptel
  2012-08-03  7:15 ` Introducing Octopress Exporter Bastien
  0 siblings, 2 replies; 23+ messages in thread
From: Tom Alexander @ 2012-08-01 23:21 UTC (permalink / raw)
  To: emacs-orgmode

I recently started using Octopress since its a great platform for
programmers to blog. Since the posts are written in HTML, it was easy
to use Org-Mode but once I got to code blocks I noticed that there was
no highlighting. I decided to modify the HTML exporter so that code
blocks were exported in the format described at
http://octopress.org/docs/plugins/codeblock/ . My new exporter is
located on github at https://github.com/craftkiller/orgmode-octopress
and I welcome anyone to help improve it (for example, right now the
body-only tag seems to fail since a table of contents gets exported).
The important changes are all at the bottom of the file. Basically I
just grab the text before the html preprocessor gets to it and go
through line-by-line to find the code blocks.

I wrote some information of setting this up so you can blog with
org-mode at http://blog.paphus.com/blog/2012/08/01/introducing-octopress-blogging-for-org-mode/
.

Thank you guys for all that you do! Org-mode has made my life
significantly easier. Heres hoping this makes some blogger's life
easier.

-- 
Tom Alexander
HS - Secretary
Alpha Sigma Phi; Beta Psi Chapter
Rensselaer Polytechnic Institute
Class of 2013

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

* Re: Introducing Octopress Exporter
  2012-08-01 23:21 Introducing Octopress Exporter Tom Alexander
@ 2012-08-02  9:45 ` Aurélien Aptel
  2012-08-02 13:44   ` Tom Alexander
                     ` (2 more replies)
  2012-08-03  7:15 ` Introducing Octopress Exporter Bastien
  1 sibling, 3 replies; 23+ messages in thread
From: Aurélien Aptel @ 2012-08-02  9:45 UTC (permalink / raw)
  To: Tom Alexander; +Cc: emacs-orgmode

I've never heard of octopress, interesting. The only thing I don't
like is how comments are handled. Since it's all static you relying on
an external service like Disqus. I'm not so fond of losing control
over user contribution like that. Besides, the actual service (disqus)
is pretty terrible anyway. I'm always pissed when the comment I sent
gets processed in weird ways yet doesn't do verbatim/code blocks.

On Thu, Aug 2, 2012 at 1:21 AM, Tom Alexander <tomalexander@paphus.com> wrote:
> The important changes are all at the bottom of the file. Basically I
> just grab the text before the html preprocessor gets to it and go
> through line-by-line to find the code blocks.

Have you tried Nicolas Goaziou new parser? org-element.el is a big
improvement for org-mode IMHO.

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

* Re: Introducing Octopress Exporter
  2012-08-02  9:45 ` Aurélien Aptel
@ 2012-08-02 13:44   ` Tom Alexander
  2012-08-02 14:37   ` Jambunathan K
  2012-08-06 22:28   ` Neil Smithline
  2 siblings, 0 replies; 23+ messages in thread
From: Tom Alexander @ 2012-08-02 13:44 UTC (permalink / raw)
  To: emacs-orgmode

Aurélien Aptel <aurelien.aptel <at> gmail.com> writes:

> 
> I've never heard of octopress, interesting. The only thing I don't
> like is how comments are handled. Since it's all static you relying on
> an external service like Disqus. I'm not so fond of losing control
> over user contribution like that. Besides, the actual service (disqus)
> is pretty terrible anyway. I'm always pissed when the comment I sent
> gets processed in weird ways yet doesn't do verbatim/code blocks.
> 
> On Thu, Aug 2, 2012 at 1:21 AM, Tom Alexander <tomalexander <at> paphus.com> 
wrote:
> > The important changes are all at the bottom of the file. Basically I
> > just grab the text before the html preprocessor gets to it and go
> > through line-by-line to find the code blocks.
> 
> Have you tried Nicolas Goaziou new parser? org-element.el is a big
> improvement for org-mode IMHO.
> 
> 

Yeah, the whole Disqus comments thing can be a pain, but since the pages are all 
static its a lot easier on your web server and possibly faster since you don't 
have a server side language rendering the page. Also, having the posts written 
mostly in plain HTML (with some special markup for the header and code blocks) 
its easy for anyone who has written HTML to pick it up, and even easier to use 
other tools like org-mode to post to it.

In terms of org-element, I did look at it when I was writing this, and it looks 
significantly better, but I was getting errors loading org-mode from the 
repository at the time. After writing this I learned that apparently master is 
the development branch for this project, not the stable branch. I might re-write 
this for the new exporter later since I'm sure the old exporter is on its way 
out.

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

* Re: Introducing Octopress Exporter
  2012-08-02  9:45 ` Aurélien Aptel
  2012-08-02 13:44   ` Tom Alexander
@ 2012-08-02 14:37   ` Jambunathan K
  2012-08-06 22:28   ` Neil Smithline
  2 siblings, 0 replies; 23+ messages in thread
From: Jambunathan K @ 2012-08-02 14:37 UTC (permalink / raw)
  To: Aurélien Aptel; +Cc: emacs-orgmode, Tom Alexander

Aurélien Aptel <aurelien.aptel@gmail.com> writes:

> Since it's all static you relying on an external service like
> Disqus. I'm not so fond of losing control over user contribution like
> that. Besides, the actual service (disqus) is pretty terrible
> anyway. I'm always pissed when the comment I sent gets processed in
> weird ways yet doesn't do verbatim/code blocks.

If the person making the post is paying himself for hosting his website
and if the hosting provider charges a price for dynamic pages (cgi/php)
then the person could be unwilling to shoulder additional charges.  This
is particularly so if the person has no commercial interest but only
plain colloboration interest.

Comments and spam are a pain.  Just look at how WikEmacs is getting
spammed everday.
-- 

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

* Re: Introducing Octopress Exporter
  2012-08-01 23:21 Introducing Octopress Exporter Tom Alexander
  2012-08-02  9:45 ` Aurélien Aptel
@ 2012-08-03  7:15 ` Bastien
  1 sibling, 0 replies; 23+ messages in thread
From: Bastien @ 2012-08-03  7:15 UTC (permalink / raw)
  To: Tom Alexander; +Cc: emacs-orgmode

Hi Tom,

Tom Alexander <tomalexander@paphus.com> writes:

> I recently started using Octopress since its a great platform for
> programmers to blog. Since the posts are written in HTML, it was easy
> to use Org-Mode but once I got to code blocks I noticed that there was
> no highlighting. I decided to modify the HTML exporter so that code
> blocks were exported in the format described at
> http://octopress.org/docs/plugins/codeblock/ . My new exporter is
> located on github at https://github.com/craftkiller/orgmode-octopress
> and I welcome anyone to help improve it (for example, right now the
> body-only tag seems to fail since a table of contents gets exported).

Thanks for this -- I don't use Octopress, but I found a mention of it in
Worg here:

  http://orgmode.org/worg/org-blog-wiki.html

Did you check
http://jaderholm.com/blog/blogging-with-org-mode-and-octopress ?

Anyway, I added a note about your exporter in the Worg page above.

Thanks,

-- 
 Bastien

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

* Re: Introducing Octopress Exporter
  2012-08-02  9:45 ` Aurélien Aptel
  2012-08-02 13:44   ` Tom Alexander
  2012-08-02 14:37   ` Jambunathan K
@ 2012-08-06 22:28   ` Neil Smithline
  2012-08-07  2:48     ` Neil Smithline
  2 siblings, 1 reply; 23+ messages in thread
From: Neil Smithline @ 2012-08-06 22:28 UTC (permalink / raw)
  To: Aurélien Aptel; +Cc: Org Mode


> Aurélien Aptel <mailto:aurelien.aptel@gmail.com>
> Aug 2, 2012 05:45
> I've never heard of octopress, interesting. The only thing I don't
> like is how comments are handled. Since it's all static you relying on
> an external service like Disqus. I'm not so fond of losing control
> over user contribution like that. Besides, the actual service (disqus)
> is pretty terrible anyway. I'm always pissed when the comment I sent
> gets processed in weird ways yet doesn't do verbatim/code blocks.
>
Org Mode and Octopress are both about owning your own data. They are a 
perfect fit.

You can get email notifications of your comments or RSS (see 
http://www.accmanpro.com/2011/01/27/subscribe-to-all-comments-using-disqus-in-7-easy-steps/) 
feeds of all your comments. A simple mail filter and you own your 
comments. You can even save them to individual, HTML files.

I'm wondering what blogging system you use and if you really own your 
comments as much as you think. I would argue that individual HTML files 
on my hard drive is a greater degree of ownership than who-knows-what in 
some database....

I think that the decision about the use of external service for comments 
(or anything else) is a very important question. Assuming that you can 
own your data, an absolute requirement for me, I think that combining a 
static blog with external, dynamic services is the perfect solution. 
I've discussed this at 
http://www.neilsmithline.com/blog/2012/07/22/blurring-static-and-dynamic-blogs/.

My __static__ Octopress blog is hosted by Github, displays dynamic 
recent tweets care of Twitter, recent Github activity via Github, has a 
per-article "Buzz" section thanks to SocialMention, and even 
automatically tweets whenever I add a new post via Feedburner and Gmail 
filters.

I should add that my blog is 100% free with the exception of the 
computer I compose the posts on.

For me, static content combined with dynamic interaction is the best 
solution I've found and I've used many blogging services or self-hosted 
blogs.

Octopress is actually my second static blogging system. I used 
Nanoblogger before (I highly don't recommend it). I imported my posts 
from Nanoblogger to Octopress with relative really ease because they 
were both plain-text static blogs. I discuss it at 
http://www.neilsmithline.com/blog/2012/05/14/new-blog-tech/. Importing 
posts from other blogging systems that squirreled everything into a DB 
seemed to painful to me.

Neil

PS: I saw a mention of comment spam. I think that Disqus does a pretty 
good job of managing that. It also helps that my blog is not an 
attractive target as it probably has no more than two or three viewers.

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

* Re: Introducing Octopress Exporter
  2012-08-06 22:28   ` Neil Smithline
@ 2012-08-07  2:48     ` Neil Smithline
  2012-08-07  9:52       ` The Quantified Shower (was: Introducing Octopress Exporter) Bastien
  0 siblings, 1 reply; 23+ messages in thread
From: Neil Smithline @ 2012-08-07  2:48 UTC (permalink / raw)
  To: Org Mode

PS: By coincidence I just posted an article about Org Mode in my 
Octopress blog :-D

It is the second of at least three postings on my time management system.

The Org Mode posting is at 
http://www.neilsmithline.com/blog/2012/08/05/time-tracking-part-2/

The posting that outlines the entire time management system is 
http://www.neilsmithline.com/blog/2012/08/04/time-tracking/

If you want a sneak peek at some of the next posting, you can look at 
the files in 
https://github.com/Neil-Smithline/time-tracking-experiments/tree/gh-pages/assets

They include:
- Android screen shots of the Time Recording Pro app: The "customer" and 
"job" fields are extracted from an Org agenda by some elisp I wrote, 
exported into TRP format, and then imported into TRP.

- Gcal screen shots showing detailed recording of my activities. This is 
a builtin feature of TRP

- Org files that are produced by Memacs. They show data that has been 
harvested from Gcal and imported back into Org.

I have more discussion about the project at 
https://github.com/Neil-Smithline/time-tracking-experiments.

IMO, the coolest part is that I get all this functionality for the small 
price of 300 lines of elisp plus some scripting to wire things together.

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

* The Quantified Shower (was: Introducing Octopress Exporter)
  2012-08-07  2:48     ` Neil Smithline
@ 2012-08-07  9:52       ` Bastien
  2012-08-07 12:32         ` The Quantified Shower Christopher J. White
                           ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Bastien @ 2012-08-07  9:52 UTC (permalink / raw)
  To: Neil Smithline; +Cc: Org Mode

I have long given up on reckoning how many I am (outside or inside), 
and I'm always amazed at those attempts to quantify one's own life.

I'm still trying to figure out if this post is a joke or not:

  http://jeapostrophe.github.com/blog/2012/08/06/shower/

Maybe the fun is precisely in wondering so :)

-- 
 Bastien

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

* Re: The Quantified Shower
  2012-08-07  9:52       ` The Quantified Shower (was: Introducing Octopress Exporter) Bastien
@ 2012-08-07 12:32         ` Christopher J. White
  2012-08-09 10:17           ` Aurélien Aptel
  2012-08-07 13:07         ` The Quantified Shower (was: Introducing Octopress Exporter) Nick Dokos
  2012-08-07 13:08         ` The Quantified Shower (was: Introducing Octopress Exporter) Myles English
  2 siblings, 1 reply; 23+ messages in thread
From: Christopher J. White @ 2012-08-07 12:32 UTC (permalink / raw)
  To: emacs-orgmode

Oh man, what a great post... But the mp3 links are broken!  I really 
want to hear "The Shower Song w/hair".

This makes me think of my obsession with finding the optimal order of 
tasks that I do in a given day.  (I can save 5 seconds if I overlap 
rinsing the espresso cup with one hand while I flush the espresso maker 
with the other...)

...cj


On 8/7/12 5:52 AM, Bastien wrote:
> I have long given up on reckoning how many I am (outside or inside),
> and I'm always amazed at those attempts to quantify one's own life.
>
> I'm still trying to figure out if this post is a joke or not:
>
>    http://jeapostrophe.github.com/blog/2012/08/06/shower/
>
> Maybe the fun is precisely in wondering so :)
>

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

* Re: The Quantified Shower (was: Introducing Octopress Exporter)
  2012-08-07  9:52       ` The Quantified Shower (was: Introducing Octopress Exporter) Bastien
  2012-08-07 12:32         ` The Quantified Shower Christopher J. White
@ 2012-08-07 13:07         ` Nick Dokos
  2012-08-07 13:13           ` Nick Dokos
  2012-08-08 17:30           ` Jambunathan K
  2012-08-07 13:08         ` The Quantified Shower (was: Introducing Octopress Exporter) Myles English
  2 siblings, 2 replies; 23+ messages in thread
From: Nick Dokos @ 2012-08-07 13:07 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode, Neil Smithline

Bastien <bzg@gnu.org> wrote:

> I have long given up on reckoning how many I am (outside or inside), 
> and I'm always amazed at those attempts to quantify one's own life.
> 

Here's something to either inspire you or turn you off completely:

http://www.technologyreview.com/featured-story/426968/the-patient-of-the-future/

Nick

> I'm still trying to figure out if this post is a joke or not:
> 
>   http://jeapostrophe.github.com/blog/2012/08/06/shower/
> 
> Maybe the fun is precisely in wondering so :)
> 
> -- 
>  Bastien
> 

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

* Re: The Quantified Shower (was: Introducing Octopress Exporter)
  2012-08-07  9:52       ` The Quantified Shower (was: Introducing Octopress Exporter) Bastien
  2012-08-07 12:32         ` The Quantified Shower Christopher J. White
  2012-08-07 13:07         ` The Quantified Shower (was: Introducing Octopress Exporter) Nick Dokos
@ 2012-08-07 13:08         ` Myles English
  2 siblings, 0 replies; 23+ messages in thread
From: Myles English @ 2012-08-07 13:08 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode, Neil Smithline


He doesn't say how long it takes to wash his wife.


Bastien writes:

> I have long given up on reckoning how many I am (outside or inside), 
> and I'm always amazed at those attempts to quantify one's own life.
>
> I'm still trying to figure out if this post is a joke or not:
>
>   http://jeapostrophe.github.com/blog/2012/08/06/shower/
>
> Maybe the fun is precisely in wondering so :)

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

* Re: The Quantified Shower (was: Introducing Octopress Exporter)
  2012-08-07 13:07         ` The Quantified Shower (was: Introducing Octopress Exporter) Nick Dokos
@ 2012-08-07 13:13           ` Nick Dokos
  2012-08-07 17:27             ` The Quantified Shower Bastien
  2012-08-08 12:46             ` Karl Voit
  2012-08-08 17:30           ` Jambunathan K
  1 sibling, 2 replies; 23+ messages in thread
From: Nick Dokos @ 2012-08-07 13:13 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Bastien, Neil Smithline, Org Mode

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Bastien <bzg@gnu.org> wrote:
> 
> > I have long given up on reckoning how many I am (outside or inside), 
> > and I'm always amazed at those attempts to quantify one's own life.
> > 
> 
> Here's something to either inspire you or turn you off completely:
> 
> http://www.technologyreview.com/featured-story/426968/the-patient-of-the-future/
> 
> Nick

Actually, I meant this one:

http://www.theatlantic.com/magazine/archive/2012/07/the-measured-man/9018/

> 
> > I'm still trying to figure out if this post is a joke or not:
> > 
> >   http://jeapostrophe.github.com/blog/2012/08/06/shower/
> > 
> > Maybe the fun is precisely in wondering so :)
> > 
> > -- 
> >  Bastien
> > 
> 
> 

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

* Re: The Quantified Shower
  2012-08-07 13:13           ` Nick Dokos
@ 2012-08-07 17:27             ` Bastien
  2012-08-07 20:39               ` brian powell
  2012-08-08 12:46             ` Karl Voit
  1 sibling, 1 reply; 23+ messages in thread
From: Bastien @ 2012-08-07 17:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode, Neil Smithline

Nick Dokos <nicholas.dokos@hp.com> writes:

> Actually, I meant this one:
>
> http://www.theatlantic.com/magazine/archive/2012/07/the-measured-man/9018/

Nice read!  Yes, I'm somehow scared :)

Mhh.. at least Claude Shannon had more funny stuff to play 
with than his body:

http://www.youtube.com/watch?v=sBHGzRxfeJY

-- 
 Bastien

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

* Re: The Quantified Shower
  2012-08-07 17:27             ` The Quantified Shower Bastien
@ 2012-08-07 20:39               ` brian powell
  0 siblings, 0 replies; 23+ messages in thread
From: brian powell @ 2012-08-07 20:39 UTC (permalink / raw)
  To: Bastien; +Cc: Org Mode

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

* Lets not forget  Claude Shannon's "Ultimate Machine":

http://www.youtube.com/watch?v=G5rJJgt_5mg

On Tue, Aug 7, 2012 at 1:27 PM, Bastien <bzg@gnu.org> wrote:

> Nick Dokos <nicholas.dokos@hp.com> writes:
>
> > Actually, I meant this one:
> >
> >
> http://www.theatlantic.com/magazine/archive/2012/07/the-measured-man/9018/
>
> Nice read!  Yes, I'm somehow scared :)
>
> Mhh.. at least Claude Shannon had more funny stuff to play
> with than his body:
>
> http://www.youtube.com/watch?v=sBHGzRxfeJY
>
> --
>  Bastien
>
>

[-- Attachment #2: Type: text/html, Size: 1208 bytes --]

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

* Re: The Quantified Shower
  2012-08-07 13:13           ` Nick Dokos
  2012-08-07 17:27             ` The Quantified Shower Bastien
@ 2012-08-08 12:46             ` Karl Voit
  1 sibling, 0 replies; 23+ messages in thread
From: Karl Voit @ 2012-08-08 12:46 UTC (permalink / raw)
  To: emacs-orgmode

* Nick Dokos <nicholas.dokos@hp.com> wrote:
> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>> Bastien <bzg@gnu.org> wrote:
>> 
>> > I have long given up on reckoning how many I am (outside or inside), 
>> > and I'm always amazed at those attempts to quantify one's own life.
>> 
>> Here's something to either inspire you or turn you off completely:
> http://www.theatlantic.com/magazine/archive/2012/07/the-measured-man/9018/

TL;DR but what is it that worries you?

-- 
Karl Voit

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

* Re: The Quantified Shower
  2012-08-07 13:07         ` The Quantified Shower (was: Introducing Octopress Exporter) Nick Dokos
  2012-08-07 13:13           ` Nick Dokos
@ 2012-08-08 17:30           ` Jambunathan K
  2012-08-10  7:50             ` Bastien
  1 sibling, 1 reply; 23+ messages in thread
From: Jambunathan K @ 2012-08-08 17:30 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Bastien, Neil Smithline, Org Mode

Nick Dokos <nicholas.dokos@hp.com> writes:

> Here's something to either inspire you or turn you off completely:
>
> http://www.technologyreview.com/featured-story/426968/the-patient-of-the-future/

Another one:

http://blog.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/
-- 

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

* Re: The Quantified Shower
  2012-08-07 12:32         ` The Quantified Shower Christopher J. White
@ 2012-08-09 10:17           ` Aurélien Aptel
  0 siblings, 0 replies; 23+ messages in thread
From: Aurélien Aptel @ 2012-08-09 10:17 UTC (permalink / raw)
  To: orgmode; +Cc: emacs-orgmode

Haha, oh wow! This is awesome!

On Tue, Aug 7, 2012 at 2:32 PM, Christopher J. White
<orgmode@grierwhite.com> wrote:
> Oh man, what a great post... But the mp3 links are broken!  I really want to
> hear "The Shower Song w/hair".

Works for me.

*megaman music*
Put. soap. on. loofa. (in robotic voice)
*megaman music*
etc

> On 8/7/12 5:52 AM, Bastien wrote:
>> I have long given up on reckoning how many I am (outside or inside),
>> and I'm always amazed at those attempts to quantify one's own life.
>>
>> I'm still trying to figure out if this post is a joke or not:
>>
>>    http://jeapostrophe.github.com/blog/2012/08/06/shower/
>>
>> Maybe the fun is precisely in wondering so :)

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

* Re: The Quantified Shower
  2012-08-08 17:30           ` Jambunathan K
@ 2012-08-10  7:50             ` Bastien
  2012-08-13 10:56               ` A tidy file maketh a tidy mind? 'Mash
  0 siblings, 1 reply; 23+ messages in thread
From: Bastien @ 2012-08-10  7:50 UTC (permalink / raw)
  To: Jambunathan K; +Cc: Org Mode, nicholas.dokos, Neil Smithline

Jambunathan K <kjambunathan@gmail.com> writes:

> http://blog.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/

This one is quite outstanding -- thanks for the link!

-- 
 Bastien

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

* A tidy file maketh a tidy mind?
  2012-08-10  7:50             ` Bastien
@ 2012-08-13 10:56               ` 'Mash
  2012-08-14  7:46                 ` Bastien
  2012-08-14 13:10                 ` Eric Schulte
  0 siblings, 2 replies; 23+ messages in thread
From: 'Mash @ 2012-08-13 10:56 UTC (permalink / raw)
  To: emacs-orgmode

Morning,

I just want to know if there is there exists a 'tidy' module/command  
that can be run on a file to tidy it?

I often find myself going back and adding extra line breaks and  
padding, and wondering if there exists something that can do this for  
me?

Thanks,

'Mash

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

* Re: A tidy file maketh a tidy mind?
  2012-08-13 10:56               ` A tidy file maketh a tidy mind? 'Mash
@ 2012-08-14  7:46                 ` Bastien
  2012-08-14 13:10                 ` Eric Schulte
  1 sibling, 0 replies; 23+ messages in thread
From: Bastien @ 2012-08-14  7:46 UTC (permalink / raw)
  To: 'Mash; +Cc: emacs-orgmode

Hi Mash,

'Mash <mashdot@toshine.net> writes:

> I just want to know if there is there exists a 'tidy' module/command  that
> can be run on a file to tidy it?

People differ in the way they think their org files are "clean".

Maybe you can start a list of tidyfication routines you use reguarily,
then if we all agree on the core routines that many people use, we can
have a useful function for this -- certainly in org-hacks.org first.

Thanks,

-- 
 Bastien

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

* Re: A tidy file maketh a tidy mind?
  2012-08-13 10:56               ` A tidy file maketh a tidy mind? 'Mash
  2012-08-14  7:46                 ` Bastien
@ 2012-08-14 13:10                 ` Eric Schulte
  2012-08-14 13:55                   ` 'Mash (Thomas Herbert)
  2012-08-14 21:50                   ` Bastien
  1 sibling, 2 replies; 23+ messages in thread
From: Eric Schulte @ 2012-08-14 13:10 UTC (permalink / raw)
  To: 'Mash; +Cc: emacs-orgmode

'Mash <mashdot@toshine.net> writes:

> Morning,
>
> I just want to know if there is there exists a 'tidy' module/command
> that can be run on a file to tidy it?
>
> I often find myself going back and adding extra line breaks and
> padding, and wondering if there exists something that can do this for
> me?
>

While this doesn't exist currently, it should be fairly easy to
implement a set of rules which operate over the parsed file
representation generated by org-element.  This may be used to convert an
Org-mode buffer into an elisp list, manipulate the list, and then insert
the results as text back into a new buffer.

The code could look something like the following

    ;; -*- emacs-lisp -*-
    (let ((buf (org-element-parse-buffer))) ;; convert current buffer to ELisp
      (dolist (rule cleanup-rules) ;; run cleanup transformations on the buffer
        (setq buf (funcall rule buf)))
      (delete-region (point-min) (point-max)) ;; replace the buffer contents
      (insert (org-element-interpret-data buf))) ;; with the cleaned results

The only catch would be deciding what to add to the cleanup-rules.

Also, since Org-mode is plain text, I bet a couple of lines of sed or
perl could get you most of the way to a clean buffer.

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

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

* Re: A tidy file maketh a tidy mind?
  2012-08-14 13:10                 ` Eric Schulte
@ 2012-08-14 13:55                   ` 'Mash (Thomas Herbert)
  2012-08-14 21:50                   ` Bastien
  1 sibling, 0 replies; 23+ messages in thread
From: 'Mash (Thomas Herbert) @ 2012-08-14 13:55 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

On 2012-08-14 07:10-0600, Eric Schulte wrote:
> 'Mash <mashdot@toshine.net> writes:
>
> > Morning,
> >
> > I just want to know if there is there exists a 'tidy' module/command
> > that can be run on a file to tidy it?
> >
> > I often find myself going back and adding extra line breaks and
> > padding, and wondering if there exists something that can do this for
> > me?
> >
>
> While this doesn't exist currently, it should be fairly easy to
> implement a set of rules which operate over the parsed file
> representation generated by org-element.  This may be used to convert an
> Org-mode buffer into an elisp list, manipulate the list, and then insert
> the results as text back into a new buffer.
>
> The code could look something like the following
>
>     ;; -*- emacs-lisp -*-
>     (let ((buf (org-element-parse-buffer))) ;; convert current buffer to ELisp
>       (dolist (rule cleanup-rules) ;; run cleanup transformations on the buffer
>         (setq buf (funcall rule buf)))
>       (delete-region (point-min) (point-max)) ;; replace the buffer contents
>       (insert (org-element-interpret-data buf))) ;; with the cleaned results
>
> The only catch would be deciding what to add to the cleanup-rules.
>
> Also, since Org-mode is plain text, I bet a couple of lines of sed or
> perl could get you most of the way to a clean buffer.

Thanks, I need to spend some time to look at rules. But my most
common clean-up is really just adding some spacing/padding for
example. Would be handy to implement in a save-hook along with org-sort.

--- cluttered ---
* Lorem ipsum dolor sit amet


** TODO consectetuer adipiscing elit
   Sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
   aliquam erat volutpat.
   SCHEDULED: <2012-08-09 Thu 20:30>
** TODO  quis nostrud exerci tation ullamcorper
   SCHEDULED: <2012-08-08 Wed 10:30>
   Nam liber tempor cum soluta nobis eleifend option congue nihil
   imperdiet doming id quod mazim placerat facer possim assum.
** TODO Ut wisi enim ad minim veniam...

--- tidier ---
* Lorem ipsum dolor sit amet
** TODO  quis nostrud exerci tation ullamcorper
   SCHEDULED: <2012-08-08 Wed 10:30>
   Nam liber tempor cum soluta nobis eleifend option congue nihil
   imperdiet doming id quod mazim placerat facer possim assum.

** TODO consectetuer adipiscing elit
   SCHEDULED: <2012-08-09 Thu 20:30>
   Sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
   aliquam erat volutpat.

** TODO Ut wisi enim ad minim veniam...

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

* Re: A tidy file maketh a tidy mind?
  2012-08-14 13:10                 ` Eric Schulte
  2012-08-14 13:55                   ` 'Mash (Thomas Herbert)
@ 2012-08-14 21:50                   ` Bastien
  1 sibling, 0 replies; 23+ messages in thread
From: Bastien @ 2012-08-14 21:50 UTC (permalink / raw)
  To: Eric Schulte; +Cc: 'Mash, emacs-orgmode

Eric Schulte <eric.schulte@gmx.com> writes:

> The code could look something like the following
>
>     ;; -*- emacs-lisp -*-
>     (let ((buf (org-element-parse-buffer))) ;; convert current buffer to ELisp
>       (dolist (rule cleanup-rules) ;; run cleanup transformations on the buffer
>         (setq buf (funcall rule buf)))
>       (delete-region (point-min) (point-max)) ;; replace the buffer contents
>       (insert (org-element-interpret-data buf))) ;; with the cleaned results
>
> The only catch would be deciding what to add to the cleanup-rules.

One useful clean up operation, also illustrated in 'Mash's example,
is to put time-stamps (i.e. SCHEDULED: lines etc.) where they belong,
right after the headline.

Is there any taker for such a function?

It would be a nice addition to org-hacks.org!

-- 
 Bastien

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

end of thread, other threads:[~2012-08-14 21:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-01 23:21 Introducing Octopress Exporter Tom Alexander
2012-08-02  9:45 ` Aurélien Aptel
2012-08-02 13:44   ` Tom Alexander
2012-08-02 14:37   ` Jambunathan K
2012-08-06 22:28   ` Neil Smithline
2012-08-07  2:48     ` Neil Smithline
2012-08-07  9:52       ` The Quantified Shower (was: Introducing Octopress Exporter) Bastien
2012-08-07 12:32         ` The Quantified Shower Christopher J. White
2012-08-09 10:17           ` Aurélien Aptel
2012-08-07 13:07         ` The Quantified Shower (was: Introducing Octopress Exporter) Nick Dokos
2012-08-07 13:13           ` Nick Dokos
2012-08-07 17:27             ` The Quantified Shower Bastien
2012-08-07 20:39               ` brian powell
2012-08-08 12:46             ` Karl Voit
2012-08-08 17:30           ` Jambunathan K
2012-08-10  7:50             ` Bastien
2012-08-13 10:56               ` A tidy file maketh a tidy mind? 'Mash
2012-08-14  7:46                 ` Bastien
2012-08-14 13:10                 ` Eric Schulte
2012-08-14 13:55                   ` 'Mash (Thomas Herbert)
2012-08-14 21:50                   ` Bastien
2012-08-07 13:08         ` The Quantified Shower (was: Introducing Octopress Exporter) Myles English
2012-08-03  7:15 ` Introducing Octopress Exporter Bastien

Code repositories for project(s) associated with this 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).