From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Hans Subject: Bug: Dead links from clocking tables to other org files in HTML export [9.1.3 (9.1.3-2-g322612-elpa @ /home/mrhn/.emacs.d/elpa/org-20171120/)] Date: Fri, 24 Nov 2017 13:00:52 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c1cb8f026684d055ec0d9f7" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIL5l-0000HI-Uk for emacs-orgmode@gnu.org; Fri, 24 Nov 2017 16:01:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIL5j-0000wA-VN for emacs-orgmode@gnu.org; Fri, 24 Nov 2017 16:00:58 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:46537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIL5j-0000vu-If for emacs-orgmode@gnu.org; Fri, 24 Nov 2017 16:00:55 -0500 Received: by mail-wr0-x244.google.com with SMTP id r2so14890170wra.13 for ; Fri, 24 Nov 2017 13:00:55 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --94eb2c1cb8f026684d055ec0d9f7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When exporting my project with org-publish, the exporter generates anchors with names such as "orga79e495" and refers to them when linking to the headers from other files. However, the generated anchor names don't match between files, resulting in all links being dead. Furthermore, the publishing directory is not respected, so all links still point to the directory that the org file was in, even though the html files are located elsewhere. Example: I have put the files needed to reproduce this at https://gist.github.com/martinhansdk/f81a5fdf340eab591e6df55645cfd22d They can be viewed there or fetched with git: git clone https://gist.github.com/martinhansdk/ f81a5fdf340eab591e6df55645cfd22d Run emacs -Q -l minimal-org.el Then export with M-x org-publish org I get files in the exported/ subdirectory. The last link in the clocking table in exported/time.html is Worked on supporting =C3=A4, =C3=B6, and =C3=BC But that should have been Worked on supporting =C3=A4, =C3=B6= , and =C3=BC Note that both the path is absolute where it should have been relative and the anchor is wrong. As far as I can tell, both problems stem from the fact that the links in the clocking table are absolute file system links. This is, however how the clock table code (org-dblock-update) formats the table. If I manually transform the links in time.org to manual links, then the HTML links are no longer dead. As an aside, is there any way to prevent the following line from appearing in the exported HTML? #+BEGIN: clocktable :scope agenda :link t :maxlevel 5 Thanks, Martin Emacs : GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-12 on hullmann, modified by Debian Package: Org mode version 9.1.3 (9.1.3-2-g322612-elpa @ /home/mrhn/.emacs.d/elpa/org-20171120/) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-link-file-path-type 'relative org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"= ] org-latex-format-inlinetask-function 'org-latex-format-inlinetask- default-function org-confirm-shell-link-function 'yes-or-no-p org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-latex-format-headline-function 'org-latex-format-headline- default-function org-after-todo-state-change-hook '(org-clock-out-if-current) org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn ## CONTENTS)"] org-odt-format-headline-function 'org-odt-format-headline-default-function org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-block-all append local] 5 "\n\n(fn)"] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all appen= d local] 5 "\n\n(fn)"] org-babel-result-hide-spec org-babel-hide-all-hashes) org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-archive-hook '(org-attach-archive-delete-maybe) org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] org-odt-format-inlinetask-function 'org-odt-format-inlinetask- default-function org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-html-format-headline-function 'org-html-format-headline- default-function org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow org-rmail-open :store org-rmail-store-link) ("mhe" :follow org-mhe-open :store org-mhe-store-link) ("irc" :follow org-irc-visit :store org-irc-store-link) ("info" :follow org-info-open :export org-info-export :store org-info-store-link) ("gnus" :follow org-gnus-open :store org-gnus-store-link) ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link) ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link) ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store org-bbdb-store-link) ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs"= ) ("doi" :follow org--open-doi-link) ("elisp" :follow org--open-elisp-link) ("file" :complete org-file-complete-link) ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path)))) ("help" :follow org--open-help-link) ("http" :follow (lambda (path) (browse-url (concat "http:" path)))) ("https" :follow (lambda (path) (browse-url (concat "https:" path)))) ("mailto" :follow (lambda (path) (browse-url (concat "mailto:" path)))) ("news" :follow (lambda (path) (browse-url (concat "news:" path)))) ("shell" :follow org--open-shell-link)) org-html-format-inlinetask-function 'org-html-format-inlinetask- default-function org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-publish-project-alist '(("org-notes" :base-directory "." :base-extension "org" :publishing-directory "exported/" :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t) ("org-static" :base-directory "." :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" :publishing-directory "exported/" :recursive t :publishing-function org-publish-attachment) ("org" :components ("org-notes" "org-static"))) ) --94eb2c1cb8f026684d055ec0d9f7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When exporting my project with org-publish, the exporter g= enerates
anchors with names such as "orga79e495" and refers to= them when linking
to the headers from other files. However, the generat= ed anchor names
don't match between files, resulting in all links be= ing dead.

