← Back to team overview

zim-wiki team mailing list archive

Re: Export to html

 

You wrote: "Now as you commented correctly this results in a lot of whitespace below the H2. But there is also 
space below the H1 that is not in the wiki text."
--> This is just the default space after headers. As you mention below, this can be easily handled using CSS. 

You wrote: "If I use CSS to remove the padding/margin between heading and paragraph it looks again same as the source text. But in that case the BR is 
crucial."
--> I don't see why the BR is crucial in that case. 

You wrote: "Compromise would be to make the newline handling an option you can 
control from the template. This could help to make "vanilla" HTML export
 look decent while templates with CSS can set the BR how they want it."
--> It seems setting the height of the BR, and that doesn't seem to be easy: http://stackoverflow.com/questions/1409649/how-to-change-the-height-of-a-br
 I think the situation is that in Zim, being text based (and given that the text files should remain human readible), spaces between headers and text can only be created by adding empty lines. In HTML such spaces should not be done by adding breaks, but by using CSS. For this reason, the way empty lines are handled in revision 706 is the correction one I think and the changes should not be rolled back i.m.o.

I am not sure if I understand the last option, but if that means the user has the option to determine how empty lines are handled by the export (being replaced by brakes or ignored), that would be a very nice feature.

Cheers,

Paulo







On Friday, August 22, 2014 5:38 PM, Jaap Karssenberg <jaap.karssenberg@xxxxxxxxx> wrote:
 


On Fri, Aug 22, 2014 at 1:43 PM, Paulo van Breugel <p_vanbreugel@xxxxxxxxx> wrote:

Well, perhaps it is an idea to have the export replace two empty lines by one <br> (and three empty lines by two <br>, etc... but leave the rule that one empty line is ignored). That would allow people to insert a larger break (more white space) between paragraphs or headings in the Zim notebook which would then also be reflected in the exported html pages.
>

That's actually what I had in the version before 707, but it was not fine tuned for this case. Just realized that you would need to use CSS for the heading margin anyway to fully get things like they look in zim.


Say I have this wiki text:

====== Head 1 ======
bla bla bla

===== head 2 =====


bla bla bal

....


Current release (<706) results in following html


<h1>Head 1</h1>

<p>bla bla bla

</p>


<h2>Head 2</h2>

<br>

<p>bla bla bla
</p>
...


Now as you commented correctly this results in a lot of whitespace below the H2. But there is also space below the H1 that is not in the wiki text.


If I use CSS to remove the padding/margin between heading and paragraph it looks again same as the source text. But in that case the BR is crucial.


Current snapshot (>=706) I removed all these BR, so no difference between the two headings in this example.



My feeling is that I should roll back and put CSS snippet in the template to get more accurate HTML version of the wiki page. However that makes the HTML rendering without CSS ugly.


Compromise would be to make the newline handling an option you can control from the template. This could help to make "vanilla" HTML export look decent while templates with CSS can set the BR how they want it.


Any thoughts?


Jaap

Follow ups

References