emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] HTML Export/Broken coderef links?
@ 2011-04-12 12:01 Jambunathan K
  2011-04-12 13:18 ` [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link Manuel Giraud
  2011-04-13  9:20 ` [BUG] HTML Export/Broken coderef links? Aankhen
  0 siblings, 2 replies; 6+ messages in thread
From: Jambunathan K @ 2011-04-12 12:01 UTC (permalink / raw)
  To: emacs-orgmode


On HTML export, I am unable to follow references to lines within the
code examples. 

Firefox complains with the following message:

"Firefox doesn't know how to open this address; because the
protocol(coderef) isn't associated with any program."

--8<---------------cut here---------------start------------->8---
**** Advanced Example Blocks

     #+BEGIN_SRC emacs-lisp -n -r
     (save-excursion                  (ref:sc)
        (goto-char (point-min))       (ref:jump)
     #+END_SRC

     In line [[(sc)]] we remember the current position.  [[(jump)][Line (jump)]] jumps
     to point-min.
--8<---------------cut here---------------end--------------->8---



--8<---------------cut here---------------start------------->8---

#+begin_src html
<div id="outline-container-1_1_1_1" class="outline-5">
  <h5 id="sec-1_1_1_1"><span class="section-number-5">1.1.1.1</span> Advanced Example Blocks </h5>
  <div id="text-1_1_1_1" class="outline-text-5">

    <pre class="example"><span id="coderef-sc" class="coderef-off"><span class="linenr">1:  </span>(save-excursion</span>
    <span id="coderef-jump" class="coderef-off"><span class="linenr">2:  </span>   (goto-char (point-min))</span>
    </pre>

    <p>
      In line <a href="coderef:"class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-sc');" onmouseout="CodeHighlightOff(this, 'coderef-sc');">1</a> we remember the current position.  <a href="coderef:"class="coderef" onmouseover="CodeHighlightOn(this, 'coderef-jump');" onmouseout="CodeHighlightOff(this, 'coderef-jump');">Line 2</a> jumps
      to point-min.
    </p>

  </div>

</div>
#+end_src
--8<---------------cut here---------------end--------------->8---

Jambunathan K.
-- 

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

* [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link.
  2011-04-12 12:01 [BUG] HTML Export/Broken coderef links? Jambunathan K
@ 2011-04-12 13:18 ` Manuel Giraud
  2011-04-12 18:58   ` Jambunathan K
  2011-04-15 11:58   ` [Accepted] " Carsten Dominik
  2011-04-13  9:20 ` [BUG] HTML Export/Broken coderef links? Aankhen
  1 sibling, 2 replies; 6+ messages in thread
From: Manuel Giraud @ 2011-04-12 13:18 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Manuel Giraud

---
 lisp/org-html.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 58fbc05..5d53478 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -826,7 +826,8 @@ MAY-INLINE-P allows inlining it as an image."
 		(not type)
 		(string= type "http")
 		(string= type "https")
-		(string= type "file"))
+		(string= type "file")
+		(string= type "coderef"))
 	       (if fragment
 		  (setq thefile (concat thefile "#" fragment))))
 