Furthermore, the publishing directory is not respected, so= all links
still point to the directory that the org file was in, even t= hough the
html files are located elsewhere.

Example:

I hav= e put the files needed to reproduce this at
htt= ps://gist.github.com/martinhansdk/f81a5fdf340eab591e6df55645cfd2<= wbr>2d
They can be viewed there or fetched with git:

=C2=A0= =C2=A0=C2=A0 git clone https://gist.github.com/martinhansdk/f81a5fdf340eab591e6df55645cfd22d

Run em= acs -Q -l minimal-org.el

Then export with M-x org-publish org
I get files in the exported/ subdirectory.

The last link in the cl= ocking table in exported/time.html is

=C2=A0=C2=A0=C2=A0 <a href= =3D"file:///home/mrhn/bugreports/orgmode-html/journal.html#o= rg2f3d7f7">Worked on supporting =C3=A4, =C3=B6, and =C3=BC<= /a>

But that should have been

=C2=A0=C2=A0=C2=A0 <a hre= f=3D"journal.html#org5c71d1e">Worked on supporting =C3=A4= , =C3=B6, and =C3=BC</a>

Note that both the path is absolute w= here it should have been relative
and the anchor is wrong.

As far= as I can tell, both problems stem from the fact that the links in
the c= locking table are absolute file system links. This is, however how
the c= lock table code (org-dblock-update) formats the table. If I
manually tra= nsform the links in time.org<= /a> to manual links, then the HTML
links are no longer dead.


= As an aside, is there any way to prevent the following line from
appeari= ng in the exported HTML?

=C2=A0=C2=A0=C2=A0 #+BEGIN: clocktable :sco= pe agenda :link t :maxlevel 5


Thanks,
=C2=A0 Martin

<= br>Emacs=C2=A0 : GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.1= 1)
=C2=A0of 2017-09-12 on hullmann, modified by Debian
Package: Org m= ode version 9.1.3 (9.1.3-2-g322612-elpa @ /home/mrhn/.emacs.d/elpa/org-20171120/)

