DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:subjectindex:discussion

Subject Index Plugin:

Discussion and Feedback

This is the discussion page for the subjectindex plugin. Please post all questions, bugs, and feature requests here.

Discussion

:?: Hi, nice idea. Is there a wiki, in which the plugin can be seen in action? — SteRe 2010/09/30 16:52

Unfortunately not, I do not have Dokuwiki hosted anywhere, but I am planning on providing some screenshots to give an idea of the usefulness of this plugin. It generates a full book-style A-Z subject index (a bit like the it's “pagequery” cousin)

:?: Is it possible to make an entry without the star in front of the description? Because i need only the entry in the subjectindex page without the information on the linked page. — moskito 2010/11/16 09:13

Fair question, I could understand the need for this on a public wiki. Currently it is not possible, but this suggestion will be added to the next release, once I think of a sensible syntax for it (suggestions?) — Symon 2010-11-16 13:25
Maybe it is possible without the pipe and the display?
{{entry>books/fiction/writing novels}}

moskito 2010/11/16 13:57

I currently use that to mean no text, it would not be backwards compatible with those who already use the plugin. How about:
{{entry>books/fiction/writing novels|-}}   => nothing visible (read: minus or blank placeholder)
{{entry>books/fiction/writing novels}}     => star only (default)
{{entry>books/fiction/writing novels|*}}   => star + full entry text
{{entry>books/fiction/writing novels|2,1}} => star + 2nd section of entry, etc...

Symon 2010-11-16 18:00

This looks good! I think it is ok! — moskito 2010/11/17 09:45
Ok, I'll update and issue an update in week or so (bit busy right now) Symon 2010-11-17 15:00

:?: Just another problem! There is a problem with special character.
If i type:

{{entry>Playground/Cloud|Wolke mit den häufigsten Wörtern}}

It will look like:

Wolke mit den häufigsten Wörtern

:-?Moskito 2010/11/18 15:18

Acknowledged and my apologies, I should know better! Both of your requests have been already fixed the next release, due out as soon as I get the time! Symon 2010-11-23
Released…—Symon 2010-11-25 20:05

:?: Looks good! Just another little problem 8-)
When you use the minus placeholder you can jump from the subjectindex page to the right page in the wiki but not to the right headline of the page. When you use the star or normal entry and click on the subjectindex page on the entry than you go directly to the headline.:-|Moskito 2010/11/27 07:59

Well, the quandary we find ourselves in now: there is no anchor link on the html rendered page to jump to any more “…because i need only the entry in the subjectindex page without the information on the linked page”… so I guess what we really need is a hidden entry (but then it would still be visible in the 'view source' mode. Would be more useful? —Symon 2010-11-27 16:03
I think that the latest 0.4 version fixes your problem; the link is now only hidden, so the page link still works correctly. Symon 2010-12-04
Thank you! I will try it ASAP!! — Moskito 2010/12/06 12:50

:!: I had to change Line 66 of syntax/index.php to this:

 $index = ($value < $index_max) ? $value : 0;

in order to make the displaying of the correct content for each index-page work. Nice plugin. It does exactly what I needed it to! TNX — Nedorus 2011/01/25 17:42

Sorry about that, I thought that I had fixed that sneaky little bug! I'll get a new release posted soon to sort that out.—Symon 2011-01-26 08:05 Fixed in new 0.5 version—Symon 2011-03-27

:?: Hi. I can't seem to make :tags only display #tags#. All my subjectindex pages, regardless of the index=? setting show all tags and entries. Also, all #tags# are under two nested headings of '1' which I cannot get rid of, even with noAtoZ. Is this a bug or have I missed something? — Citizen 2011-08-01

Did you set the target index for tags?:

(Excerpt from help page):

There are a few of settings that can be changed on the Dokuwiki configuration page:

subjectindex_index_pages The Subject-Index page(s) for this wiki, entries without an index number will be added to first one in list. Separate page names with ”;”. The first page is 0 (default), 2nd is 1, 3rd is 2, etc… subjectindex;tags
subjectindex_tag_idx index page for tags only (index number not name!) 1

I would like to improve this configuration option, it is not easy to understand! Suggestions are welcome. —Symon 2011-08-01 11:25

Thanks for the quick reply :). I'm using the default subjectindex;tags, and 1. The problem is that index=blah on the actual subjectindex page (:tags) changes nothing. The entries are linking to :tags and :subjectindex correctly, but both subjectindex pages are displaying content from all indexes, despite being set to display different indexes.
I must confess I don't completely understand indexes or entries properly yet. But I want to get basic tagging working first :) I am right that if subjectindex_tag_idx is 1, and I create a subjectindex page with index=1 it should display tags only, yes?

