Permalink
Browse files

added function for automatically exporting task-updates as blog posts

  see the "publication" heading of development.org.  The function
  creates a blog post for each dated task heading -- all task heading
  will be automatically dated from now on.  These posts are dropped
  into a _posts directory for use by the jekyll blogging engine which
  is supported on github.
  • Loading branch information...
1 parent 2f02b9d commit cd25c3754ca649db9e4f506a4a536d6f2b93c94e Eric Schulte committed Dec 22, 2009
Showing with 116 additions and 27 deletions.
  1. +4 −1 .gitignore
  2. +3 −0 _config.yml
  3. +20 −18 development.org
  4. +11 −8 index.org
  5. +78 −0 publish.org
View
@@ -1,6 +1,9 @@
-
## automatically generated files
.Rhistory
blue.png
*.html
*.pdf
+
+## ignore jekyll files
+_posts
+_site
View
@@ -0,0 +1,3 @@
+auto: false
+server: false
+permalink: none
View
@@ -1,14 +1,15 @@
#+TITLE: org-babel --- facilitating communication between programming languages and people
-#+SEQ_TODO: PROPOSED TODO STARTED | DONE DEFERRED REJECTED
-#+OPTIONS: H:3 num:nil toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
+#+TODO: PROPOSED(p!) TODO(t!) STARTED(s!) | DONE(d!) DEFERRED(f!) REJECTED(r!)
+#+OPTIONS: H:3 num:nil toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:nil LaTeX:nil skip:nil d:(HIDE) tags:not-in-toc
#+STARTUP: oddeven hideblocks
* Tasks [55/98]
** DONE indent noweb references to the level of the initial ref
+ - State "DONE" from "DONE" [2009-12-22 Tue 12:50]
augment `org-babel-expand-noweb-references' so that it rigidly indents
the body of the block to the depth of the original noweb reference.
-#+begin_quote Sébastien
+#+begin_example
In fact, a better specification is: copy whatever (any character) is in front
of `<<<code here>>>' in front of every line of the referenced block (same
amount of characters, be it spaces or something else).
@@ -32,33 +33,34 @@ Currently, the first line of the "condition" block is commented, the others
not, resulting in incorrect code being tangled.
With the above "spec", I guess all cases are covered. What do you think?
-#+end_quote
+#+end_example
** PROPOSED :width and :height set dimensions in latex output?
+ - State "PROPOSED" from "" [2009-12-22 Tue 12:39]
See email thread started by Graham Smith 12 Dec.
Should we be setting ATTR_LaTeX in this situation?
-#+begin_src org
+#+begin_example
,#+options toc:nil
,#+title: R latex graphics
- ,
- ,Text before figure.
+
+ Text before figure.
,#+CAPTION: Trial boxplots with babel
,#+LABEL: fig:trial boxplots
,#+ATTR_LaTeX: width=5cm
,#+srcname:Boxplots Summary
,#+begin_src R :session BirdData :file BoxplotSummary.pdf :exports both
- , Wingcrd <- rnorm(100, 20) ; Tarsus <- rnorm(100, 5) ;
- , Head <- rnorm(100, 3) ; Wt <- rnorm(100, 40)
- , boxplot(Wingcrd,Tarsus,Head,Wt,names=c("Wingcrd","Tarsus","Head","Wt"))
+ Wingcrd <- rnorm(100, 20) ; Tarsus <- rnorm(100, 5) ;
+ Head <- rnorm(100, 3) ; Wt <- rnorm(100, 40)
+ boxplot(Wingcrd,Tarsus,Head,Wt,names=c("Wingcrd","Tarsus","Head","Wt"))
,#+end_src
,#+results: Boxplots
- ,[[file:BoxplotSummary.pdf]]
+ [[file:BoxplotSummary.pdf]]
- ,Text after figure.
-#+end_src
+ Text after figure.
+#+end_example
** PROPOSED Make some org-babel commands available from edit buffer?
I'm not sure about this, but it's often occurred to me that it
@@ -86,21 +88,22 @@ With the above "spec", I guess all cases are covered. What do you think?
What would a general org-babel mechanism for remote sessions be?
** TODO byte-compile elisp on tangle
+ - State "TODO" from "PROPOSED" [2009-12-22 Tue 12:50]
from mailing list
-#+begin_quote
+#+begin_example
1) When the org configuration file aren't changed, a way to automatically load
their tangled version (bytecompiled ?) in order to improve the initialization
time of Emacs.
-#+end_quote
+#+end_example
- are there times when this wouldn't be desirable?
- maybe this should be controlled by *another* header argument
also we need to address some =:tangle= header argument related bugs in
`org-babel-load-file'
-#+begin_quote
+#+begin_example
2) If I include a source code block without a :tangle argument, then the .el file is truncated in odd
ways. For instance, if the last source code block doesn't have a tangle argument but all the source code
blocks above it have either :tangle yes or :tangle no, then the .el file only contains the tangled source
@@ -110,7 +113,7 @@ I've had other permutations of 2)
where only source code blocks after a :tangle no source code block get tangled.
If all of the source code blocks have :tangle arguments, then all seems to be well.
-#+end_quote
+#+end_example
** TODO documentation odds and ends
this is just a place to hold random notes for items that should make
@@ -5657,4 +5660,3 @@ var
#+resname: hello-clojure-output
: hello clojure
-
View
@@ -27,11 +27,14 @@ to the github development repo.
- the Org-babel functional test suite, which is implemented as a large
table and is run using Org-babel's spreadsheet functionality.
-** In the pipeline
- Support for Clojure has recently been contributed, and support for
- [[http://www.mozart-oz.org/][Oz]] is being planned.
-
-** Requirements Documentation
- The original requirements documentation is available at
- [[file:requirements.org][requirements]]. Because the project has evolved since this
- documentation was written, it is here mainly for historical reasons.
+** Recent Activity
+ #+begin_html
+ <ul>
+ {% for post in site.posts limit:5 %}
+ <li>
+ [{{ post.date | date_to_string }}] <a href=".{{ post.url }}">{{ post.title }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ #+end_html
+
View
@@ -0,0 +1,78 @@
+#+TITLE: Code for publishing Org-babel development information
+#+OPTIONS: num:nil ^:nil
+#+LaTeX_CLASS: normal
+
+This file contains the code to export this repo for publishing on github
+
+* Index
+Export the index in a manner amenable to jekyll processing
+#+begin_src emacs-lisp
+ (let ((index-file (expand-file-name
+ "index.org"
+ (file-name-directory (buffer-file-name))))
+ (yaml-front-matter '(("layout" . "default") ("title" . "Development")))
+ html)
+ ;; go to the top level tasks heading
+ (find-file index-file)
+ (setq html (org-export-as-html nil nil nil 'string t nil))
+ (with-temp-file "index.html"
+ (when yaml-front-matter
+ (insert "---\n")
+ (mapc (lambda (pair) (insert (format "%s: %s\n" (car pair) (cdr pair))))
+ yaml-front-matter)
+ (insert "---\n\n"))
+ (insert html)))
+#+end_src
+
+* Development Updates
+This code will be used to publish posts for all TODO items which have
+an associated date/time
+#+begin_src emacs-lisp :results silent :exports code
+ (save-excursion
+ ;; map over all tasks entries
+ (let ((dev-file (expand-file-name
+ "development.org"
+ (file-name-directory (buffer-file-name))))
+ (posts-dir (expand-file-name
+ "_posts"
+ (file-name-directory (buffer-file-name))))
+ (yaml-front-matter '(("layout" . "default"))))
+ ;; go to the top level tasks heading
+ (find-file dev-file)
+ (goto-char (point-min))
+ (outline-next-visible-heading 1)
+ (org-map-tree
+ (lambda ()
+ (let* ((props (org-entry-properties))
+ (todo (cdr (assoc "TODO" props)))
+ (time (cdr (assoc "TIMESTAMP_IA" props))))
+ ;; each task with a state and timestamp can be exported as a
+ ;; jekyll blog post
+ (when (and todo time)
+ (message "time=%s" time)
+ (let* ((heading (org-get-heading))
+ (title (replace-regexp-in-string
+ "[:=\(\)\?]" ""
+ (replace-regexp-in-string
+ "[ \t]" "-" heading)))
+ (str-time (and (string-match "\\([[:digit:]\-]+\\) " time)
+ (match-string 1 time)))
+ (to-file (format "%s-%s.html" str-time title))
+ (org-buffer (current-buffer))
+ (yaml-front-matter (cons (cons "title" heading) yaml-front-matter))
+ html)
+ (org-narrow-to-subtree)
+ (setq html (org-export-as-html nil nil nil 'string t nil))
+ (set-buffer org-buffer) (widen)
+ (with-temp-file (expand-file-name to-file posts-dir)
+ (when yaml-front-matter
+ (insert "---\n")
+ (mapc (lambda (pair) (insert (format "%s: %s\n" (car pair) (cdr pair))))
+ yaml-front-matter)
+ (insert "---\n\n"))
+ (insert html))
+ (get-buffer org-buffer))))))))
+#+end_src
+
+
+

0 comments on commit cd25c37

Please sign in to comment.