Skip to content

Add optional support for replacing underscores in node names by spaces.#166

Open
cxtal wants to merge 1 commit intosamuelet:masterfrom
cxtal:master
Open

Add optional support for replacing underscores in node names by spaces.#166
cxtal wants to merge 1 commit intosamuelet:masterfrom
cxtal:master

Conversation

@cxtal
Copy link

@cxtal cxtal commented Dec 2, 2016

Hello,

This is a patch that adds an option (scorespace) that will make indexmenu replace underscores in node names with spaces. Although Dokuwiki has the useheading option, sometimes none of those options are good enough. With the Dokuwiki useheading option, you get the choice between having page names with underscores or, in short, using the first heading which is not a viable solution because you may start pages with something else other than a title (ie: "About" or "Introduction", etc...).

One of the problems is that, suppose you have a menu item generated as:

auction_items_under_existing_character

and if you stumble onto the page with the index and you know you are looking for something related to items or auction, then if you search in any browser for strings such as auction items, nothing will be found - even though that exact semantic is present on the page.

With this patch and by setting the option scorespace to the list of javascript options (next to notoc, and the rest), indexmenu will replace any underscores in node names with a single space character. It is a solution local to indexmenu to avoid setting the Dokuwiki useheading option and instead have indexmenu generate items with spaces for you.

Please apply if useful!

Regards,

@topkecleon
Copy link

Does/can this capitalize the first letter of each word?

@cxtal
Copy link
Author

cxtal commented Apr 19, 2022

Does/can this capitalize the first letter of each word?

No, it does not. It removes the underscore from menu listings though.

@cxtal
Copy link
Author

cxtal commented Apr 19, 2022

If someone is wondering:

and you are done (remember to add scorespace to the parameters in the indexmenu settings).

4 years ago...

images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants