unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* [PATCH]
@ 2021-01-20 10:46 TEC
  2021-01-20 11:00 ` [PATCH] tweaks to ox-html style TEC
  2021-02-12  6:16 ` Kyle Meyer
  0 siblings, 2 replies; 14+ messages in thread
From: TEC @ 2021-01-20 10:46 UTC (permalink / raw)
  To: org-mode-email

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

Hi All,

This is just some tweaks to the styling in ox-html that I think may
appeal (and prevent ridiculously long lines on non-small displays, which
are an issue for legibility).

I also took the opportunity to remove the (obsolete) CDATA strings and
make the CSS more consistently formatted. If you don't want this to
get its own commit, please just squash it.

Style changes:
- Restrict max content width, and centre
- tweak styling of source code blocks

I took some screenshots (1440p monitor, 120% zoom, Firefox).
Current: https://0x0.st/-iW9.png
This patch: https://0x0.st/-iWp.png

All the best,

Timothy.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html.el-remove-CDATA-strings.patch --]
[-- Type: text/x-patch, Size: 2679 bytes --]

From 635bd77cd7a2dc55cc0705c5bbf2e11091bfbaf3 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Wed, 20 Jan 2021 16:37:29 +0800
Subject: [PATCH 1/5] ox-html.el: remove CDATA strings

* lisp/ox-html.el (org-html-scripts, org-html-style-default,
org-html-infojs-template): remove CDATA strings, as they are now
considered obsolete --- see
https://developer.mozilla.org/en-US/docs/Web/API/CDATASection#specifications
---
 lisp/ox-html.el | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 03145e35c..0cf3425df 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -234,7 +234,6 @@ property on the headline itself.")
 (defconst org-html-scripts
   "<script type=\"text/javascript\">
 // @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
-<!--/*--><![CDATA[/*><!--*/
      function CodeHighlightOn(elem, id)
      {
        var target = document.getElementById(id);
@@ -251,14 +250,12 @@ property on the headline itself.")
          target.classList.remove(\"code-highlighted\");
        }
      }
-    /*]]>*///-->
 // @license-end
 </script>"
   "Basic JavaScript that is needed by HTML files produced by Org mode.")
 
 (defconst org-html-style-default
   "<style type=\"text/css\">
- <!--/*--><![CDATA[/*><!--*/
   .title  { text-align: center;
              margin-bottom: .2em; }
   .subtitle { text-align: center;
@@ -439,7 +436,6 @@ property on the headline itself.")
   .org-info-js_search-highlight
     { background-color: #ffff00; color: #000000; font-weight: bold; }
   .org-svg { width: 90%; }
-  /*]]>*/-->
 </style>"
   "The default style specification for exported HTML files.
 You can use `org-html-head' and `org-html-head-extra' to add to
@@ -515,10 +511,8 @@ means to use the maximum value consistent with other options."
 
 <script type=\"text/javascript\">
 // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
-<!--/*--><![CDATA[/*><!--*/
 %MANAGER_OPTIONS
 org_html_manager.setup();  // activate after the parameters are set
-/*]]>*///-->
 // @license-end
 </script>"
   "The template for the export style additions when org-info.js is used.
@@ -1448,13 +1442,11 @@ done, timestamp, timestamp-kwd, tag, target.
 For example, a valid value would be:
 
    <style type=\"text/css\">
-    /*<![CDATA[*/
       p { font-weight: normal; color: gray; }
       h1 { color: black; }
       .title { text-align: center; }
       .todo, .timestamp-kwd { color: red; }
       .done { color: green; }
-    /*]]>*/
    </style>
 
 If you want to refer to an external style, use something like
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-ox-html.el-limit-maximum-content-width-and-center.patch --]
[-- Type: text/x-patch, Size: 895 bytes --]

From 5bef340093102936efe831f85fabdb589070ce43 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Wed, 20 Jan 2021 16:45:20 +0800
Subject: [PATCH 2/5] ox-html.el: limit maximum content width and center

* lisp/ox-html.el (org-html-style-default): To improve the appearance
and legibility on larger screens:
 1. Limit the content width to the upper end of advised line width, ~140
 characters.
 2. Centre the content.
---
 lisp/ox-html.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 0cf3425df..9bbfad678 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -256,6 +256,7 @@ property on the headline itself.")
 
 (defconst org-html-style-default
   "<style type=\"text/css\">
+  #content { max-width: 60em; margin: auto; }
   .title  { text-align: center;
              margin-bottom: .2em; }
   .subtitle { text-align: center;
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-ox-html.el-format-CSS-more-consistently.patch --]
[-- Type: text/x-patch, Size: 2278 bytes --]

From 2c0f648ae87e789f21c24b645b2049f05d084799 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Wed, 20 Jan 2021 17:58:38 +0800
Subject: [PATCH 3/5] ox-html.el: format CSS more consistently

* lisp/ox-html.el (org-html-style-default): Format CSS declarations more
consistently.
---
 lisp/ox-html.el | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9bbfad678..14f023e87 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -257,8 +257,8 @@ property on the headline itself.")
 (defconst org-html-style-default
   "<style type=\"text/css\">
   #content { max-width: 60em; margin: auto; }
-  .title  { text-align: center;
-             margin-bottom: .2em; }
+  .title { text-align: center;
+           margin-bottom: .2em; }
   .subtitle { text-align: center;
               font-size: medium;
               font-weight: bold;
@@ -282,13 +282,11 @@ property on the headline itself.")
     padding: 8pt;
     font-family: monospace;
     overflow: auto;
-    margin: 1.2em;
-  }
+    margin: 1.2em; }
   pre.src {
     position: relative;
     overflow: auto;
-    padding-top: 1.2em;
-  }
+    padding-top: 1.2em; }
   pre.src:before {
     display: none;
     position: absolute;
@@ -296,8 +294,7 @@ property on the headline itself.")
     top: -10px;
     right: 10px;
     padding: 3px;
-    border: 1px solid black;
-  }
+    border: 1px solid black; }
   pre.src:hover:before { display: inline; margin-top: 14px;}
   /* Languages per Org manual */
   pre.src-asymptote:before { content: 'Asymptote'; }
@@ -410,22 +407,17 @@ property on the headline itself.")
   .equation-container {
     display: table;
     text-align: center;
-    width: 100%;
-  }
-  .equation {
-    vertical-align: middle;
-  }
+    width: 100%; }
+  .equation { vertical-align: middle; }
   .equation-label {
     display: table-cell;
     text-align: right;
-    vertical-align: middle;
-  }
+    vertical-align: middle; }
   .inlinetask {
     padding: 10px;
     border: 2px solid gray;
     margin: 10px;
-    background: #ffffcc;
-  }
+    background: #ffffcc; }
   #org-div-home-and-up
    { text-align: right; font-size: 70%; white-space: nowrap; }
   textarea { overflow-x: auto; }
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-ox-html.el-tweak-styling-of-src-blocks.patch --]
[-- Type: text/x-patch, Size: 1617 bytes --]

