me, thinking out loud…

Posts tagged ‘orgmode’

Some fun from #org-mode

2010-10-02 Sat 20:26

This is a conversation from #org-mode, published without permission from plovs, BerntH and bremner. If any of you want any of the content removed, I will do so.

<punchagan> hi all

<BerntH> hi punchagan [18:36]

<punchagan> BerntH: ever used/tried blorg or blorgit? [18:47]

<punchagan> I like the way org-publish works, but blorg exports one org file as a blog. If blorg were to be re-written on top of org-publish, how should it be done? use one file per post or just one file for the whole blog? [18:52]

<bremner> punchagan: another option is to use ikiwiki and use the org-mode plugin to render pages. This is what i do, although only a bit of the site is in org. [19:44]

<punchagan> bremner: can I have a look at your site? [19:45]

<bremner> sure, it ain’t pretty, but: http://www.cs.unb.ca/~bremner [19:46]

<punchagan> thanks. I’ll keep this in mind. [19:47]

<punchagan> I just loved the way this site looks and behaves – http://julien.danjou.info/projects.html

<bremner> well, the side bar at least is possible with ikiwiki. Other than that I suppose it is mainly a matter of css [19:48]

<BerntH> punchagan: nope [19:49]

<punchagan> ok BerntH [19:50]

<plovs> punchagan ikiwiki does have an org-mode plugin [19:56]

<punchagan> plovs: yes, bremner told me that and I’ve seen on Worg too. :)

<plovs> punchagan ah, yes, sorry

<punchagan> plovs: it’s alright. [19:59]

<plovs> punchagan another possibility is org2blog, which uses wordpress

<punchagan> plovs: I’m the author of it. :D

<plovs> lol, ik, that punchagan [20:17]

<punchagan> lol

<punchagan> plovs: were you kidding? or serious? [20:19]

<plovs> punchagan sorry to say i was serious, but it will not happen again :-)

<plovs> i really like org2blog, played with it yesterday

<punchagan> plovs: no. I was just wondering if you were playing around with me. :P

<punchagan> I’m happy some one thinks it is useful.

<plovs> lol, no, i just didn’t recognized your name, although it is kind of hard to miss [20:21]

<punchagan> I hope you don’t mind, if I make this anecdote public?

Refile to date-tree

Useful to refile notes to the journal file, which is a date-tree. org-refile isn’t convenient to refile stuff to a date-tree.

(defun my/org-refile-to-journal ()
  "Refile an entry to journal file's date-tree"
  (interactive)
  (require 'org-datetree)
  (let ((journal "/data/life-in-plain-text/journal.org")
        post-date)
    (setq post-date (or (org-entry-get (point) "TIMESTAMP_IA")
                        (org-entry-get (point) "TIMESTAMP")))
    (setq post-date (nthcdr 3 (parse-time-string post-date)))
    (setq post-date (list (cadr post-date) 
                          (car post-date) 
                          (caddr post-date)))
    (org-cut-subtree)
    (with-current-buffer (or (find-buffer-visiting journal)
                             (find-file-noselect file))
      (save-excursion
        (org-datetree-file-entry-under (current-kill 0) post-date)
        (bookmark-set "org-refile-last-stored")))
    (message "Refiled to %s" journal)))

(defun my/org-agenda-refile-to-journal ()
  "Refile the item at point to journal."
  (interactive)
  (let* ((marker (or (org-get-at-bol 'org-hd-marker)
                     (org-agenda-error)))
         (buffer (marker-buffer marker))
         (pos (marker-position marker)))
    (with-current-buffer buffer
      (save-excursion
        (save-restriction
          (widen)
          (goto-char marker)
          (org-remove-subtree-entries-from-agenda)
          (my/org-refile-to-journal)))))
  (org-agenda-redo))

(org-defkey org-agenda-mode-map (kbd "C-c C-S-w") 'my/org-agenda-refile-to-journal)
(org-defkey org-mode-map (kbd "C-c C-S-w") 'my/org-refile-to-journal)

ditaa and Org mode

This post is a reply to a comment on my blog asking how to insert ascii-art in org-mode documents.

To simply get the diagram in ascii, put the text into your file as “code”.

:  +--------------+
:  |              |
:  |   Analysis   |
:  +------+-------+
:        |
:        |
:        |
:        v
:  +--------------+
:  |              |
:  |   Design     |
:  +------+-------+
:        |
:        |
:        v
:  +--------------+
:  |              |
:  | Programming  |
:  +--------------+
 +--------------+
 |              |
 |   Analysis   |
 +------+-------+
       |
       |
       |
       v
 +--------------+
 |              |
 |   Design     |
 +------+-------+
       |
       |
       v
 +--------------+
 |              |
 | Programming  |
 +--------------+

You can get beautiful images using org-mode. The present versions of org-mode comes along with ditaa.

To use ditaa, you will need to have java installed.

#+begin_ditaa communication.png -r -S
        +-----------+        +---------+
        |    PLC    |        |         |
        |  Network  +<------>+   PLC   +<---=---------+
        |    cRED   |        |  c707   |              |
        +-----------+        +----+----+              | 
                                  ^                   | 
                                  |                   | 
                                  |  +----------------|-----------------+
                                  |  |                |                 |
                                  v  v                v                 v
          +----------+       +----+--+--+      +-------+---+      +-----+-----+       Windows clients
          |          |       |          |      |           |      |           |      +----+      +----+
          | Database +<----->+  Shared  +<---->+ Executive +<-=-->+ Operator  +<---->|cYEL| . . .|cYEL|
          |   c707   |       |  Memory  |      |   c707    |      | Server    |      |    |      |    |
          +--+----+--+       |{d} cGRE  |      +------+----+      |   c707    |      +----+      +----+
             ^    ^          +----------+             ^           +-------+---+
             |    |                                   |                        
             |    +--------=--------------------------+                    
             v                                                             
    +--------+--------+                                                         
    |                 |                                                         
    | Millwide System |            -------- Data ---------                      
    | cBLU            |            --=----- Signals ---=--                      
    +-----------------+                                                         
#+end_ditaa

https://punchagan.files.wordpress.com/2010/08/communication_232b3e6564d46a9242668adfbfeddbf2b61cff941.png

Neat, ain’t it?

Tag Cloud

%d bloggers like this: