turnermm / cssperpage

Enable per page styling for Dkuwiki
https://www.dokuwiki.org/plugin:cssperpage
0 stars 1 forks source link

Styling headings within sections #3

Open turbodrive opened 2 years ago

turbodrive commented 2 years ago

Hello ! Thank you for developing this plugin, quite useful on the project I'm currently working on. I'd like to encapsulate sections of page including headings and other elements (table, link) in divs generated by cssperpage plugin. It seems it doesn't work. Here an exemple of the kind of thing I'd like to do :

==== heading 3 ====

~~cssp_next_openDIV~~

=== heading 4 ===
hello there (18pt.)

[[http://example.com|external link]]

~~cssp_closeDIV~~

Rendering

<h3 class="sectionedit1" id="heading_3">heading 3</h3>
<div class="level3">

<div id='css_per_page'  class = 'next'>

</div>

<h4 id="heading_4">heading 4</h4>
<div class="level4">

<p>
hello there (18pt.)
</p>
<p>
<a href="http://example.com" class="urlextern" title="http://example.com" rel="ugc nofollow">external link</a>
</p>

</div>
</div>

What I'd like to get :

<h3 class="sectionedit1" id="heading_3">heading 3</h3>
<div class="level3">
</div>

<div id='css_per_page'  class = 'next'>

<h4 id="heading_4">heading 4</h4>
<div class="level4">

<p>
hello there (18pt.)
</p>
<p>
<a href="http://example.com" class="urlextern" title="http://example.com" rel="ugc nofollow">external link</a>
</p>

</div>
</div>

Do you have any idea how I can solve this ? Thanks !

turnermm commented 2 years ago

You can only include headings in full page css-per-page enclosures. Otherwise they break the div sequencing for the css and the styling is lost. So you can have this:

~~cssp_openDIV~~
==== heading 1 ====
=== heading 2 ===
~~cssp_closeDIV~~

But you can't have this:

====heading 1====
~~cssp_openDIV~~
===heading 2===
~~cssp_closeDIV~~

Here is an example with a styled table: https://www.mturner.org/devel/playground/cssperpage

turnermm commented 2 years ago

You must clear the browser cache for most changes

turbodrive commented 2 years ago

I see... thank you for your answer. I'm gonna try something different for my situation, then.