From c341a278291be3c6a4fcca77fede476a04417a69 Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Wed, 20 Jan 2021 18:17:06 +0800
Subject: [PATCH 4/5] ox-html.el: tweak styling of src blocks

* lisp/ox-html.el (org-html-style-default): Apply the following changes
to the styling of src blocks:
- Remove box shadow.
- Lighten border.
- Add very light grey background colour.
- Make lang label (visible on hover) less obtrusive by removing border.
---
 lisp/ox-html.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 14f023e87..e83648726 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -277,24 +277,24 @@ property on the headline itself.")
   #postamble p, #preamble p { font-size: 90%; margin: .2em; }
   p.verse { margin-left: 3%; }
   pre {
-    border: 1px solid #ccc;
-    box-shadow: 3px 3px 3px #eee;
+    border: 1px solid #e6e6e6;
+    border-radius: 3px;
+    background-color: #f2f2f2;
     padding: 8pt;
     font-family: monospace;
     overflow: auto;
     margin: 1.2em; }
   pre.src {
     position: relative;
-    overflow: auto;
-    padding-top: 1.2em; }
+    overflow: auto; }
   pre.src:before {
     display: none;
     position: absolute;
-    background-color: white;
-    top: -10px;
-    right: 10px;
+    top: -8px;
+    right: 12px;
     padding: 3px;
-    border: 1px solid black; }
+    color: #555;
+    background-color: #f2f2f299; }
   pre.src:hover:before { display: inline; margin-top: 14px;}
   /* Languages per Org manual */
   pre.src-asymptote:before { content: 'Asymptote'; }
