emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Javascript Export Issue
@ 2009-03-07  2:30 srandby
  2009-03-07 10:14 ` Sebastian Rose
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: srandby @ 2009-03-07  2:30 UTC (permalink / raw)
  To: [Orgmode]

Greetings,

When I export (using org-mode 6.23) to html an org file that has options 
for org-info.js, the html file contains this:

<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
THE SCRIPT
/*]]>*/-->
</script>

Earlier versions of org-mode exported scripts this way:

<script type="text/javascript">
/* <![CDATA[ */
THE SCRIPT
/* ]]> */
</script>

Today, I discovered that the first script listed above will work with 
Firefox, but not with Safari (I don't know about IE). After some 
research, I discovered several fixes, including the old way of 
exporting, the easiest being:

<script type="text/javascript">
<!--
THE SCRIPT
-->
</script>


I realize there are issues here with the differences between html 
browsers and xml browsers, so I've decided that I would like to have 
scripts (and styles) exported as separate files. Is this possible?

When I export my org file to html, the html file contains one style 
section and two script sections. If these three were instead exported to 
separate files, that would eliminate the need to worry about how to 
enclose styles and scripts with comments in a way that works for all 
browsers. Of course, then org-mode would be creating four files instead 
of one, but I would like to have this option. Everything I've read about 
this matter recommends keeping styles and scripts as external files.

When I create the three files manually and edit the html file 
appropriately, the html file lacks all the style and script code which 
is replaced by:

<link rel="stylesheet" type="text/css" href="gen-style.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="org-info.v.0.1.0.5.js"></script>
<script type="text/javascript" src="org-html.js"></script>
<script type="text/javascript" src="mystery.js"></script>

Here gen-style.css contains the style generated by org-mode, style.css 
is my own style, org-html.js is the first script generated by org-mode, 
and mystery.js is the second script generated by org-mode (it is 
mysterious to me).

Scott Randby

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

* Re: Javascript Export Issue
  2009-03-07  2:30 Javascript Export Issue srandby
@ 2009-03-07 10:14 ` Sebastian Rose
  2009-03-07 10:23 ` Sebastian Rose
  2009-03-07 10:30 ` Carsten Dominik
  2 siblings, 0 replies; 7+ messages in thread
From: Sebastian Rose @ 2009-03-07 10:14 UTC (permalink / raw)
  To: srandby; +Cc: [Orgmode]

Hi Scott,


True. Safari needs this one here (note the two additional slashes in the
second last line):


<script type="text/javascript">
 <!--/*--><![CDATA[/*><!--*/
 THE SCRIPT
 /*]]>*///-->
</script>


Sorry. I'll search the org sources and compile a patch for this issue.



srandby@gmail.com writes:
> Greetings,
>
> When I export (using org-mode 6.23) to html an org file that has options for
> org-info.js, the html file contains this:
>
> <script type="text/javascript">
> <!--/*--><![CDATA[/*><!--*/
> THE SCRIPT
> /*]]>*/-->
> </script>
>
> Earlier versions of org-mode exported scripts this way:
>
> <script type="text/javascript">
> /* <![CDATA[ */
> THE SCRIPT
> /* ]]> */
> </script>
>
> Today, I discovered that the first script listed above will work with Firefox,
> but not with Safari (I don't know about IE). After some research, I discovered
> several fixes, including the old way of exporting, the easiest being:
>
> <script type="text/javascript">
> <!--
> THE SCRIPT
> -->
> </script>


This is not valid XHTML because of the missing `<![CDATA[' tags. XML
parsers will stop when reading the JavaScript code.




>
> I realize there are issues here with the differences between html browsers and
> xml browsers, so I've decided that I would like to have scripts (and styles)
> exported as separate files. Is this possible?
>
> When I export my org file to html, the html file contains one style section and
> two script sections. If these three were instead exported to separate files,
> that would eliminate the need to worry about how to enclose styles and scripts
> with comments in a way that works for all browsers. Of course, then org-mode
> would be creating four files instead of one, but I would like to have this
> option. Everything I've read about this matter recommends keeping styles and
> scripts as external files.
>
> When I create the three files manually and edit the html file appropriately, the
> html file lacks all the style and script code which is replaced by:
>
> <link rel="stylesheet" type="text/css" href="gen-style.css">
> <link rel="stylesheet" type="text/css" href="style.css">
> <script type="text/javascript" src="org-info.v.0.1.0.5.js"></script>
> <script type="text/javascript" src="org-html.js"></script>
> <script type="text/javascript" src="mystery.js"></script>


Good idea.
But this should be valid XHTML too:

<link rel="stylesheet" type="text/css" href="gen-style.css" />
<link rel="stylesheet" type="text/css" href="style.css" />


Regards,


-- 
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.:  +49 (0)511 - 36 58 472
Fax:   +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Email: s.rose@emma-stil.de, sebastian_rose@gmx.de
Http:  www.emma-stil.de

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

* Re: Javascript Export Issue
  2009-03-07  2:30 Javascript Export Issue srandby
  2009-03-07 10:14 ` Sebastian Rose
@ 2009-03-07 10:23 ` Sebastian Rose
  2009-03-07 10:28   ` Carsten Dominik
  2009-03-07 10:32   ` Carsten Dominik
  2009-03-07 10:30 ` Carsten Dominik
  2 siblings, 2 replies; 7+ messages in thread
From: Sebastian Rose @ 2009-03-07 10:23 UTC (permalink / raw)
  To: srandby; +Cc: [Orgmode]

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


Here's the patch to fix this issue.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Make JavaScript work in Safari --]
[-- Type: text/x-diff, Size: 857 bytes --]

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index c21755a..952eb9a 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -563,7 +563,7 @@ not be modified."
    if(elem.cacheClassTarget)
      target.className = elem.cacheClassTarget;
  }
-/*]]>*/-->
+/*]]>*///-->
 </script>"
 "Basic javascript that is needed by HTML files produced by Org-mode.")
 
diff --git a/lisp/org-jsinfo.el b/lisp/org-jsinfo.el
index 285169b..b24f65b 100644
--- a/lisp/org-jsinfo.el
+++ b/lisp/org-jsinfo.el
@@ -110,7 +110,7 @@ means to use the maximum value consistent with other options."
 <!--/*--><![CDATA[/*><!--*/
 %MANAGER_OPTIONS
 org_html_manager.setup();  // activate after the parameters are set
-/*]]>*/-->
+/*]]>*///-->
 </script>"
   "The template for the export style additions when org-info.js is used.
 Option settings will replace the %MANAGER-OPTIONS cookie."

[-- Attachment #3: Type: text/plain, Size: 197 bytes --]


-- 
Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449 Hannover
Tel.:  +49 (0)511 - 36 58 472
Fax:   +49 (0)1805 - 233633 - 11044
mobil: +49 (0)173 - 83 93 417
Http:  www.emma-stil.de

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Javascript Export Issue
  2009-03-07 10:23 ` Sebastian Rose
@ 2009-03-07 10:28   ` Carsten Dominik
  2009-03-07 10:32   ` Carsten Dominik
  1 sibling, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-03-07 10:28 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: srandby, [Orgmode]

Hi Sebastian,

I take it this will continue to work on other browsers?

- Carsten

On Mar 7, 2009, at 11:23 AM, Sebastian Rose wrote:

>
> Here's the patch to fix this issue.
>
>
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index c21755a..952eb9a 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -563,7 +563,7 @@ not be modified."
>    if(elem.cacheClassTarget)
>      target.className = elem.cacheClassTarget;
>  }
> -/*]]>*/-->
> +/*]]>*///-->
> </script>"
> "Basic javascript that is needed by HTML files produced by Org-mode.")
>
> diff --git a/lisp/org-jsinfo.el b/lisp/org-jsinfo.el
> index 285169b..b24f65b 100644
> --- a/lisp/org-jsinfo.el
> +++ b/lisp/org-jsinfo.el
> @@ -110,7 +110,7 @@ means to use the maximum value consistent with  
> other options."
> <!--/*--><![CDATA[/*><!--*/
> %MANAGER_OPTIONS
> org_html_manager.setup();  // activate after the parameters are set
> -/*]]>*/-->
> +/*]]>*///-->
> </script>"
>   "The template for the export style additions when org-info.js is  
> used.
> Option settings will replace the %MANAGER-OPTIONS cookie."
>
> -- 
> Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449  
> Hannover
> Tel.:  +49 (0)511 - 36 58 472
> Fax:   +49 (0)1805 - 233633 - 11044
> mobil: +49 (0)173 - 83 93 417
> Http:  www.emma-stil.de
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Javascript Export Issue
  2009-03-07  2:30 Javascript Export Issue srandby
  2009-03-07 10:14 ` Sebastian Rose
  2009-03-07 10:23 ` Sebastian Rose
@ 2009-03-07 10:30 ` Carsten Dominik
  2009-03-08  2:20   ` srandby
  2 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2009-03-07 10:30 UTC (permalink / raw)
  To: srandby; +Cc: [Orgmode]


[-- Attachment #1.1: Type: text/plain, Size: 3447 bytes --]

Hi Scott,

I do not think it makes sense to automatically produce these files.
Among other things, it would mean that the extra files are
produces for every single export of a file.
If you want external files, You likely will use the
same for a set of pages.

After pulling the latest version you can do this:

1. prepare any style files and script files you want to use

2. do this

(setq org-export-html-style-include-default nil)
(setq org-export-html-style-include-scripts nil)
(setq org-export-html-style
    "<link rel="stylesheet" type="text/css" href="gen-style.css">
     <link rel="stylesheet" type="text/css" href="style.css">
     <script type="text/javascript" src="org-info.v.0.1.0.5.js"></ 
script>
     <script type="text/javascript" src="org-html.js"></script>
     <script type="text/javascript" src="mystery.js"></script>")


Instead of the last setting, you can also use #+STYLE in a file
to specify the style files for this particular page.

HTH

- Carsten


>


On Mar 7, 2009, at 3:30 AM, srandby@gmail.com wrote:

> Greetings,
>
> When I export (using org-mode 6.23) to html an org file that has  
> options for org-info.js, the html file contains this:
>
> <script type="text/javascript">
> <!--/*--><![CDATA[/*><!--*/
> THE SCRIPT
> /*]]>*/-->
> </script>
>
> Earlier versions of org-mode exported scripts this way:
>
> <script type="text/javascript">
> /* <![CDATA[ */
> THE SCRIPT
> /* ]]> */
> </script>
>
> Today, I discovered that the first script listed above will work  
> with Firefox, but not with Safari (I don't know about IE). After  
> some research, I discovered several fixes, including the old way of  
> exporting, the easiest being:
>
> <script type="text/javascript">
> <!--
> THE SCRIPT
> -->
> </script>
>
>
> I realize there are issues here with the differences between html  
> browsers and xml browsers, so I've decided that I would like to have  
> scripts (and styles) exported as separate files. Is this possible?
>
> When I export my org file to html, the html file contains one style  
> section and two script sections. If these three were instead  
> exported to separate files, that would eliminate the need to worry  
> about how to enclose styles and scripts with comments in a way that  
> works for all browsers. Of course, then org-mode would be creating  
> four files instead of one, but I would like to have this option.  
> Everything I've read about this matter recommends keeping styles and  
> scripts as external files.
>
> When I create the three files manually and edit the html file  
> appropriately, the html file lacks all the style and script code  
> which is replaced by:
>
> <link rel="stylesheet" type="text/css" href="gen-style.css">
> <link rel="stylesheet" type="text/css" href="style.css">
> <script type="text/javascript" src="org-info.v.0.1.0.5.js"></script>
> <script type="text/javascript" src="org-html.js"></script>
> <script type="text/javascript" src="mystery.js"></script>
>
> Here gen-style.css contains the style generated by org-mode,  
> style.css is my own style, org-html.js is the first script generated  
> by org-mode, and mystery.js is the second script generated by org- 
> mode (it is mysterious to me).
>
> Scott Randby
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[-- Attachment #1.2: Type: text/html, Size: 4360 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Javascript Export Issue
  2009-03-07 10:23 ` Sebastian Rose
  2009-03-07 10:28   ` Carsten Dominik
@ 2009-03-07 10:32   ` Carsten Dominik
  1 sibling, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2009-03-07 10:32 UTC (permalink / raw)
  To: Sebastian Rose; +Cc: srandby, [Orgmode]

Applied, thanks.

- Carsten

On Mar 7, 2009, at 11:23 AM, Sebastian Rose wrote:

>
> Here's the patch to fix this issue.
>
>
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index c21755a..952eb9a 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -563,7 +563,7 @@ not be modified."
>    if(elem.cacheClassTarget)
>      target.className = elem.cacheClassTarget;
>  }
> -/*]]>*/-->
> +/*]]>*///-->
> </script>"
> "Basic javascript that is needed by HTML files produced by Org-mode.")
>
> diff --git a/lisp/org-jsinfo.el b/lisp/org-jsinfo.el
> index 285169b..b24f65b 100644
> --- a/lisp/org-jsinfo.el
> +++ b/lisp/org-jsinfo.el
> @@ -110,7 +110,7 @@ means to use the maximum value consistent with  
> other options."
> <!--/*--><![CDATA[/*><!--*/
> %MANAGER_OPTIONS
> org_html_manager.setup();  // activate after the parameters are set
> -/*]]>*/-->
> +/*]]>*///-->
> </script>"
>   "The template for the export style additions when org-info.js is  
> used.
> Option settings will replace the %MANAGER-OPTIONS cookie."
>
> -- 
> Sebastian Rose, EMMA STIL - mediendesign, Niemeyerstr.6, 30449  
> Hannover
> Tel.:  +49 (0)511 - 36 58 472
> Fax:   +49 (0)1805 - 233633 - 11044
> mobil: +49 (0)173 - 83 93 417
> Http:  www.emma-stil.de
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Javascript Export Issue
  2009-03-07 10:30 ` Carsten Dominik
@ 2009-03-08  2:20   ` srandby
  0 siblings, 0 replies; 7+ messages in thread