Citizen 2011-08-01 18:45 +10:00

I believe the problem is here, in action/indexer.php:
// add index number if missing
if (preg_match('`^\d+//.+`', $match) == 0) $match = "0/" . $match;

Citizen 2011-08-01 19:41 +10:00

I have to offer my apologies to you; there was a bug here and I fixed it a while ago but never got around to releasing an updated version. I'll do it later this week. That should fix all your problems!

As an initial explanation about the distinction between indexes and pages this might help (I plan to update the help page accordingly):

Default pages vs. index numbers: SubjectIndex makes a distinction between a index numbers and a default page numbers. All the subject entries you add to pages are collected automatically into a master index, which is separated according to the index number you provided when adding an entry.

For example: {{entry>2/Heading/Item}} will be part of index no.2 in the list. This allows the user to later choose which index should be displayed when creating a Subject Index page.

In addition you can also set which wiki-page should be used as the default target page for entry links (i.e. when you click on an entry's link). This is specified in the configuration of the plugin, and can be per index number. This may seem confusing initially but once you begin to use the plugin it should make sense. If someone comes up with a simpler way to configure this please speak up!–Symon 2011-08-01 13:31

I think I understand reasonably well now, and I'm confident once I really start using it I'll definitely understand. My suggestion for improving the help page would be use-cases and maybe a link to a live page so people could see how others are really using the plugin. I've always found those very helpful, personally. Thank you for creating and maintaining this, it's great! – Citizen 2011-08-01 20:58 +10:00
I looked at git today and noticed you have commented out the “add 0/” line. Without that in there, you do need to explicitly define regular entries as with index 0. Sorry I'm totally unfamiliar with git, but here is a little fix for the regex to make it all work.
if (preg_match('/^\d+\/.+/', $match) == 0)

Have a great day. – Citizen 2011-08-05 14:42 +10:00



Hey, thought it may be useful to provide the possibility to just display a list of tags (without the links to the tagged pages). My hack looks like this (modifications to syntax/index.php)

  // around line 50 I added:
  $opt['justTags'] = false;

  // around line 60 (within the case statements falling through to the true-setting) I added:
  case 'justTags':

  // around line 240 I changed the line 
  //  $entry .= "$anchor>$cur_level$freq" . '<span class="links">' . "$links</span></h$lvl>";
  // to the following:
  if ($opt['justTags']) {
      $entry .= "$anchor>$cur_level$freq</h$lvl>";
  } else {
      $entry .= "$anchor>$cur_level$freq" . '<span class="links">' . "$links</span></h$lvl>";
  }

Then you could use something like the follwing to display the list of tags.

{{subjectindex>border;cols=4;proper;index=1;title;noAtoZ;justTags}}

At least for me, using the current code provided at github, and only using “plain” tags no “advanced” subjectindexing, this works. =) Stef 2011-11-06 16:36



When creating a new page which includes tags, a wrong page index seems to be retrieved by the indexer (in fact no page index at all). So the new entries in data/index/subject.idx will lack the information to which page they link, they look something like 1/sometag| Looking in action/indexer.php, it seems to me that the page has no index at the time the script gets invoked. So I fixed this issue by adding the following line in action/indexer.php, before line 45 where $page_idx gets unset: if ($pid === FALSE) $pid = count($page_idx);
Hope this helps someone else too =) Stef 2011-11-06 17:38

Thanks Stef, I'll check this out later and see what the fundamental problem is.—Symon 2011-11-07 17:59
I can confirm that this fix does work. Great plugin!! —James Greensky 2012-10-24 21:13