-- 
2.29.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-ox-html.el-add-lang-label-to-authinfo-src-blocks.patch --]
[-- Type: text/x-patch, Size: 931 bytes --]

From b8eb175c709ad9cff259b4326d8c9a344a4381ba Mon Sep 17 00:00:00 2001
From: TEC <tec@tecosaur.com>
Date: Wed, 20 Jan 2021 18:22:58 +0800
Subject: [PATCH 5/5] ox-html.el: add lang label to authinfo src blocks

* lisp/ox-html.el (org-html-style-default): `authinfo-mode' is defined
in Emacs 27. As such, in the CSS add an "Authinfo" lang label to
authinfo src blocks.
---
 lisp/ox-html.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index e83648726..e5e82a5d8 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -299,6 +299,7 @@ property on the headline itself.")
   /* Languages per Org manual */
   pre.src-asymptote:before { content: 'Asymptote'; }
   pre.src-awk:before { content: 'Awk'; }
+  pre.src-authinfo::before { content: 'Authinfo'; }
   pre.src-C:before { content: 'C'; }
   /* pre.src-C++ doesn't work in CSS */
   pre.src-clojure:before { content: 'Clojure'; }
-- 
2.29.2


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

* Re: [PATCH] tweaks to ox-html style
  2021-01-20 10:46 [PATCH] TEC
@ 2021-01-20 11:00 ` TEC
  2021-02-12  6:16 ` Kyle Meyer
  1 sibling, 0 replies; 14+ messages in thread
From: TEC @ 2021-01-20 11:00 UTC (permalink / raw)
  To: org-mode-email


Gah! I left the subject as a placeholder [shame emoji].
Apologies for that.

Why do I always seem to notice these things as the Email is sending...

--
Timothy

TEC <tecosaur@gmail.com> writes:

> Hi All,
>
> This is just some tweaks to the styling in ox-html that I think may
> appeal (and prevent ridiculously long lines on non-small displays, which
> are an issue for legibility).
>
> I also took the opportunity to remove the (obsolete) CDATA strings and
> make the CSS more consistently formatted. If you don't want this to
> get its own commit, please just squash it.
>
> Style changes:
> - Restrict max content width, and centre
> - tweak styling of source code blocks
>
> I took some screenshots (1440p monitor, 120% zoom, Firefox).
> Current: https://0x0.st/-iW9.png
> This patch: https://0x0.st/-iWp.png
>
> All the best,
>
> Timothy.



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

* Re: [PATCH] tweaks to ox-html style
  2021-01-20 10:46 [PATCH] TEC
  2021-01-20 11:00 ` [PATCH] tweaks to ox-html style TEC
@ 2021-02-12  6:16 ` Kyle Meyer
  2021-02-12 16:57   ` Jens Lechtenboerger
  1 sibling, 1 reply; 14+ messages in thread
From: Kyle Meyer @ 2021-02-12  6:16 UTC (permalink / raw)
  To: TEC; +Cc: org-mode-email

TEC writes:

> Hi All,
>
> This is just some tweaks to the styling in ox-html that I think may
> appeal (and prevent ridiculously long lines on non-small displays, which
> are an issue for legibility).
>
> I also took the opportunity to remove the (obsolete) CDATA strings and
> make the CSS more consistently formatted. If you don't want this to
> get its own commit, please just squash it.
>
> Style changes:
> - Restrict max content width, and centre
> - tweak styling of source code blocks