From: srandby @ 2009-03-08  2:20 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: [Orgmode]

Carsten Dominik wrote:
> Hi Scott,
> 
> I do not think it makes sense to automatically produce these files.
> Among other things, it would mean that the extra files are
> produces for every single export of a file.

Yes, I agree, but I still would like to be able to do it. Perhaps, when 
I eventually learn lisp, I'll work on a way to implement this.

> If you want external files, You likely will use the
> same for a set of pages.
> 
> After pulling the latest version you can do this:
> 
> 1. prepare any style files and script files you want to use
> 
> 2. do this
> 
> (setq org-export-html-style-include-default nil)
> (setq org-export-html-style-include-scripts nil)
> (setq org-export-html-style
>    "<link rel="stylesheet" type="text/css" href="gen-style.css">
>     <link rel="stylesheet" type="text/css" href="style.css">
>     <script type="text/javascript" src="org-info.v.0.1.0.5.js"></script>
>     <script type="text/javascript" src="org-html.js"></script>
>     <script type="text/javascript" src="mystery.js"></script>")
> 
> 
> Instead of the last setting, you can also use #+STYLE in a file
> to specify the style files for this particular page.

Thanks, this helps a lot.

> 
> HTH
> 
> - Carsten
> 
> 
>>
> 
> 
> On Mar 7, 2009, at 3:30 AM, srandby@gmail.com wrote:
> 
>> Greetings,
>>
>> When I export (using org-mode 6.23) to html an org file that has 
>> options for org-info.js, the html file contains this:
>>
>> <script type="text/javascript">
>> <!--/*--><![CDATA[/*><!--*/
>> THE SCRIPT
>> /*]]>*/-->
>> </script>
>>
>> Earlier versions of org-mode exported scripts this way:
>>
>> <script type="text/javascript">
>> /* <![CDATA[ */
>> THE SCRIPT
>> /* ]]> */
>> </script>
>>
>> Today, I discovered that the first script listed above will work with 
>> Firefox, but not with Safari (I don't know about IE). After some 
>> research, I discovered several fixes, including the old way of 
>> exporting, the easiest being:
>>
>> <script type="text/javascript">
>> <!--
>> THE SCRIPT
>> -->
>> </script>
>>
>>
>> I realize there are issues here with the differences between html 
>> browsers and xml browsers, so I've decided that I would like to have 
>> scripts (and styles) exported as separate files. Is this possible?
>>
>> When I export my org file to html, the html file contains one style 
>> section and two script sections. If these three were instead exported 
>> to separate files, that would eliminate the need to worry about how to 
>> enclose styles and scripts with comments in a way that works for all 
>> browsers. Of course, then org-mode would be creating four files 
>> instead of one, but I would like to have this option. Everything I've 
>> read about this matter recommends keeping styles and scripts as 
>> external files.
>>
>> When I create the three files manually and edit the html file 
>> appropriately, the html file lacks all the style and script code which 
>> is replaced by:
>>
>> <link rel="stylesheet" type="text/css" href="gen-style.css">
>> <link rel="stylesheet" type="text/css" href="style.css">
>> <script type="text/javascript" src="org-info.v.0.1.0.5.js"></script>
>> <script type="text/javascript" src="org-html.js"></script>
>> <script type="text/javascript" src="mystery.js"></script>
>>
>> Here gen-style.css contains the style generated by org-mode, style.css 
>> is my own style, org-html.js is the first script generated by 
>> org-mode, and mystery.js is the second script generated by org-mode 
>> (it is mysterious to me).
>>
>> Scott Randby
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 
> 

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

end of thread, other threads:[~2009-03-08  2:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-07  2:30 Javascript Export Issue srandby
2009-03-07 10:14 ` Sebastian Rose
2009-03-07 10:23 ` Sebastian Rose
2009-03-07 10:28   ` Carsten Dominik
2009-03-07 10:32   ` Carsten Dominik
2009-03-07 10:30 ` Carsten Dominik
2009-03-08  2:20   ` srandby

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).