MiKTeX / miktex

the MiKTeX source code
https://miktex.org
Other
783 stars 93 forks source link

texdoc generates wrong file URL for html documentation #1349

Open desk7 opened 1 year ago

desk7 commented 1 year ago

When I try to open a package documentation from powershell typing texdoc packagename, the URL of the html file which should be opened is wrong because of a slash / instead of a backslash \. AFAIK, it happens for every package. For example,

texdoc geometry

tries to open c:\Users\USER01\scoop\apps\miktex\current\texmfs/data\miktex\mthelp\geometry.html. Please note the wrong slash between texmfs and data. Please also note that the issue is visible in Firefox but it is not visible with google chrome only because chrome automatically fixes the URL. As verification, this is the related log in texdoc.log:

2023-07-07 19:33:49,441+0200 INFO  texdoc.core - start process: firefox C:\Users\USER01\scoop\apps\miktex\current\texmfs/data\miktex\mthelp\siunitx.html

I think that the issue is linked to this one #551 where, if you carefully read the file URL c:\Program Files\MiKTeX 2.9\doc/latex/koma-script\scrartcl.html you will find the same problem, i.e. the slash.

FYI, I made a minimum installation of TeXLive on another pc and the command texdoc scrletter works well. As a side note, why does texdoc in TeXLive tend to open pdf doc directly while texdoc in MikTeX always opens html files?


initexmf report:

ReportDate: 2023-07-08 11:05:10
CurrentVersion: 23.5
SetupDate: 2023-05-02 19:21:00
SetupVersion: 23.4
Configuration: Portable
GitInfo: 2ed16f7 / 2023-05-03 10:03:00
OS: Windows 10.0.19045
SharedSetup: no
LinkTargetDirectory: C:\Users\USER01\scoop\apps\miktex\current\texmfs\install\miktex\bin\x64
PathOkay: yes
LastUpdateCheck: 2023-07-07 19:56:09
LastUpdate: 2023-07-07 19:56:50
LastUpdateDb: 2023-07-07 19:55:58
SystemAdmin: yes
RootPrivileges: no
AdminMode: no
Root0: C:\Users\USER01\scoop\apps\miktex\current\texmfs\config
Root1: C:\Users\USER01\scoop\apps\miktex\current\texmfs\data
Root2: C:\Users\USER01\scoop\apps\miktex\current\texmfs\install
UserInstall: C:\Users\USER01\scoop\apps\miktex\current\texmfs\install
UserConfig: C:\Users\USER01\scoop\apps\miktex\current\texmfs\config
UserData: C:\Users\USER01\scoop\apps\miktex\current\texmfs\data
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ragibson commented 12 months ago

Note that texdoc in MiKTeX is actually a shim to @edocevoli's mthelp, so this is a duplicate of https://github.com/MiKTeX/miktex/issues/637.

I don't use Windows for development, but was able to replicate this on a local machine with a portable install. @edocevoli was also able to replicate it a long time ago in this comment. Note that they have missed it in the past (as in your linked issue) because their use of Chrome transparently replaces the slashes to correct the broken file path.

The real texdoc has fixed this issue in this portion of it's utilities by converting the path to all lowercase and replacing all forward slashes with back slashes before attempting to view the file.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.