I'm sure there are plenty of opinionated ox-html users on the list.  Is
anyone willing to provide feedback on this series?  Please don't assume
you need commit access to provide reviews.


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12  6:16 ` Kyle Meyer
@ 2021-02-12 16:57   ` Jens Lechtenboerger
  2021-02-12 17:08     ` Jens Lechtenboerger
                       ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jens Lechtenboerger @ 2021-02-12 16:57 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: org-mode-email, TEC

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

On 2021-02-12, Kyle Meyer wrote:

> TEC writes:
>
>> Hi All,
>>
>> This is just some tweaks to the styling in ox-html that I think may
>> appeal (and prevent ridiculously long lines on non-small displays, which
>> are an issue for legibility).
>>
>> I also took the opportunity to remove the (obsolete) CDATA strings and
>> make the CSS more consistently formatted. If you don't want this to
>> get its own commit, please just squash it.
>>
>> Style changes:
>> - Restrict max content width, and centre
>> - tweak styling of source code blocks
>
> I'm sure there are plenty of opinionated ox-html users on the list.  Is
> anyone willing to provide feedback on this series?  Please don't assume
> you need commit access to provide reviews.

Hi there,

I do not know why the CDATA lines exist.  I don’t see a reason to
keep them (patch 0001), but that might be a lack of understanding on
my part.

Patch 0003 is about whitespace fixes.

Patches 0002, 0004, 0005 change defconst styling.  I don’t have a
strong opinion here.  However, if they are changed now, what about
turning them into defcustoms?  Then each of us would be entitled to
their own opinion ;)

The docstring for org-html-head-include-default-style says that
org-html-style-default (a defconst proposed to be changed here)
should not be changed.  Why not?

Best wishes
Jens

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5290 bytes --]

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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 16:57   ` Jens Lechtenboerger
@ 2021-02-12 17:08     ` Jens Lechtenboerger
  2021-02-12 18:22       ` Timothy
  2021-02-12 18:16     ` Timothy
  2021-02-12 21:46     ` Tim Cross
  2 siblings, 1 reply; 14+ messages in thread
From: Jens Lechtenboerger @ 2021-02-12 17:08 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: org-mode-email, TEC

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

On 2021-02-12, Jens Lechtenboerger wrote:

> I do not know why the CDATA lines exist.  I don’t see a reason to
> keep them (patch 0001), but that might be a lack of understanding on
> my part.

OK, that is probably for XHTML, where < and & are only allowed
inside CDATA sections.

Timothy, did you try to validate XHTML output?

Best wishes
Jens

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5290 bytes --]

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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 16:57   ` Jens Lechtenboerger
  2021-02-12 17:08     ` Jens Lechtenboerger
@ 2021-02-12 18:16     ` Timothy
  2021-02-12 21:46     ` Tim Cross
  2 siblings, 0 replies; 14+ messages in thread
From: Timothy @ 2021-02-12 18:16 UTC (permalink / raw)
  To: Jens Lechtenboerger; +Cc: Kyle Meyer, org-mode-email


Jens Lechtenboerger <lechten@wi.uni-muenster.de> writes:

> I do not know why the CDATA lines exist.  I don’t see a reason to
> keep them (patch 0001), but that might be a lack of understanding on
> my part.

I'll cover this in my reply to your follow-up.

> Patch 0003 is about whitespace fixes.
>
> Patches 0002, 0004, 0005 change defconst styling.  I don’t have a
> strong opinion here.  However, if they are changed now, what about
> turning them into defcustoms?  Then each of us would be entitled to
> their own opinion ;)
>
> The docstring for org-html-head-include-default-style says that
> org-html-style-default (a defconst proposed to be changed here)
> should not be changed.  Why not?

The defconst is left a defsconst because I don't really know why it is
one, and when I don't know why something is the way it is, I try to leave
it alone.  In my own config I actually overwrite it, but oh well.

I'm guessing this is just a case of "User beware, this contains
important stuff to have Org look reasonable. Don't remove that."

Perhaps this should be a defcustom? It would be good to hear from
someone else on this. If this ends up being a hold up though I'd rather
resolve this separately.

--
Timothy.


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 17:08     ` Jens Lechtenboerger
@ 2021-02-12 18:22       ` Timothy
  2021-02-13 14:43         ` Jens Lechtenboerger
  0 siblings, 1 reply; 14+ messages in thread
From: Timothy @ 2021-02-12 18:22 UTC (permalink / raw)
  To: Jens Lechtenboerger; +Cc: Kyle Meyer, org-mode-email


Jens Lechtenboerger <lechten@wi.uni-muenster.de> writes:

> On 2021-02-12, Jens Lechtenboerger wrote:
>
>> I do not know why the CDATA lines exist.  I don’t see a reason to
>> keep them (patch 0001), but that might be a lack of understanding on
>> my part.
>
> OK, that is probably for XHTML, where < and & are only allowed
> inside CDATA sections.
>
> Timothy, did you try to validate XHTML output?

If you look at the commit message for 001, you can see the following:

> remove CDATA strings, as they are now
> considered obsolete --- see
> https://developer.mozilla.org/en-US/docs/Web/API/CDATASection#specifications

Does that page clear things up for you?

I did a bit more googling and found
https://dev.w3.org/html5/html-polyglot/html-polyglot.html#bib-HTML5
which mentions CDATA:

> The CDATA code is then seen as text by the HTML parser (and can thus
> interfere with the scripting or styling language!), while the XML
> parser sees the content as text without markup semantics.

In other words, CDATA allows you to keep XML comparability, but now
breaks strict HTML comparability. IMO the latter is much more important
for an org-html export.

--
Timothy


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 16:57   ` Jens Lechtenboerger
  2021-02-12 17:08     ` Jens Lechtenboerger
  2021-02-12 18:16     ` Timothy