current state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
(setq
=C2=A0org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
=C2=A0org-speed-command-hook= '(org-speed-command-activate org-babel-speed-command-activate)=C2=A0org-link-file-path-type 'relative
=C2=A0org-occur-hook '(= org-first-headline-recenter)
=C2=A0org-metaup-hook '(org-babel-load-= in-session-maybe)
=C2=A0org-html-format-drawer-function #[514 = "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
=C2=A0org-late= x-format-inlinetask-function 'org-latex-format-inlinetask-def= ault-function
=C2=A0org-confirm-shell-link-function 'yes-or-no-= p
=C2=A0org-ascii-format-inlinetask-function 'org-ascii-format-= inlinetask-default
=C2=A0org-latex-format-headline-function &#= 39;org-latex-format-headline-default-function
=C2=A0org-after-todo-= state-change-hook '(org-clock-out-if-current)
=C2=A0org-latex-f= ormat-drawer-function #[514 "\207" [] 3 "\n\n(fn ## CON= TENTS)"]
=C2=A0org-odt-format-headline-function 'org-odt-f= ormat-headline-default-function
=C2=A0org-src-mode-hook '(org-s= rc-babel-configure-edit-buffer
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0=C2=A0 org-src-mode-configure-edit-buffer)
= =C2=A0org-agenda-before-write-hook '(org-agenda-add-entry-text)
=C2= =A0org-babel-pre-tangle-hook '(save-buffer)
=C2=A0org-mode-hook '= ;(#[0 "\300\301\302\303\304$\207"
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0 [add-hook change-major-mode-hook org-show-block-all = append local] 5
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 "= ;\n\n(fn)"]
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0#[0 "\= 300\301\302\303\304$\207"
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0 [add-hook change-major-mode-hook org-babel-show-result-all append=
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 local]
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 5 "\n\n(fn)"]
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0org-babel-result-hide-spec org-= babel-hide-all-hashes)
=C2=A0org-bibtex-headline-format-function #[= 257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
=C2= =A0org-archive-hook '(org-attach-archive-delete-maybe)
=C2=A0or= g-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(= fn NAME CONTENTS WIDTH)"]
=C2=A0org-odt-format-inlinetask-func= tion 'org-odt-format-inlinetask-default-function
=C2=A0org-cycl= e-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 org-cycle-show-empty-lines=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 org-optimize-window-after-visibility-change)
=C2=A0org-confirm-elisp-link-function 'ye= s-or-no-p
=C2=A0org-metadown-hook '(org-babel-pop-to-session-ma= ybe)
=C2=A0org-odt-format-drawer-function #[514 "\207" []= 3 "\n\n(fn NAME CONTENTS)"]
=C2=A0org-html-format-headline-function 'org-html-format-headline-default-function
=C2=A0or= g-link-parameters '(("id" :follow org-id-open)
=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("rm= ail" :follow org-rmail-open :store org-rmail-store-link)
=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("mh= e" :follow org-mhe-open :store org-mhe-store-link)
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("irc"= ; :follow org-irc-visit :store org-irc-store-link)
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("info" := follow org-info-open :export org-info-export :store
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 org-info-store-link)
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("gnus&= quot; :follow org-gnus-open :store org-gnus-store-link)
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("docview&= quot; :follow org-docview-open :export org-docview-export
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 :store org-docview-store-link)=
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ("bibtex" :follow org-bibtex-open :store org-bibtex-store-lin= k)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ("bbdb" :follow org-bbdb-open :export org-bbdb-export :com= plete
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 org-bbdb-= complete-link :store org-bbdb-store-link)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("w3m" :store org-= w3m-store-link) ("file+sys") ("file+emacs")
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("= ;doi" :follow org--open-doi-link)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("elisp" :follow org-= -open-elisp-link)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 ("file" :complete org-file-complete-link)=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ("ftp" :follow (lambda (path) (browse-url (concat "ftp:&= quot; path))))
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ("help" :follow org--open-help-link)
=C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("= ;http" :follow
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 (lambda (path) (browse-url (concat "http:" path))))
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (&q= uot;https" :follow
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 (lambda (path) (browse-url (concat "https:" path))))=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ("mailto" :follow
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 (lambda (path) (browse-url (concat "mailto:" path= ))))
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ("news" :follow
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 (lambda (path) (browse-url (concat "news:"= path))))
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ("shell" :follow org--open-shell-link))
=C2=A0org= -html-format-inlinetask-function 'org-html-format-inlinetask-= default-function
=C2=A0org-clock-out-hook '(org-clock-remove-empty-<= wbr>clock-drawer)
=C2=A0org-publish-project-alist '(("org-notes= " :base-directory "." :base-extension "org"
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 :publishing-directory "exported/" :recursive t
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 :publishing-function org-html-publish-to-html
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :h= eadline-levels 4 :auto-preamble t)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 ("org-static" :base-= directory "." :base-extension
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "css\\|js\\|p= ng\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :publishi= ng-directory "exported/" :recursive t
=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :publishi= ng-function org-publish-attachment)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 ("org" :component= s ("org-notes" "org-static")))
=C2=A0)
--94eb2c1cb8f026684d055ec0d9f7--