all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* incorrect HTML rendering of info links with spaces
@ 2015-04-08  7:32 Richard Y. Kim
  2015-04-08 15:53 ` Nick Dokos
  2015-04-10  8:40 ` Nicolas Goaziou
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Y. Kim @ 2015-04-08  7:32 UTC (permalink / raw)
  To: emacs-orgmode


It seems like org-html-publish-to-html does not translate info links
properly in generated HTML files.  The problem is that spaces in info
nodes should be converted to dashes, but instead spaces are left as is.

For example org-mode link [[info:elisp#Hash Tables]] is converted as 

    <a href="elisp#Hash Tables">elisp#Hash Tables</a>

when in fact the correct URL that should be generated is

    <a href="elisp.html#Hash-Tables">elisp#Hash Tables</a>

where a dash is used in the URL as well as ".html" suffix.

Why should it be "-" instead of " "?  Simply because that is the
convention used by GNU makeinfo when translating texinfo files into HTML
output.  For example

    http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash-Tables

is the correct URL rather than this incorrect URL:

    http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash%20Tables

So today if I hit C-c C-o on [[info:elisp#Hash Tables]] link, then it
correctly brings up "(elisp) Hash Tables" info node.  However the
generated HTML link does not work.  On the other hand
[[info:elisp#Hash-Tables]] with a dash rather than space generates valid
HTML link (ignoring missing ".html" suffix), but C-c C-o fails to work.
It would be very useful if the same org link such as [[info:elisp#Hash
Tables]] works for both C-c C-o as well as generate valid HTML link.

This issue is important to me, because I would rather use org-mode than
texinfo to write documentation on emacs packages with many links
pointing to the official emacs and elisp manuals.  Right now lack of
proper support for info links in org-mode is the *only* reason why I
currently use texinfo rather than org-mode.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: incorrect HTML rendering of info links with spaces
  2015-04-08  7:32 incorrect HTML rendering of info links with spaces Richard Y. Kim
@ 2015-04-08 15:53 ` Nick Dokos
  2015-04-10  8:40 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2015-04-08 15:53 UTC (permalink / raw)
  To: emacs-orgmode

emacs18@gmail.com (Richard Y. Kim) writes:

> It seems like org-html-publish-to-html does not translate info links
> properly in generated HTML files.  The problem is that spaces in info
> nodes should be converted to dashes, but instead spaces are left as is.
>
> For example org-mode link [[info:elisp#Hash Tables]] is converted as 
>
>     <a href="elisp#Hash Tables">elisp#Hash Tables</a>
>
> when in fact the correct URL that should be generated is
>
>     <a href="elisp.html#Hash-Tables">elisp#Hash Tables</a>
>
> where a dash is used in the URL as well as ".html" suffix.
>
> Why should it be "-" instead of " "?  Simply because that is the
> convention used by GNU makeinfo when translating texinfo files into HTML
> output.  For example
>
>     http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash-Tables
>
> is the correct URL rather than this incorrect URL:
>
>     http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash%20Tables
>
> So today if I hit C-c C-o on [[info:elisp#Hash Tables]] link, then it
> correctly brings up "(elisp) Hash Tables" info node.  However the
> generated HTML link does not work.  On the other hand
> [[info:elisp#Hash-Tables]] with a dash rather than space generates valid
> HTML link (ignoring missing ".html" suffix), but C-c C-o fails to work.
> It would be very useful if the same org link such as [[info:elisp#Hash
> Tables]] works for both C-c C-o as well as generate valid HTML link.
>
> This issue is important to me, because I would rather use org-mode than
> texinfo to write documentation on emacs packages with many links
> pointing to the official emacs and elisp manuals.  Right now lack of
> proper support for info links in org-mode is the *only* reason why I
> currently use texinfo rather than org-mode.

I believe there is provision for that in org-link-protocols:

 ...
 ("man" org-man-open org-man-export)
 ...
 ("info" org-info-open nil)

The info entry has an org-info-open entry but the second entry
is nil. You can replace that with org-info-export and write the
org-info-export function to DTRT. You can use the org-man-export
function as a model.

Maybe you can submit a patch?

Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: incorrect HTML rendering of info links with spaces
  2015-04-08  7:32 incorrect HTML rendering of info links with spaces Richard Y. Kim
  2015-04-08 15:53 ` Nick Dokos
@ 2015-04-10  8:40 ` Nicolas Goaziou
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2015-04-10  8:40 UTC (permalink / raw)
  To: Richard Y. Kim; +Cc: emacs-orgmode

Hello,

emacs18@gmail.com (Richard Y. Kim) writes:

> It seems like org-html-publish-to-html does not translate info links
> properly in generated HTML files.  The problem is that spaces in info
> nodes should be converted to dashes, but instead spaces are left as is.
>
> For example org-mode link [[info:elisp#Hash Tables]] is converted as 
>
>     <a href="elisp#Hash Tables">elisp#Hash Tables</a>
>
> when in fact the correct URL that should be generated is
>
>     <a href="elisp.html#Hash-Tables">elisp#Hash Tables</a>
>
> where a dash is used in the URL as well as ".html" suffix.
>
> Why should it be "-" instead of " "?  Simply because that is the
> convention used by GNU makeinfo when translating texinfo files into HTML
> output.  For example
>
>     http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash-Tables
>
> is the correct URL rather than this incorrect URL:
>
>     http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Hash%20Tables
>
> So today if I hit C-c C-o on [[info:elisp#Hash Tables]] link, then it
> correctly brings up "(elisp) Hash Tables" info node.  However the
> generated HTML link does not work.  On the other hand
> [[info:elisp#Hash-Tables]] with a dash rather than space generates valid
> HTML link (ignoring missing ".html" suffix), but C-c C-o fails to work.
> It would be very useful if the same org link such as [[info:elisp#Hash
> Tables]] works for both C-c C-o as well as generate valid HTML link.
>
> This issue is important to me, because I would rather use org-mode than
> texinfo to write documentation on emacs packages with many links
> pointing to the official emacs and elisp manuals.  Right now lack of
> proper support for info links in org-mode is the *only* reason why I
> currently use texinfo rather than org-mode.

Done in 7b97b631ef980b9b63ebc3f3fb38295a90ade90d. Thank you.

Note that there is also a texinfo export back-end for Org.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-10  8:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-08  7:32 incorrect HTML rendering of info links with spaces Richard Y. Kim
2015-04-08 15:53 ` Nick Dokos
2015-04-10  8:40 ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.