@ 2021-02-12 21:46     ` Tim Cross
  2021-02-13  9:28       ` Eric S Fraga
  2021-02-13 13:32       ` Christian Moe
  2 siblings, 2 replies; 14+ messages in thread
From: Tim Cross @ 2021-02-12 21:46 UTC (permalink / raw)
  To: emacs-orgmode


Jens Lechtenboerger <lechten@wi.uni-muenster.de> writes:

> On 2021-02-12, Kyle Meyer wrote:
>
>> TEC writes:
>>
>>> Hi All,
>>>
>>> This is just some tweaks to the styling in ox-html that I think may
>>> appeal (and prevent ridiculously long lines on non-small displays, which
>>> are an issue for legibility).
>>>
>>> I also took the opportunity to remove the (obsolete) CDATA strings and
>>> make the CSS more consistently formatted. If you don't want this to
>>> get its own commit, please just squash it.
>>>
>>> Style changes:
>>> - Restrict max content width, and centre
>>> - tweak styling of source code blocks
>>
>> I'm sure there are plenty of opinionated ox-html users on the list.  Is
>> anyone willing to provide feedback on this series?  Please don't assume
>> you need commit access to provide reviews.
>
> Hi there,
>
> I do not know why the CDATA lines exist.  I don’t see a reason to
> keep them (patch 0001), but that might be a lack of understanding on
> my part.
>
> Patch 0003 is about whitespace fixes.
>
> Patches 0002, 0004, 0005 change defconst styling.  I don’t have a
> strong opinion here.  However, if they are changed now, what about
> turning them into defcustoms?  Then each of us would be entitled to
> their own opinion ;)
>
> The docstring for org-html-head-include-default-style says that
> org-html-style-default (a defconst proposed to be changed here)
> should not be changed.  Why not?
>

I think I pretty much agree here. IMO I think all the CSS styling in an
export should be defined with defcustom. CSS has come a long way since
the original HTML exporter was written and I think it is best to put
this power in the hands of the author. I realise some of this CSS
styling can be complex if we want good looking HTML exports and making
it available to be changed by the user could result in an increase in
issues relating to inconsistent or ugly output, but I think provided the
defaults are good, this risk is warranted.

My only question is whether we should continue to modify the current
html exporter or whether it would be better to rename the existing
exporter as xhtml exporter and do a new clean html exporter that is just
html5 and css3 and which does not attempt to be xhtml compliant?

Others have mentioned on the list that they believe it is important to
keep xhtml compatibility. This would satisfy that requirement and at the
same time, enable a new html exporter that can take full advantage of
changes introduced with html5 while keeping the exporter smaller and
cleaner (and easier to maintain).

BTW I think it would be nice if the html export was able to produce/use
a separate CSS file rather than in-line styles. This would make it
easier to drop exported HTML files into existing sites with custom
styles or update the look of exported files without needing to re-export
or manually edit. The complication is with exporting of HTML snippets,
where you probably want in-line styles.

--
Tim Cross


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 21:46     ` Tim Cross
@ 2021-02-13  9:28       ` Eric S Fraga
  2021-02-13 13:32       ` Christian Moe
  1 sibling, 0 replies; 14+ messages in thread
From: Eric S Fraga @ 2021-02-13  9:28 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode

On Saturday, 13 Feb 2021 at 08:46, Tim Cross wrote:
> BTW I think it would be nice if the html export was able to produce/use
> a separate CSS file rather than in-line styles. This would make it
> easier to drop exported HTML files into existing sites with custom
> styles or update the look of exported files without needing to re-export
> or manually edit. 

I would like this.

