emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] New feature branch: org-xhtml-and-org-odt


From: joakim
Subject: Re: [O] New feature branch: org-xhtml-and-org-odt
Date: Mon, 14 Nov 2011 13:29:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

Jambunathan K <address@hidden> writes:

> Bastien
>
> I have created a new feature branch named "org-xhtml-and-org-odt".
>
> The main "feature" introduced by this branch is:
>
> 1. The HTML exporter in lisp/org-html.el is *totally* rewritten. It
>    should be on par with the current HTML exporter in the master branch.
>
>    Note: Anyone who depends on HTML export for his day-to-day work
>    *must* make sure that nothing is broken.
>
> 2. The ODT exporter is now moved to lisp/org-odt.el
>
> Additional Info:
>
> 1. testing
>    - There is a testfile in contrib/odt/tests/test.org which users can use
>      to unit test the changes.
>
> 2. info manual 
>
>    - I have updated the ODT section in the info manual and it is worth a
>      read for serious users. (Chirstian, I will revise the manual later
>      in the day. For now, it is pretty much same as what you had seen
>      last time.)
>
> Let me know if there are any questions or comments. 

I hope this is not OT but I have a question regarding this new
infrastructure.

I have a project at github called inkmacs, which integrates inkscape,
org-mode, and emacs:

https://github.com/jave/inkmacs

There I support interactive transfer of org nodes to inkscapes text
nodes.

My current code to extract the org nodes is not beautiful and I though
maybe org-lparse improves the situation?

Below is an excerpt from the code. As you can see it's very primitive
and does not support many org constructs. (Its surprisingly useful
anyway though)


-----
(defun org-get-entry-2 ()
  "Get the entry text, after heading, to next heading, or eof."
  (save-excursion
    (org-back-to-heading t)
    (let ((p1 (point-at-bol 2))
          (p2 (progn (forward-line) (search-forward "*" nil t))))
      (setq p2 (if (null p2) (point-max)
                 (1- p2)))
      (buffer-substring p1  p2))))

(defun inkorg-entry-text ()
  "Extract text from current org node.
Return a format suitable to
create an inkscape text node from.
asterisks and properties are removed."
  ;;TODO there ought to be some code in org-exp for this somewhere(org-ascii 
for example)
  (let ((text  (concat (org-get-heading) "\n" (org-get-entry-2))))
    (set-text-properties 0 (length text) nil text )

    (replace-regexp-in-string "\\([^\n]\\)\n\\([^\n]\\)" "\\1 \\2" 
                              (concat
                               (substring text 0 (string-match 
org-property-start-re text))
                               (if (string-match org-property-end-re text)
                                   (substring text (progn (string-match 
org-property-end-re text) (match-end 0)) (length text)))))))
----------

>
> Jambunathan K.

-- 
Joakim Verona




reply via email to

[Prev in Thread] Current Thread [Next in Thread]