emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Include files on export


From: Richard G Riley
Subject: Re: [Orgmode] Include files on export
Date: Wed, 02 Jul 2008 21:10:15 +0200
User-agent: Emacs 22.2.1/No Gnus v0.11

Carsten Dominik <address@hidden> writes:

> On Jul 2, 2008, at 11:21 AM, Richard G Riley wrote:
>
>>
>> How can I include text into a sub level e.g an unordered list? I
>> really
>> dont want to inclide the list delimiter in the text file itself since
>> this text can be included elsewhere too.
>>
>> + Title
>>  + list item 1
>> #+INCLUDE: "~/docs/cv/references/cpd.org"
>>
>> here I want the include to be list item 2.
>
> This is untested.
>
> In .emacs
>
> (require 'org-eval)
> (defun org-include-as-list-item (file ind bullet)
>   "Include FILE with indentation IND and BULLET into the current file"
>   (let ((i1 (concat (make-string ind ?\ ) bullet " "))
>       (i2 (concat "\n" (make-string (+ 2 ind) ?\ )))
>       (text (with-temp-buffer
>               (insert-file-contents file)
>               (buffer-string))))
>     (concat "\n" i1 (mapconcat 'identity (org-split-string text "\n")
> i2)
>           "\n")))
>
> In the Org file:
>
>
>
> * test
>
> + Title
>  + list item 1
>    <lisp>(org-include-as-list-item "inc.ttt" 10 "+")</lisp>
>
>
> HTH
>
> - Carsten

Could I suggest a different approach?

Possibly have a parameter which is a prefix text on the include line?

e.g

#+INCLUDE: "~/docs/cv/references/cpd.org" :prefix " + "

The you dont need to hard code bullets and indentation. There is
probably a more suitable syntax than above.






reply via email to

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