> The complication is with exporting of HTML snippets, where you
> probably want in-line styles.

Actually, I often use org -> HTML to create HTML snippets (especially
tables as they are so much easier to write in org than in HTML) that I
can include within a hand-crafted HTML file and then I typically spend
quite a bit of time removing all the in-line style information!

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-213-g49364f


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 21:46     ` Tim Cross
  2021-02-13  9:28       ` Eric S Fraga
@ 2021-02-13 13:32       ` Christian Moe
  2021-02-14  4:36         ` Timothy
  1 sibling, 1 reply; 14+ messages in thread
From: Christian Moe @ 2021-02-13 13:32 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-orgmode


Tim Cross writes:

> BTW I think it would be nice if the html export was able to produce/use
> a separate CSS file rather than in-line styles. This would make it
> easier to drop exported HTML files into existing sites with custom
> styles or update the look of exported files without needing to re-export
> or manually edit. The complication is with exporting of HTML snippets,
> where you probably want in-line styles.

Isn't this already covered by existing capabilities? From the manual:

   The HTML export back-end includes a compact default style in each
   exported HTML file.  To override the default style with another
   style, use these keywords in the Org file.  They will replace the
   global defaults the HTML exporter uses.

     #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />
     #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />

   To just turn off the default style, customize
   ‘org-html-head-include-default-style’ variable, or use this option
   line in the Org file.

     #+OPTIONS: html-style:nil

The only thing I don't think it does is export the default style as a
separate .css file rather than inline. Maybe there's a use case where
that would be better than turning it off and specifying a linked style,
but I can't really think of one. I suppose one would need a new option
to specify a path for the exported stylesheet, so it wouldn't save a lot
on option lines.

Yours,
Christian


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

* Re: [PATCH] tweaks to ox-html style
  2021-02-12 18:22       ` Timothy
@ 2021-02-13 14:43         ` Jens Lechtenboerger
  0 siblings, 0 replies; 14+ messages in thread
From: Jens Lechtenboerger @ 2021-02-13 14:43 UTC (permalink / raw)
  To: Timothy; +Cc: Kyle Meyer, org-mode-email

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

On 2021-02-13, Timothy wrote:

> Jens Lechtenboerger <lechten@wi.uni-muenster.de> writes:
>
>> On 2021-02-12, Jens Lechtenboerger wrote:
>>
>>> I do not know why the CDATA lines exist.  I don’t see a reason to
>>> keep them (patch 0001), but that might be a lack of understanding on
>>> my part.
>>
>> OK, that is probably for XHTML, where < and & are only allowed
>> inside CDATA sections.
>>
>> Timothy, did you try to validate XHTML output?
>
> If you look at the commit message for 001, you can see the following:
>
>> remove CDATA strings, as they are now
>> considered obsolete --- see
>> https://developer.mozilla.org/en-US/docs/Web/API/CDATASection#specifications
>
> Does that page clear things up for you?

No, sorry, I don’t get it.  I see:
“Re-added in issue #295 due to web breakage”

> I did a bit more googling and found
> https://dev.w3.org/html5/html-polyglot/html-polyglot.html#bib-HTML5
> which mentions CDATA:
>
>> The CDATA code is then seen as text by the HTML parser (and can thus
>> interfere with the scripting or styling language!), while the XML
>> parser sees the content as text without markup semantics.
>
> In other words, CDATA allows you to keep XML comparability,

Exactly.  In fact, the “&” in the magnet URI should be “&amp;” or
it might be placed into the CDATA section.

> but now breaks strict HTML comparability.

What do you mean?  If I use html5 as HTML_DOCTYPE, the validator at
https://validator.w3.org/nu/ does not complain.

Best wishes
Jens

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5290 bytes --]

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

* Re: [PATCH] tweaks to ox-html style
  2021-02-13 13:32       ` Christian Moe
@ 2021-02-14  4:36         ` Timothy
  0 siblings, 0 replies; 14+ messages in thread
From: Timothy @ 2021-02-14  4:36 UTC (permalink / raw)
  To: Christian Moe; +Cc: Tim Cross, emacs-orgmode


Regarding any use case which would benefit from turning
org-html-style-default into a defcustom, IMO there are two:
+ When you don't want to have to add a #+HTML_HEAD to every file you
  export
+ When you want to include a long inline style (my use case)

--
Timothy


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