@@ -836,7 +837,8 @@ MAY-INLINE-P allows inlining it as an image."
 	 (setq thefile
 	    (let
 	       ((str (org-export-html-format-href thefile)))
-	      (if (and type (not (string= "file" type)))
+	      (if (and type (not (or (string= "file" type)
+				     (string= "coderef" type))))
 		  (concat type ":" str)
 		  str)))
 
-- 
1.7.3.5

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

* Re: [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link.
  2011-04-12 13:18 ` [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link Manuel Giraud
@ 2011-04-12 18:58   ` Jambunathan K
  2011-04-15 11:58   ` [Accepted] " Carsten Dominik
  1 sibling, 0 replies; 6+ messages in thread
From: Jambunathan K @ 2011-04-12 18:58 UTC (permalink / raw)
  To: Manuel Giraud; +Cc: emacs-orgmode


Quick feedback. 

Applied the patch to my workarea. My example (which was stolen from
Orgmode manual) gets exported just fine.

Jambunathan K.

Manuel Giraud <manuel.giraud@univ-nantes.fr> writes:

> ---
>  lisp/org-html.el |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index 58fbc05..5d53478 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -826,7 +826,8 @@ MAY-INLINE-P allows inlining it as an image."
>  		(not type)
>  		(string= type "http")
>  		(string= type "https")
> -		(string= type "file"))
> +		(string= type "file")
> +		(string= type "coderef"))
>  	       (if fragment
>  		  (setq thefile (concat thefile "#" fragment))))
>  
> @@ -836,7 +837,8 @@ MAY-INLINE-P allows inlining it as an image."
>  	 (setq thefile
>  	    (let
>  	       ((str (org-export-html-format-href thefile)))
> -	      (if (and type (not (string= "file" type)))
> +	      (if (and type (not (or (string= "file" type)
> +				     (string= "coderef" type))))
>  		  (concat type ":" str)
>  		  str)))

-- 

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

* Re: [BUG] HTML Export/Broken coderef links?
  2011-04-12 12:01 [BUG] HTML Export/Broken coderef links? Jambunathan K
  2011-04-12 13:18 ` [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link Manuel Giraud
@ 2011-04-13  9:20 ` Aankhen
  2011-04-13  9:23   ` Aankhen
  1 sibling, 1 reply; 6+ messages in thread
From: Aankhen @ 2011-04-13  9:20 UTC (permalink / raw)
  To: Jambunathan K, Org-mode ml

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

On Tue, Apr 12, 2011 at 17:31, Jambunathan K <kjambunathan@gmail.com> wrote:
>
> On HTML export, I am unable to follow references to lines within the
> code examples.
>
> Firefox complains with the following message:
>
> "Firefox doesn't know how to open this address; because the
> protocol(coderef) isn't associated with any program."
>
> [snip]

Try the attached patch for a quick fix.  Works here.

Aankhen

[-- Attachment #2: fix-coderefs-in-html.patch --]
[-- Type: application/octet-stream, Size: 735 bytes --]

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 58fbc05..b341e9e 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -826,7 +826,8 @@ MAY-INLINE-P allows inlining it as an image."
 		(not type)
 		(string= type "http")
 		(string= type "https")
-		(string= type "file"))
+		(string= type "file")
+		(string= type "coderef"))
 	       (if fragment
 		  (setq thefile (concat thefile "#" fragment))))
 
@@ -836,7 +837,7 @@ MAY-INLINE-P allows inlining it as an image."
 	 (setq thefile
 	    (let
 	       ((str (org-export-html-format-href thefile)))
-	      (if (and type (not (string= "file" type)))
+	      (if (and type (not (string= "file" type)) (not (string= "coderef" type)))
 		  (concat type ":" str)
 		  str)))
 

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

* Re: [BUG] HTML Export/Broken coderef links?
  2011-04-13  9:20 ` [BUG] HTML Export/Broken coderef links? Aankhen
@ 2011-04-13  9:23   ` Aankhen
  0 siblings, 0 replies; 6+ messages in thread
From: Aankhen @ 2011-04-13  9:23 UTC (permalink / raw)
  To: Jambunathan K, Org-mode ml

Oops, looks like I’m rather late.  Scratch that. :-)

Aankhen

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

* [Accepted] * org-html.el (org-html-make-link): correct a bug in coderef link.
  2011-04-12 13:18 ` [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link Manuel Giraud
  2011-04-12 18:58   ` Jambunathan K
@ 2011-04-15 11:58   ` Carsten Dominik
  1 sibling, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2011-04-15 11:58 UTC (permalink / raw)
  To: emacs-orgmode

Patch 746 (http://patchwork.newartisans.com/patch/746/) is now "Accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1302614330-23496-1-git-send-email-manuel.giraud%40univ-nantes.fr%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] * org-html.el (org-html-make-link): correct a bug in coderef link.
> Date: Tue, 12 Apr 2011 18:18:50 -0000
> From: Manuel Giraud <manuel.giraud@univ-nantes.fr>
> X-Patchwork-Id: 746
> Message-Id: <1302614330-23496-1-git-send-email-manuel.giraud@univ-nantes.fr>
> To: emacs-orgmode@gnu.org
> Cc: Manuel Giraud <manuel.giraud@univ-nantes.fr>
> 
> ---
>  lisp/org-html.el |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index 58fbc05..5d53478 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -826,7 +826,8 @@ MAY-INLINE-P allows inlining it as an image."
>  		(not type)
>  		(string= type "http")
>  		(string= type "https")
> -		(string= type "file"))
> +		(string= type "file")
> +		(string= type "coderef"))
>  	       (if fragment
>  		  (setq thefile (concat thefile "#" fragment))))
>  
> @@ -836,7 +837,8 @@ MAY-INLINE-P allows inlining it as an image."
>  	 (setq thefile
>  	    (let
>  	       ((str (org-export-html-format-href thefile)))
> -	      (if (and type (not (string= "file" type)))
> +	      (if (and type (not (or (string= "file" type)
> +				     (string= "coderef" type))))
>  		  (concat type ":" str)
>  		  str)))
>  
> 

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

end of thread, other threads:[~2011-04-15 12:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 12:01 [BUG] HTML Export/Broken coderef links? Jambunathan K
2011-04-12 13:18 ` [PATCH] * org-html.el (org-html-make-link): correct a bug in coderef link Manuel Giraud
2011-04-12 18:58   ` Jambunathan K
2011-04-15 11:58   ` [Accepted] " Carsten Dominik
2011-04-13  9:20 ` [BUG] HTML Export/Broken coderef links? Aankhen
2011-04-13  9:23   ` Aankhen

Code repositories for project(s) associated with this 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).