Hi, Is there an export option to specify the name of the file to which to export the org file? I use org-mode for my website and I need one page to have a different extension from .html. Thanks, Aidan Gauland
Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> Is there an export option to specify the name of the file to which to
> export the org file?
for documents:
#+TITLE:
and, for subtrees
:PROPERTIES:
:EXPORT_TITLE:
:END:
cheers,
Giovanni
[-- Attachment #1.1: Type: text/plain, Size: 455 bytes --] On Tue, Nov 02, 2010 at 04:44:11PM +0100, Giovanni Ridolfi wrote: > Aidan Gauland <aidalgol@no8wireless.co.nz> writes: > > > Is there an export option to specify the name of the file to which to > > export the org file? > > for documents: > #+TITLE: This doesn't seem to allow me to specify the filename. For example, the file... #+TITLE: bar.goo * A heading foo foo ...is exported (as HTML) to foo.html, not bar.goo. --Aidan [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 201 bytes --] _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Aidan Gauland <aidalgol@no8wireless.co.nz> wrote:
> On Tue, Nov 02, 2010 at 04:44:11PM +0100, Giovanni Ridolfi wrote:
> > Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
>
> > > Is there an export option to specify the name of the file to which to
> > > export the org file?
>
> > for documents:
> > #+TITLE:
>
> This doesn't seem to allow me to specify the filename. For example,
> the file...
>
> #+TITLE: bar.goo
>
> * A heading
> foo foo
>
> ..is exported (as HTML) to foo.html, not bar.goo.
>
If you just need a different extension, I think this works:
--8<---------------cut here---------------start------------->8---
#+BIND: org-export-html-extension "goo"
* foo
foo
* bar
bar
--8<---------------cut here---------------end--------------->8---
and there might be a higher-level way to do that too; e.g. if you are
publishing a project, you can set the :html-extension property, but that
is probably going to affect more than the one file.
Also, I don't know of a way to change the base filename however, and
cursory examination of the code leads me to believe that it is not
possible currently.
HTH,
Nick
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> If you just need a different extension, I think this works:
>
> --8<---------------cut here---------------start------------->8---
> #+BIND: org-export-html-extension "goo"
>
> * foo
> foo
>
> * bar
> bar
> --8<---------------cut here---------------end--------------->8---
Yup, that works perfectly. Thanks!
--Aidan
[-- Attachment #1: Type: text/plain, Size: 1398 bytes --] Hi, I use org-mode for my website, and I've noticed that when I go to publish the website, none of the files I have just edited are updated in the publishing directory. I have no idea why. Here is the elisp I evaluate to publish my website. (setq org-publish-project-alist '(("aidalgolland-orgfiles" :base-directory "~/doc-aidan/aidalgolland/main/" :publishing-directory "/ssh:aidan@nathan7.eu:public_html/aidalgolland/" :publishing-function org-publish-org-to-html :recursive t :base-extension "org" :section-numbers nil :table-of-contents nil :creator-info nil :language "en" :author "Aidan Gauland" :style "<link rel=\"stylesheet\" type=\"text/css\" href=\"/~aidan/aidalgolland/global.css\" />" :auto-preamble t :auto-postamble t) ("aidalgolland-static" :base-directory "~/doc-aidan/aidalgolland/main/" :publishing-directory "/ssh:aidan@nathan7.eu:public_html/aidalgolland/" :publishing-function org-publish-attachment :recursive t :base-extension "css\\|gz\\|bz2\\|lzma\\|jpg\\|gif\\|png\\|atom") ("aidalgolland" :components ("aidalgolland-orgfiles" "aidalgolland-static")))) (org-babel-lob-ingest "~/doc-aidan/aidalgolland/babel-lib.org") (org-publish "aidalgolland") (makunbound 'org-publish-project-alist) Can anyone help me with this? Thanks, Aidan Gauland [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
Aidan Gauland <aidalgol@no8wireless.co.nz> wrote:
> Hi,
>
> I use org-mode for my website, and I've noticed that when I go to
> publish the website, none of the files I have just edited are updated
> in the publishing directory. I have no idea why. Here is the elisp I
> evaluate to publish my website.
>
> (setq
> org-publish-project-alist
> '(("aidalgolland-orgfiles"
> :base-directory "~/doc-aidan/aidalgolland/main/"
> :publishing-directory "/ssh:aidan@nathan7.eu:public_html/aidalgolland/"
> :publishing-function org-publish-org-to-html
> :recursive t
> :base-extension "org"
> :section-numbers nil
> :table-of-contents nil
> :creator-info nil
> :language "en"
> :author "Aidan Gauland"
> :style "<link rel=\"stylesheet\" type=\"text/css\" href=\"/~aidan/aidalgolland/global.css\" />"
> :auto-preamble t
> :auto-postamble t)
>
> ("aidalgolland-static"
> :base-directory "~/doc-aidan/aidalgolland/main/"
> :publishing-directory "/ssh:aidan@nathan7.eu:public_html/aidalgolland/"
> :publishing-function org-publish-attachment
> :recursive t
> :base-extension "css\\|gz\\|bz2\\|lzma\\|jpg\\|gif\\|png\\|atom")
>
> ("aidalgolland" :components ("aidalgolland-orgfiles" "aidalgolland-static"))))
>
> (org-babel-lob-ingest "~/doc-aidan/aidalgolland/babel-lib.org")
> (org-publish "aidalgolland")
>
> (makunbound 'org-publish-project-alist)
>
> Can anyone help me with this?
>
> Thanks,
> Aidan Gauland
org uses timestamps to figure out which files need publishing
(see section 13.4 of the Org manual) and they may have gotten
curdled somehow. You can force publication by giving a second
argument to org-publish (if you called it interactively, you
could do that by giving it a prefix arg):
(org-publish "aidalgolland" t)
Or you can try getting rid of the timestamps (they are stored
in the directory named in the variable org-publish-timestamp-directory
(by default "~/.org-timestamps/") and publish again.
If you can figure out *why* they got out of sync, that would be
a bonus and worth a post here, particularly if you can identify
a bug in the code.
Nick
On Fri, 18 Mar 2011 21:33:04 -0400
Nick Dokos <nicholas.dokos@hp.com> wrote:
> If you can figure out *why* they got out of sync, that would be
> a bonus and worth a post here, particularly if you can identify
> a bug in the code.
I think there was a post sometime earlier where the OP faced this issue
because his setup used symlinks. The timestamps of the symlinks didn't
change so the publishing didn't happen.
--
Suvayu
Open source is the future. It sets us free.
[-- Attachment #1: Type: text/plain, Size: 704 bytes --] At Fri, 18 Mar 2011 19:19:50 -0700, Suvayu Ali wrote: > > On Fri, 18 Mar 2011 21:33:04 -0400 > Nick Dokos <nicholas.dokos@hp.com> wrote: > > > If you can figure out *why* they got out of sync, that would be > > a bonus and worth a post here, particularly if you can identify > > a bug in the code. > > I think there was a post sometime earlier where the OP faced this issue > because his setup used symlinks. The timestamps of the symlinks didn't > change so the publishing didn't happen. The issue with publishing symlinked files was fixed in Januar by b4979a86ca10d058a780440e88c5a3e33c1adff5. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de [-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]
On Sun, 20 Mar 2011 12:30:32 +0100 David Maus <dmaus@ictsoc.de> wrote: > At Fri, 18 Mar 2011 19:19:50 -0700, > Suvayu Ali wrote: > > > > I think there was a post sometime earlier where the OP faced this > > issue because his setup used symlinks. The timestamps of the > > symlinks didn't change so the publishing didn't happen. > > The issue with publishing symlinked files was fixed in Januar by > b4979a86ca10d058a780440e88c5a3e33c1adff5. > Thanks for correcting me David. :) > Best, > -- David -- Suvayu Open source is the future. It sets us free.
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> org uses timestamps to figure out which files need publishing
> (see section 13.4 of the Org manual) and they may have gotten
> curdled somehow. You can force publication by giving a second
> argument to org-publish (if you called it interactively, you
> could do that by giving it a prefix arg):
>
> (org-publish "aidalgolland" t)
>
> Or you can try getting rid of the timestamps (they are stored
> in the directory named in the variable org-publish-timestamp-directory
> (by default "~/.org-timestamps/") and publish again.
>
> If you can figure out *why* they got out of sync, that would be
> a bonus and worth a post here, particularly if you can identify
> a bug in the code.
How can I get the timestamps in a more human-readable format? I keep
having this problem (and no symlinks involved) and keep having to wipe
the timestamps directory (a royal nuisance).
--Aidan
Aidan Gauland <aidalgol@no8wireless.co.nz> wrote:
> Nick Dokos <nicholas.dokos <at> hp.com> writes:
> > org uses timestamps to figure out which files need publishing
> > (see section 13.4 of the Org manual) and they may have gotten
> > curdled somehow. You can force publication by giving a second
> > argument to org-publish (if you called it interactively, you
> > could do that by giving it a prefix arg):
> >
> > (org-publish "aidalgolland" t)
> >
> > Or you can try getting rid of the timestamps (they are stored
> > in the directory named in the variable org-publish-timestamp-directory
> > (by default "~/.org-timestamps/") and publish again.
> >
> > If you can figure out *why* they got out of sync, that would be
> > a bonus and worth a post here, particularly if you can identify
> > a bug in the code.
>
> How can I get the timestamps in a more human-readable format? I keep
> having this problem (and no symlinks involved) and keep having to wipe
> the timestamps directory (a royal nuisance).
>
Doesn't the prefix argument work? C-u C-c C-e followed by F or P or X or E
should republish whatever you specified (file, current project, some project
or all projects resp.), no matter what the cache says.
Nick
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> > How can I get the timestamps in a more human-readable format? I keep
> > having this problem (and no symlinks involved) and keep having to wipe
> > the timestamps directory (a royal nuisance).
>
> Doesn't the prefix argument work? C-u C-c C-e followed by F or P or X or E
> should republish whatever you specified (file, current project, some project
> or all projects resp.), no matter what the cache says.
Yes it does. Sorry, I should have worded that differently. I meant
that I have been repeatedly wiping ~/.org-timestamps/ in hopes that it
will not get screwed up again and think none of my files have changed,
and never re-publishes changed files (after an initial org-publish
operation). I think I have run into a bug in org-mode and I really
want to track it down, so I thought the best place to start would be
to look at what the timestamps are (in a human-readable format).
--Aidan
Aidan Gauland <aidalgol@no8wireless.co.nz> wrote:
>
> Yes it does. Sorry, I should have worded that differently. I meant
> that I have been repeatedly wiping ~/.org-timestamps/ in hopes that it
> will not get screwed up again and think none of my files have changed,
> and never re-publishes changed files (after an initial org-publish
> operation). I think I have run into a bug in org-mode and I really
> want to track it down, so I thought the best place to start would be
> to look at what the timestamps are (in a human-readable format).
>
OK - thanks. I started taking a look at the code, but I'm not getting
anywhere fast, so the more eyes we can have on it the better.
I believe what happens is that the in-memory cache is initialized from
the files in ~/.org-timestamps the first time that you try to publish
(I'm not sure yet when the cache is flushed back out to the files yet).
Here is one of the timestamp files:
,----
| (setq org-publish-cache (make-hash-table :test 'equal :weakness nil :size 100))
| (puthash ":project:" "worg-org-faq" org-publish-cache)
| (puthash ":cache-file:" "/home/nick/.org-timestamps/worg-org-faq.cache" org-publish-cache)
| (puthash "Xd2e1407553750278e966c6cda86f154ffa648149" 1299616514 org-publish-cache)
`----
It's a simple key-value store: (puthash key value table) does the
obvious thing, so the timestamp here is 1299616514 for the object with
key Xd2e1407553750278e966c6cda86f154ffa648149. The timestamp is the
ctime of the file, obtained by calling file-attributes, getting the
5th element, the last modification time. This is returned as a list
of two integers (high, low16) which are then combined into a single
integer: that's the time since 1970-01-01:00:00:00, the usual Unix
time.
In the above case, I calculate as follows (lsh is a shift function -
(lsh val 16) shifts left by 16, (lsh val -16) shifts right by 16):
high bits: (lsh 1299616514 -16) -> 19830
low bits: (- 1299616514 (lsh 19830 16)) -> 37634
So encoded time is (19830 37364)
Decoded time: (decode-time '(19830 37634)) -> (14 35 15 8 3 2011 2 nil -18000)
that is 14:35:15 08-03-2011 dow=2(=Tuesday) dst=nil(= no dst - the
switch happened later) zone=-18000 (in seconds - that is -5GMT in
hours).
So you might try the following simple helper function:
--8<---------------cut here---------------start------------->8---
(defun org-ts-to-hr (ts)
(let* ((high (lsh ts -16))
(low (- ts (lsh high 16))))
(decode-time (list high low))))
--8<---------------cut here---------------end--------------->8---
(org-ts-to-hr 1299616514) -> (14 35 15 8 3 2011 2 nil -18000)
Note that it may not be the timestamp itself that's at fault: it may
be the key. If we calculate a key and go look in the cache and don't
find it, then the file is considered out of date. But I guess this
is the opposite behavior of what you see. Never mind...
HTH,
Nick
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> Aidan Gauland <aidalgol <at> no8wireless.co.nz> wrote:
> > Yes it does. Sorry, I should have worded that differently. I meant
> > that I have been repeatedly wiping ~/.org-timestamps/ in hopes that it
> > will not get screwed up again and think none of my files have changed,
> > and never re-publishes changed files (after an initial org-publish
> > operation). I think I have run into a bug in org-mode and I really
> > want to track it down, so I thought the best place to start would be
> > to look at what the timestamps are (in a human-readable format).
> >
>
> OK - thanks. I started taking a look at the code, but I'm not getting
> anywhere fast, so the more eyes we can have on it the better.
Actually, we can forget about the timestamps. I finally figured out
what circumstances under which this bug happens: I am trying to export
from a system where some of the symlinks in the project are broken.
Here's my setup: I sync my home directory on my laptop and desktop
computers using Unison. In my project, I have symlinks to files in
~/images/, but since my laptop hard drive has less capacity than the
one in my desktop, I only keep ~/images/ on my desktop. As a result
of this setup, some symlinks in my org-mode project are broken on my
laptop. When I publish my project on my desktop, where no symlinks
are broken, org-publish behaves as expected; when I publish the same
project on my laptop, where some symlinks are broken, org-publish
appears to succeed, but publishes no changes.
I am really sorry for such a delayed response, but my university
semester started up again, which has been really hectic because of the
Feburary Christchurch earthquake.
Kind regards,
Aidan Gauland