Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's this? command opens wrong wiki article url #151

Closed
hasecilu opened this issue Feb 10, 2024 · 3 comments · Fixed by #153 or #176
Closed

What's this? command opens wrong wiki article url #151

hasecilu opened this issue Feb 10, 2024 · 3 comments · Fixed by #153 or #176

Comments

@hasecilu
Copy link
Contributor

hasecilu commented Feb 10, 2024

As you may know FreeCAD have a Help module where using the What's this? command you can click on a command on the toolbar and the wiki page for it will open.

The way it works is: it opens https://wiki.freecad.org/{$Command_name}.

In the wiki the convention to name pages is: WorkbenchName_CommandName, so in order to make this work, ideally your commands should be named the same. Example: https://wiki.freecad.org/PartDesign_Pad

For instance to create an InvoluteGear with FCGear WB you use CreateInvoluteGear command, when using What's this? command on it opens https://wiki.freecad.org/CreateInvoluteGear/ when the documentation of that command is in https://wiki.freecad.org/FCGear_InvoluteGear article.

  • One option is to rename the classes
  • Another option is to create a dummy class that wrap the original ones in case just renaming breaks something
  • Go to Help module and somehow hardcode the redirections
@looooo
Copy link
Owner

looooo commented Feb 11, 2024

isn't it possible to rename the wiki pages?

@hasecilu
Copy link
Contributor Author

I think that would be possible but it would break the "naming convention". I asked on the wiki forum: https://forum.freecad.org/viewtopic.php?t=85208

@hasecilu
Copy link
Contributor Author

hasecilu commented Feb 14, 2024

I checked the code and it seems we only need to rename the command on gui.addCommand() to make it work, so no need to mess with the class names. But I'm still figuring out why using What's this? adds an / to the url making it to not open correctly, you need to manualy remove it going to Web WB and use Web_BrowserSetURL. That doesn't happen with native FreeCAD commands.

Maybe the Wiki should redirect removing /.

Edit: Looking at the log it opens es docs, it's just that the url in the url bar doesn't correspond to opened url, removing the translation suffix on Help preferences fix it, so it's working fine.

Log: Help: opening https://wiki.freecad.org/FCGear_InvoluteGear/es

    commands = [
        "FCGear_InvoluteGear",
         ...
    ]



        gui.addCommand("FCGear_InvoluteGear", CreateInvoluteGear())
        gui.addCommand("FCGear_InternalInvoluteGear", CreateInternalInvoluteGear())
        ...

hasecilu added a commit to hasecilu/freecad.gears that referenced this issue Feb 15, 2024
Making this change will enable users to use `What's this?` command on FCGear
commands and get the correct Wiki article.

Fix looooo#151
hasecilu added a commit to hasecilu/freecad.gears that referenced this issue Sep 12, 2024
Making this change will enable users to use `What's this?` command on FCGear
commands and get the correct Wiki article.

Fix looooo#151
@looooo looooo closed this as completed in 7911050 Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants