renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

Add org-publish-blog-sync-include-files to handle included files. #63

Closed tonyday567 closed 11 years ago

tonyday567 commented 11 years ago

New function added - org-publish-blog-sync-include-files - that properly handles #+INCLUDE directives in org-mode. This means that separate files can be used rather than one monolithic org file. The function works with a temp buffer and, as such, no appropriate file exists. This meant changing the usage of org-map-entries from file-with-archive to nil. Given this change, I didn't hook this up to the main org-publish-blog function, or seek to include a use case in sample.org.

Tony

tonyday567 commented 11 years ago

Almost certainly more elegent :-) Sometimes you just start hacking in and don't think too much about it.

The tricky bit (for me) is the stoopid behaviour of org-export-handle-include-files which goes and overwrites the buffer, so that a process that subsequently automatically saves the buffer (ie org-tangle) trashes the #include.

The other issue is the usage of 'file-archive in

(org-map-entries 'point-marker (ob:blog-snippet-filter BLOG) 'file-archive)

This means that the extra include process has to save the temporary buffer as a (temporary) file before proceeding with the publish.

More generally, do you have any thoughts about moving from a one org file blog to a multi-file process? I have blog posts (and potential blog posts) situated everywhere and anywhere in my numerous org files. It would be awesome to just add a few tags to a subtree and it gets published. This process seemed to work well in org2blog.

I'm happy to contribute to development of this.

punchagan commented 11 years ago

@tonyday567 I would also use such a feature, if it existed.

But, I moved all my posts to a single file, and I don't mind it too much, now.