* How to automatic list org files via Elisp and then, import them for an HTML export
@ 2012-10-26 13:09 flammable project
2012-10-27 10:55 ` Bastien
0 siblings, 1 reply; 4+ messages in thread
From: flammable project @ 2012-10-26 13:09 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2854 bytes --]
Hi All,
Since I use Orgmode 7.9.2, I tri to do this:
- parsing a directory in which several Org files are located. Basically,
each files is a blog post. So one org file pear day.
- import or include them in a main ORG file (index.org)
- export the main Org file to HTML to create a website.
To be more clear, this is the directory structure I build.
/website/
########+- index.org
########|
########+/blog-posts/
####################+ 2012_10_12.org
####################+ 2012_10_09.org
Here is a typical "post" org file:
8<-----------------------------------CUT HERE
*Post title
blala c'est la crise....
8<----------------------------------- CUT HERE
Here is the index.org
8<-----------------------------------CUT HERE
#+SETUPFILE: ../templates/level-0.org
#+INCLUDE: ../templates/level-0.org
#+TITLE: Home
#+OPTIONS: toc:nil H:3 num:nil
# <<home>>
* Home
Welcome in ......................
.......
.......
* Latest Articles 1
#+BEGIN_SRC emacs-lisp :exports results
(let ((default-directory "~/path/to/the/directory/posts/"))
(file-expand-wildcards "?org"))
#+END_SRC
#+BEGIN_SRC emacs-lisp :exports results
(directory-files "~/path/to/the/directory/posts/"
nil
"\\.org\\'")
#+END_SRC
* Latest Articles 2
** Test 1
#+INCLUDE: "./posts/2012_10_12.org"
#+INCLUDE: "./posts/2012_10_09.org"
** Test 2
#+INCLUDE: "./posts/2012_10_12.org" :minlevel 2
#+INCLUDE: "./posts/2012_10_09.org" :minlevel 2
** Test 3
#+INCLUDE: "./posts/2012_10_12.org" :prefix1 "* "
#+INCLUDE: "./posts/2012_10_09.org" :prefix1 "* "
* Latest Articles 3
#+BEGIN_EXAMPLE
#+INCLUDE ~/Dropbox/Private/The_Flammable_project/wx-fp/posts/2012_10_09.org
#+END_EXAMPLE
* Latest Articles 4
#+BEGIN_SRC :exports results :results output
cat ./posts/2012_10_12.org
#+END_SRC
8<----------------------------------- CUT HERE
Here is the status of my trial after doing "org-publish-project":
- Latest trials 1 : this elisp code parses the right directory but I don't
know how to import the result the elisp function and them use "#+INCLUDE:"
them as org files. If someone can help me on that? I really like to do what
I want with elisp, more powerfull solution.
- Latest trials 2 : the "#+INCLUDE" command includes the content of each
files but in the 3 sub-tests the hierarchy is completely meesed up, like
this
"* Latest Articles 2"
"** 2012_10_12 Post title "
" blablabla from post 2012_10_12.org file"
"*** 2012_10_09 Post tile"
" blabla from post 2012_10_09.org file"
the second "included" files is put under another level of hierarchy even if
the command ":minlevel X" or ":prefix1" are used.
Gentleman's any suggestion?
- Latest Articles 3 & 4 : Not working at all.....
Here we are! The HTML export is working very well. So it's not a problem of
export.
If someone can help me to do this I will really appreciate!
Thanks
[-- Attachment #2: Type: text/html, Size: 12451 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to automatic list org files via Elisp and then, import them for an HTML export
2012-10-26 13:09 How to automatic list org files via Elisp and then, import them for an HTML export flammable project
@ 2012-10-27 10:55 ` Bastien
2012-10-29 8:34 ` flammable project
0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2012-10-27 10:55 UTC (permalink / raw)
To: flammable project; +Cc: emacs-orgmode
Hi Flammable (!),
flammable project <flammable.project@gmail.com> writes:
> If someone can help me to do this I will really appreciate!
I think we will be able to help with a more limited example.
Keep it minimal, if possible...
Thanks in advance,
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to automatic list org files via Elisp and then, import them for an HTML export
2012-10-27 10:55 ` Bastien
@ 2012-10-29 8:34 ` flammable project
2012-12-22 18:50 ` Bastien
0 siblings, 1 reply; 4+ messages in thread
From: flammable project @ 2012-10-29 8:34 UTC (permalink / raw)
Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]
Ho!
I was thinking that giving the more details will eliminated doubts and
misunderstanding.
So to be clear enough, there was two questions in my previous message:
1/ In E-LISP, how to parse a directory containing Org files and import them
with the "#+INCLUDE" function?
I used those two functions. They parsed the directory and listed the org
files. But my lake of skills in elisp programming is obvious!
#+BEGIN_SRC emacs-lisp :exports results
(let ((default-directory "~/path/to/the/directory/posts/"))
(file-expand-wildcards "?org"))
#+END_SRC
#+BEGIN_SRC emacs-lisp :exports results
(directory-files "~/path/to/the/directory/posts/"
nil
"\\.org\\'")
#+END_SRC
2/ When I use "#+INCLUDE" for org files, the exporter mixed the hierarchy
in the HTML generated. Each time I used ":minlevel 1" as argument but the
exporter seem to create a sub-level of hierarchy, which doesn't represent
the true hierarchy in the imported org files? Is it a bug?
I hope it's minimal enough now! Thanks Bastien for Org Mode and helps!
Basile
2012/10/27 Bastien <bzg@altern.org>
> Hi Flammable (!),
>
> flammable project <flammable.project@gmail.com> writes:
>
> > If someone can help me to do this I will really appreciate!
>
> I think we will be able to help with a more limited example.
> Keep it minimal, if possible...
>
> Thanks in advance,
>
> --
> Bastien
>
[-- Attachment #2: Type: text/html, Size: 4072 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to automatic list org files via Elisp and then, import them for an HTML export
2012-10-29 8:34 ` flammable project
@ 2012-12-22 18:50 ` Bastien
0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2012-12-22 18:50 UTC (permalink / raw)
To: flammable project; +Cc: emacs-orgmode
Hi,
flammable project <flammable.project@gmail.com> writes:
> I was thinking that giving the more details will eliminated doubts
> and misunderstanding.
>
> So to be clear enough, there was two questions in my previous
> message:
>
> 1/ In E-LISP, how to parse a directory containing Org files and
> import them with the "#+INCLUDE" function?
MMhh... I've not explored this issue but I don't think including
several files dynamically is a good idea.
> I used those two functions. They parsed the directory and listed
> the org files. But my lake of skills in elisp programming is
> obvious!
> #+BEGIN_SRC emacs-lisp :exports results
> (let ((default-directory "~/path/to/the/directory/posts/"))
> (file-expand-wildcards "?org"))
> #+END_SRC
>
> #+BEGIN_SRC emacs-lisp :exports results
> (directory-files "~/path/to/the/directory/posts/"
> nil
> "\\.org\\'")
> #+END_SRC
>
>
>
> 2/ When I use "#+INCLUDE" for org files, the exporter mixed the
> hierarchy in the HTML generated. Each time I used ":minlevel 1" as
> argument but the exporter seem to create a sub-level of hierarchy,
> which doesn't represent the true hierarchy in the imported org files?
> Is it a bug?
There we need something more concrete to chew on -- can you give the two
source files (the one including and the one included) and explain why
the HTML is wrong?
Thanks,
--
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-22 23:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-26 13:09 How to automatic list org files via Elisp and then, import them for an HTML export flammable project
2012-10-27 10:55 ` Bastien
2012-10-29 8:34 ` flammable project
2012-12-22 18:50 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).