Edgewall Software

Ticket #425 (assigned enhancement)

Opened 5 years ago

Last modified 2 years ago

Wiki page name need to support digits and periods

Reported by: barry.scott@… Owned by: cboos
Priority: high Milestone: 1.0
Component: wiki system Version: 0.8
Severity: normal Keywords:
Cc:

Description

Restricting Wiki page names to only alphabetic chars makes it very have to create pages that discuss MilestoneV1.0 etc

Is there any problem with allowing digits and period?

Attachments

Change History

  Changed 5 years ago by jonas

  • status changed from new to assigned
  • milestone set to 0.7.1

Good point, I just think this is something we've overlooked.

  Changed 5 years ago by anonymous

[560] adds support for digits in CamelCase-names. I'm not sure if it's a good thing to allow periods as well.

This change should be merged into 0.7-stable before this ticket is closed.

  Changed 5 years ago by jonas

  • status changed from assigned to closed
  • resolution set to fixed

I changed my mind and added support for periods as well.

Fixed in both trunk and 0.7-stable.

  Changed 4 years ago by anonymous

This feature appears to have been removed in 0.8 (presumably related to ticket #775).

  Changed 4 years ago by cboos@…

  • status changed from closed to reopened
  • resolution fixed deleted
  • version changed from 0.6.1 to 0.8
  • component changed from general to wiki
  • milestone 0.7.1 deleted

I didn't know about these tickets, and ended up implementing it for myself...

I think this depends on the software being worked on. Here we have a product suite with 3D in the name. It would be rather annoying to spell each related wiki page ThreeD something...

What about making this feature configurable?

[wiki]
allow_digits_in_name = 1

  Changed 4 years ago by cmlenz

Note that ThreeD isn't a valid wiki name either, it'd have to be ThreeDee?.

So we want to avoid that names such as A0B1 (the example from #775) are recognized as wiki page names. Quite obviously A0B1 has nothing camel-ish to it.

One option would be to treat digits as uppercase characters. So A0B1 would not be a wiki name, but 1a2b would be. So you could use e.g. 3d as a wiki page names. Does that feel right? I'm not sure.

And for what it's worth, I'm not really in favor of adding configuration options that alter the wiki syntax like this.

  Changed 4 years ago by cboos@…

One option would be to treat digits as uppercase characters.

That would help, but it would be useful to have consecutive digits:

The following:

!python
   # ...
   wiki = r"""(?P<wikilink>!?(^|(?<=[^A-Za-z\d]))[A-Z][a-z][a-z\d]*(?:[A-Z][a-z\d]*[a-z\d/])+(?=\Z|\s|[.,;:!?\)}\]]))"""

matches all of the above and none of #775.

It is still quite easy to fool, like with Aa1B0. But then, AaxZqerzW" doesn't look to be a valid wiki page name from a human perspective either...

  Changed 4 years ago by cboos@…

Sorry, I just saw that I added another messed up comment! One day, I will use the Preview feature, promised :). In the meantime I'll work on edit/delete action for comments, along the line of what I did in #948 for the attachments...

  Changed 4 years ago by cboos

  • owner changed from jonas to cboos
  • status changed from reopened to new

The upcoming InterTrac related wiki refactoring will enable the creation of alternate WikiPageNames rules. As examples, I'll write one that integrates my old proposal above, and one that follows the SubWiki rules.

  Changed 3 years ago by cboos

  • status changed from new to assigned
  • severity changed from normal to enhancement

Implemented in r2005 (InterTrac branch)

  Changed 3 years ago by cboos

  • severity changed from normal to minor
  • milestone set to 1.0

Should I backport the above to the trunk?

  Changed 3 years ago by mgood

Well, there seems to be a lot of debate about automatic CamelCase linking right now and I think that mixing in possibilities for digits, etc. will possibly match even weirder page names like cmlenz mentioned above that don't really make sense as WikiNames?.

I think that we should put requests for changes to the CamelCase criteria on hold to discuss it a bit. Since it's pretty easy now to use [wiki:MilestoneV1.0] I don't really see a reason to add this complexity to the CamelCase matching.

  Changed 3 years ago by mgood

I should also not that milestone pages can already contain Wiki content, so creating a separate Wiki page for a milestone is probably not a good idea and the relevant information should just be put on the milestone page such as milestone:1.0

  Changed 3 years ago by cboos

  • priority changed from normal to high
  • severity changed from minor to normal

See also FlexibleWikiPageNames.

The particular syntax that would allow as Wiki page names:

(but none of A0B1, ST62T53C6, IR32V1H000, the examples from #775), can be enabled by modifying the [components] section of the TracIni in the following way:

[components]
# Standard Trac WikiPageNames rule
trac.wiki.api.StandardWikiPageNames = disabled
# Standard Trac WikiPageNames rule, plus digits
trac.wiki.api.FlexibleWikiPageNames = enabled
# SubWiki-like rules for WikiPageNames.
trac.wiki.api.SubWikiPageNames = disabled

in reply to: ↑ description   Changed 2 years ago by anonymous

Replying to barry.scott@onelan.co.uk:

Restricting Wiki page names to only alphabetic chars makes it very have to create pages that discuss MilestoneV1.0 etc Is there any problem with allowing digits and period?

that's no problem.

Add/Change #425 (Wiki page name need to support digits and periods)

Author



Change Properties
<Author field>
Action
as assigned
as The resolution will be set. Next status will be 'closed'
to The owner will change from cboos. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.