* Re: [PATCH]
  2011-07-13 14:13 [PATCH] Evgeny Boykov
@ 2011-07-16 17:10 ` Bastien
  0 siblings, 0 replies; 14+ messages in thread
From: Bastien @ 2011-07-16 17:10 UTC (permalink / raw)
  To: Evgeny Boykov; +Cc: emacs-orgmode

Hi Evgeny,

thanks a lot for the analysis and the patch, I just applied it.

If you can, please use git format-patch when submitting patch
and make sure the subject line of the email containing the patch
is a short description of it -- it will help me a lot.

Best,

-- 
 Bastien

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

* [PATCH]
@ 2011-07-13 14:13 Evgeny Boykov
  2011-07-16 17:10 ` [PATCH] Bastien
  0 siblings, 1 reply; 14+ messages in thread
From: Evgeny Boykov @ 2011-07-13 14:13 UTC (permalink / raw)
  To: emacs-orgmode


===========================================================================

I want org-publish-current-file ~/git/org/filename.org in ~/pub/org/

Some setup:

(setq org-publish-project-alist
...
         :base-directory "~/git/org"
         :publishing-directory "~/pub/org"
         :publishing-function org-publish-org-to-pdf
...

or just

(org-export-as-pdf 3 nil nil "*Org LaTeX Export*" nil "~/pub/org")

Before patch, incorrectly: 

all pdf-creating files: filename.aux, filename.out, etc,
apart from filename.tex, are here:
../base-directory/

After patch, correctly:

all pdf-creating files are here:
../publishing-directory/

======================================================================

Solution:

All 'cmds' must be called in 'lbuf', but not in filename.org's buffer context.

======================================================================


diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 1d6e042..5270943 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1043,26 +1043,28 @@ when PUB-DIR is set, use this as the publishing directory."
     (with-current-buffer outbuf (erase-buffer))
     (message (concat "Processing LaTeX file " file "..."))
     (setq output-dir (file-name-directory file))
-    (if (and cmds (symbolp cmds))
-	(funcall cmds (shell-quote-argument file))
-      (while cmds
-	(setq cmd (pop cmds))
-	(while (string-match "%b" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument base))
-		     t t cmd)))
-	(while (string-match "%f" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument file))
-		     t t cmd)))
-	(while (string-match "%o" cmd)
-	  (setq cmd (replace-match
-		     (save-match-data
-		       (shell-quote-argument output-dir))
-		     t t cmd)))
-	(shell-command cmd outbuf)))
+    (with-current-buffer lbuf
+      (save-excursion
+	(if (and cmds (symbolp cmds))
+	    (funcall cmds (shell-quote-argument file))
+	  (while cmds
+	    (setq cmd (pop cmds))
+	    (while (string-match "%b" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument base))
+			 t t cmd)))
+	    (while (string-match "%f" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument file))
+			 t t cmd)))
+	    (while (string-match "%o" cmd)
+	      (setq cmd (replace-match
+			 (save-match-data
+			   (shell-quote-argument output-dir))
+			 t t cmd)))
+	    (shell-command cmd outbuf)))))
     (message (concat "Processing LaTeX file " file "...done"))
     (setq errors (org-export-latex-get-error outbuf))
     (if (not (file-exists-p pdffile))

__________________________

С уважением,
Бойков Евгений Алексеевич
сот. 8-924-202-25-65
e-mail: artscan@list.ru

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

end of thread, other threads:[~2021-02-14  4:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 10:46 [PATCH] TEC
2021-01-20 11:00 ` [PATCH] tweaks to ox-html style TEC
2021-02-12  6:16 ` Kyle Meyer
2021-02-12 16:57   ` Jens Lechtenboerger
2021-02-12 17:08     ` Jens Lechtenboerger
2021-02-12 18:22       ` Timothy
2021-02-13 14:43         ` Jens Lechtenboerger
2021-02-12 18:16     ` Timothy
2021-02-12 21:46     ` Tim Cross
2021-02-13  9:28       ` Eric S Fraga
2021-02-13 13:32       ` Christian Moe
2021-02-14  4:36         ` Timothy
  -- strict thread matches above, loose matches on Subject: below --
2011-07-13 14:13 [PATCH] Evgeny Boykov
2011-07-16 17:10 ` [PATCH] Bastien

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git