Edgewall Software

Ticket #2532 (closed defect: duplicate)

Opened 3 years ago

Last modified 3 years ago

Search for Camelcase ends up with newpage (ex. search for WikiFormatter)

Reported by: anonymous Owned by: cboos
Priority: low Milestone:
Component: search system Version: 0.9.2
Severity: trivial Keywords: Camelcase Search
Cc:

Description (last modified by cboos) (diff)

When you search for a Word in CamelCase you get redirected to create a "new Page".

Please don't do that! (or at least provide a solution to remove it from the core-code manualy)

  1. It makes problems with JavaClasses, WinAPI-Functions, ...
  2. It's neither professional nor elegant
  3. ...

Attachments

no_camelcase.patch (0.6 KB) - added by anonymous 3 years ago.
No more Camel Case

Change History

Changed 3 years ago by mgood

  • priority changed from high to normal
  • status changed from new to closed
  • resolution set to invalid
  • severity changed from blocker to normal
  • milestone 0.9.3 deleted

If you feel like dealing with this professionally you can search for the related existing tickets or ask on the MailingList or IrcChannel about this, however I don't intend to dignify this flamebait with a response.

Changed 3 years ago by anonymous

Patch for no_camelcase (no more camel_sh*) As discussed in: #425 #476 #1490 #1604 #2526

--- wiki/api.py (Original)
+++ wiki/api.py (Patch)
@@ -185,7 +185,10 @@
     # IWikiSyntaxProvider methods
     def get_wiki_syntax(self):
-        ignore_missing = self.config.get('wiki', 'ignore_missing_pages')
+        no_camelcase = self.config.get('wiki', 'no_camelcase')
+       if no_camelcase in TRUE:
+           return
+       ignore_missing = self.config.get('wiki', 'ignore_missing_pages')
         ignore_missing = ignore_missing in TRUE
         yield (r"!?(?<!/)\b[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+"
                 "(?:#[A-Za-z0-9]+)?(?=\Z|\s|[.,;:!?\)}\]])",

in your trac.ini do

    [wiki]
    no_camelcase = true

There should be a Script which converts all CamelCase (if there is a page to it) to [wiki:link] and leave all others basicaly (Class Names etc.) alone...

Changed 3 years ago by anonymous

  • status changed from closed to reopened
  • resolution invalid deleted

Changed 3 years ago by anonymous

No more Camel Case

Changed 3 years ago by cboos

  • description modified (diff)
  • summary changed from Search for Camelcase fails with newpage (ex. search forWikiFormatter) to Search for Camelcase ends upwith newpage (ex. search for WikiFormatter)

Well, ignoring the offending tone of our anonymous reporter, this "feature" seems to be requested often enough (even in more polite manner) to be at least considered. While I'm not at all in this school of thought (to me, a wiki without CamelCase doesn't even look like a Wiki :) ), I think we could keep the discussion opened. That discussion is actually two fold:

  • disable CamelCase entirely in the wiki (like the patch suggests)
  • disable the quick jump to a Wiki page when a CamelCase word is entered. This is even considered as a feature by some, in order to be able to quickly create a new page (and of course, this is the best way to

end

up with orphaned pages...)

(/me cleaning up the description a bit...)

Changed 3 years ago by dserodio@…

I agree that CamelCase links are the "soul" of a Wiki, but I think disabling the quick jump Wiki page when a CamelCase word is entered would be really nice. Should we open a separate ticket for this?

Changed 3 years ago by cboos

  • owner changed from jonas to cboos
  • priority changed from normal to low
  • status changed from reopened to new
  • severity changed from normal to trivial
  • milestone set to 1.0

I would say, let's keep this one focused on the disable the quick jump to a Wiki page when a CamelCase word is entered topic, as the summary and the description indicate. The disabling of CamelCase links is already discussed at length in #476. I'll copy there the patch proposed above, for further discussion. In the meantime, the disabling of quickjump would be something like that:

Index: Search.py
===================================================================
--- Search.py   (revision 2689)
+++ Search.py   (working copy)
@@ -223,9 +223,10 @@
             if re.match (r, kwd[len('wiki:'):]):
                 return self.env.href.wiki(kwd[len('wiki:'):])
         elif kwd[0].isupper() and kwd[1].islower():
-            r = "((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)"
-            if re.match (r, kwd):
-                return self.env.href.wiki(kwd)
+            if self.config.getbool('search', 'camelcase_quickjump'):
+                r =
"((^|(?<=[^A-Za-z]))[!]?[A-Z][a-z/]+(?:[A-Z][a-z/]+)+)"
+                if re.match (r, kwd):
+                    return self.env.href.wiki(kwd)
     # IWikiSyntaxProvider methods

Changed 3 years ago by mgood

cboos: I don't think we should be special-caseing the quickjump method for this, but should actually be switching that method to use the WikiSystem's known syntax providers instead of all the hardcoded quickjump tests. In that case if CamelCase was disabled as a TracLinks syntax, then it would not be recognized for the quickjump, but I think that all TracLinks syntaxes should be treated equally. Maybe we should disable the quickjump when using the "Search" page and only use it on the search box above the menu.

Changed 3 years ago by cboos

  • status changed from new to closed
  • resolution set to duplicate
  • milestone 1.0 deleted

See #1269.

Add/Change #2532 (Search for Camelcase ends up with newpage (ex. search for WikiFormatter))

Author



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