:?: Hi, I am getting this error on the page with the subject index, not sure what's wrong:

Warning: htmlspecialchars() expects parameter 2 to be long, string given in /[path]/lib/plugins/subjectindex/syntax/index.php on line 328

I have this code on the page with the subject index:

{{subjectindex>cols=2;proper;title;default}}

And one of my other pages has this:

{{entry>Categories/Music|Music}}

Can you help please? :( Thanks! —H 2012-02-03

:?: Wonderful plugin for which many, many thanks but I am also getting the same error message about htmlspecialchars.

I'll look into this and try to see what the problem is. Bit busy with life right now, so sorry for the delay in responding.—Symon 2012-07-20 13:41

:?: The idea is great. Wish the plugin worked or had a detailed source documentation. Do you plan to publish a bit more detailed example pages? Peter 2012-07-24

Had the same issues with the htmlspecialchars causing errors on line 364 of subjectindex\syntax\index.php.

Replaced it with this: return htmlspecialchars($meta, $link, 'UTF-8'); I can't remember what what was in the $link spot but it was killing it.Blake 2013-07-09'

This has long been fixed in the latest version. MrBertie 2013-07-09 09:33
Great plugin, but i have same problem with latest version (!) of dokuwiki and this plugin: htmlspecialchars causing errors on line 364 of subjectindex\syntax\index.php. simon
Just uploaded a new version, hopefully this recurring bug has been resolved (I hadn't allowed for 'null' being returned).—MrBertie 2013-10-17 19:35
Yes, this works fine! Thanks! simon
How can I change the appearance of a tag? (Without this little star and so on?) Simon

Why do I get the FIXME-message?

I get the FIXME-message:

"Nothing to link to!  First create a default subject index for all entries in this section 
(e.g. {{subjectindex>...section=?;default}}  See plugin help file online for details). 

I get the message even if I use the example in the manual. The massage is hovering above the entries. There is no problem with the subjectindex page.

{{entry>Construction/Foundations}}
{{entry>Construction/Bricklaying}}
{{entry>Construction/Roofing}}
{{entry>Planning/Creating a BOQ}}

{{subjectindex>section=0;...}}

What am I doing wrong?

Have you read the help page?

Yes.

:?: I get subject index showing wrong entries.
Some nodes are shown in a wrong hierarchy path.
Something to do with cache issues ?

:?: What is the meaning of sections ?
I don't get it. Can you say a concrete example of using sections ? I guess that one can use sections for grouping or categorize contents. For example in a site about computers, would I use section 0 to group software reviews, section 1 for programming stuff, section 3 for history and so on ? — MarioD 2014/09/25 06:30

:?: Problem with code blocks
If I use code blocks for C/C++ listings, there where appears preprocessor directives like #ifdef, subjectindex interprets them like tags and shows them in the index, breaking it. — MarioD 2014/09/25 10:56

I may be having a slow day but it's not clear how to use this at all - can I just use #tags on their own? Could you provide a worked example?

Thanks! - DanJ

Bug?

I posted this on github, but perhaps someone from here can help also. While adding entries, and testing them on a page, everything seems to be fine. Yet, the 'output' {{subjectindex>/....}} does not display all entries of the same section. It seems that the indexer (under data/index/subjectindex.idx) updates certain entries as you enter them in, but for some reason removes them afterwards. To be sure, the entries remain on the page, but indexer does not display them.

From what I gather, subjectindex.idx stores the entries, and this file should be updating as you browse your wiki. But as you add more entries, some of them disappear. Perhaps there is an issue with permissions? Also, using searchindex plugin to update the index does help, but as my wiki contains over 3500 entries (and is likely to grow further still), doing this every time would take too much time. Additionally, I would never know when to do this, as it may happen any time that some entries have disappeared, and I would simply not know whether that is the case. Link to github, in case that gets solved sooner than this: https://github.com/MrBertie/subjectindex/issues/14

plugin/subjectindex/discussion.txt · Last modified: 2015-05-07 13:43 by 139.222.137.164

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki