Renders the toc of a page inside the page content, a la Mediawiki
Compatible with DokuWiki
Similar to toc
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
The div created has the class set to inlinetoc2. The 2 is here to not enter in conflict with the TOC plugin which already use the class inlinetoc.
The plugin won't work if you specify {{NOTOC}} on the page because it relies on Dokuwiki's internal toc processor to build the page's toc.
{{INLINETOC 3}} will only display level1…level3 in the TOC Joachim 11.01.2012How to I disable the built-in TOC without also disabling inlinetoc?
I tried but couldn't find a way when I implemented inlinetoc. This reason is because it uses the toc definition generated by Dokuwiki. But, to disable the built-in TOC, you have to put {{NOTOC}} on your page, which causes Dokuwiki to not generate the toc definition.
To achieve what you want, that would means to parse the raw page to built the toc, something I wanted to avoid. This may come in a V2 if it appears to be a popular demand.
I added a note about this issue on this page. Andreone, 2011/06/23Maybe the plugin author could hide the built-in TOC via CSS? I see it is wrapped in <div class="toc">...</div>. Just a thought. — Rik BlokRik Blok
rikblok
2011/06/30 06:35I know the Dokuwiki's toc can be hidden with a little CSS, but in this case it's always hidden, including on pages that don't have an inlinetoc. What I want to do, is only hide Dokuwiki's toc on pages that have the inlinetoc tag.
I tried hooking TPL_METAHEADER_OUTPUT to inject a stylesheet but again it would always hide Dokuwiki's toc.
I've committed a version with a commented CSS to hide Dokuwiki's toc for those aren't interested with Dokuwiki's toc (remove the _ before div.toc in plugins/inlinetoc/style.css to enable the style).
Andreone, 2011/07/16
I finally managed to disabled dokuwiki's toc only on pages where inlinetoc is used with a bit of javascript.
Andreone, 2011/08/12
Very nice! You should refreshLast updateon plugin page. Thore, 2011/08/16Totally forgot, thanks.
I inserted
{{INLINETOC}}
at the beginning of a page, but no toc is generated.
Any idea would goes wrong? 24.08.2011 Joachim
At first, do you correctly installed the plugin? When downloaded from github, the directory inside the archive must be renamed to inlinetoc.
Do you still see the standard TOC or absolutely nothing?
Your test page must have at least three header lines so dokuwiki generates toc entries (that inlinetoc use). Andreone, 2011/08/24- plugin directory is correct
- standard TOC is visible
- more than three header lines
After some investigation it seems to be a conflict with sortablejs plugin and/or plugin searchtablejs
If I disable these plugins, INLINETOC works well.
On other pages with no sortablejs/searchtablejs INLINETOC also works well.2011-08-25 Joachim
Examples:
not working
====== plugin inlinetoc ======
{{INLINETOC}}
===== - Header 1 =====
==== - Header 1.2 ====
==== - Header 1.2 ====
===== - Header 2 =====
<sortable>
<searchtable>
^ Header ^
| Test 1 |
| Test 2 |
</searchtable>
</sortable>
working
====== plugin inlinetoc ======
{{INLINETOC}}
===== - Header 1 =====
==== - Header 1.2 ====
==== - Header 1.2 ====
===== - Header 2 =====
<searchtable>
<sortable>
^ Header ^
| Test 1 |
| Test 2 |
</sortable>
</searchtable>
Thanks for the update. I'll try to see if I can do something about that conflict. Andreone, 2011/08/25
INLINETOC functionality with <searchtable> and <sortable> on the same page depends on the order of <searchtable> and <sortable>
Solved: Use the following order and INLINETOC will work: 1. <searchtable> and 2. <sortable>
see example above! 2011-08-30 Joachim
I use the numberedheadings plugin to number the headings of the pages.
In print output, INLINETOC also numbers the headings (first number):
1. Header 1
1. 1 Header 2
1. 1.1 Header 3
2. 1.2 Header 3
2. 2 Header 2
etc.
On screen, a bullet point is shown.
Is it possible to disable this (per page)?2011-09-14 Joachim
Solved: I added the following to conf/userprint.css: 2011-09-15 Joachim
div.inlinetoc2 ul {
list-style-type: square;
line-height: 1.5em;
_margin-left: 2em;
}