emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* html export: pre.src support changed?
@ 2017-08-16 14:36 Jarmo Hurri
  2017-08-16 14:45 ` Jarmo Hurri
  2017-08-17 13:13 ` Jarmo Hurri
  0 siblings, 2 replies; 4+ messages in thread
From: Jarmo Hurri @ 2017-08-16 14:36 UTC (permalink / raw)
  To: emacs-orgmode


Greetings.

The following explanation is a bit long, so here is a summary:

1. "pre.src" formatting no longer seems to work in html export
2. "pre code" works, but incorrectly from my point of view.

I am looking for a fix.

Here is the longer explanation

1. pre.src does not work
------------------------

I used to have a working CSS file for some programming teaching material
exported from Org. Something has changed, because earlier formatting
used pre.src in the following style:

pre.src
{
    margin: 0 auto;
    font-size: 0.9vw;
    width: 75em;
    color: white;
    background-color: #102e4e;
    border-radius: 10px;
}

In particular, background-color controlled the background of the entire
source block "window" in the exported html.

According to the manual, pre.src still controls formatting for source
code blocks:

http://orgmode.org/manual/CSS-support.html

However, when I export the same files right now, pre.src no longer
works. The change in the exported html files is obvious:

old export (pre.src worked)
<pre class="src src-processing"> ...

new export (pre.src no longer works)
<pre><code class="src src-processing"> ...

2. "pre code" works incorrectly (from my point of view)
-------------------------------------------------------

I can get my CSS file to do _something_ with the following change:

pre code
{
    margin: 0 auto;
    font-size: 0.9vw;
    width: 75em;
    color: white;
    background-color: #102e4e;
    border-radius: 10px;
}

However, the problem is that this changes only the background of the
code text, not the entire "window". The effect can be seen here:

old export (code blocks colored correctly):
https://www.syk.fi/ohjelmointi/muuttuja.html

new export (code blocks colored incorrectly);
https://www.syk.fi/ohjelmointi-paivitys/muuttuja.html

How do I fix this? Thanks!

Jarmo

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

* Re: html export: pre.src support changed?
  2017-08-16 14:36 html export: pre.src support changed? Jarmo Hurri
@ 2017-08-16 14:45 ` Jarmo Hurri
  2017-08-17 13:13 ` Jarmo Hurri
  1 sibling, 0 replies; 4+ messages in thread
From: Jarmo Hurri @ 2017-08-16 14:45 UTC (permalink / raw)
  To: emacs-orgmode


> 2. "pre code" works incorrectly (from my point of view)
> -------------------------------------------------------
>
> I can get my CSS file to do _something_ with the following change:
>
> pre code
> {
>     margin: 0 auto;
>     font-size: 0.9vw;
>     width: 75em;
>     color: white;
>     background-color: #102e4e;
>     border-radius: 10px;
> }
>
> However, the problem is that this changes only the background of the
> code text, not the entire "window".

Did some further studies. It turns out that in this particular case I
can get the blocks to color correctly by coloring just pre:

pre
{
    margin: 0 auto;
    font-size: 0.9vw;
    width: 75em;
    color: white;
    background-color: #102e4e;
    border-radius: 10px;
}

But I can't be expected to color all preformatted text similarly. Right?
There has to be a way to format the code windows only.

(Unfortunately there is no parent selector in CSS. Otherwise I could
select the pre that have a code descendant.)

Jarmo

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

* Re: html export: pre.src support changed?
  2017-08-16 14:36 html export: pre.src support changed? Jarmo Hurri
  2017-08-16 14:45 ` Jarmo Hurri
@ 2017-08-17 13:13 ` Jarmo Hurri
  2017-08-17 14:14   ` Nicolas Goaziou
  1 sibling, 1 reply; 4+ messages in thread
From: Jarmo Hurri @ 2017-08-17 13:13 UTC (permalink / raw)
  To: emacs-orgmode


Greetings again.

Due to the flurry of responses to this thread (like, zero), I will make
a suggestion:

Could we reinstate pre.src by including the src class into pre tags as
well? That is, whereas we now have in the new export

<pre><code class="src...

we would have, sort of like in the old export

<pre class="src"><code class="src...

This would solve my issues. Would it be ok?

Jarmo

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

* Re: html export: pre.src support changed?
  2017-08-17 13:13 ` Jarmo Hurri
@ 2017-08-17 14:14   ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2017-08-17 14:14 UTC (permalink / raw)
  To: Jarmo Hurri; +Cc: emacs-orgmode

Hello,

Jarmo Hurri <jarmo.hurri@iki.fi> writes:

> Greetings again.
>
> Due to the flurry of responses to this thread (like, zero), I will make
> a suggestion:
>
> Could we reinstate pre.src by including the src class into pre tags as
> well? That is, whereas we now have in the new export
>
> <pre><code class="src...
>
> we would have, sort of like in the old export
>
> <pre class="src"><code class="src...
>
> This would solve my issues. Would it be ok?

I hear the faint sound of a bell somewhere. Is it related to
`org-html-keep-old-src' variable and commit
d5bbf365533ba45d72ebed8121c7612c860ea944?

IIRC, there were some issues with klipse support implementation.
I cannot remember if those were solved. You might find more information
browsing the mailing list archives.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-08-17 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 14:36 html export: pre.src support changed? Jarmo Hurri
2017-08-16 14:45 ` Jarmo Hurri
2017-08-17 13:13 ` Jarmo Hurri
2017-08-17 14:14   ` Nicolas Goaziou

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