OpenMS / OpenMS-docs

OpenMS Documentation.
https://openms.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 18 forks source link

old versions #231

Closed timosachsenberg closed 2 months ago

timosachsenberg commented 3 months ago

image

timosachsenberg commented 3 months ago

on abibuilder image

timosachsenberg commented 3 months ago

@jpfeuffer or @poshul or @matteopilz do you know why these are not displayed? they seem to be in the abibuilder folders

timosachsenberg commented 3 months ago

seems to me as if the nightly documentation can't link to the release documentation. anyone can come up with an easy fix for that?

KyowonJeong commented 3 months ago

It is broken for both versions. Only index.html is working but subpages are broken.

jpfeuffer commented 3 months ago

I thought ~~The selector only works from openms.de/org, not from the archive. It cannot be adapted to handle both "path" hierarchies.~~

jpfeuffer commented 3 months ago

But even there, it is true that it apparently only works on the index.html. I have no idea why.

jpfeuffer commented 3 months ago
Screenshot 2024-06-19 at 15 31 40

It just checks the wrong links. For everything but index.html it should add a html subfolder. Code is here: https://github.com/OpenMS/OpenMS/blob/develop/doc/doxygen/common/selectversion.js#L24

JKVISION1101 commented 3 months ago

I checked this problem.

I think index.html links to the correct site, but subpages(related pages, modules, classes...etc) links to incorrect directory, causing problems.

For example.

if i click 2.8.0 version in index.html, it is linked to this page

https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/2.8.0/html/index.html

However,

https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/2.8.0/pages.html was linked to subpages version selector.

The difference between index.html and subpages is that /html/ is missing from subpages..

image

If i add /html/ after 2.8.0 in the subpages, it works very well.

image

I think this problem can be easily resolved by adding /html/ after version in the directory like index.html.

I want to delve deeper into this issue, but I don't know how to build the OpenMS Doxygen.

If you can tell me how to build openms doxygen, I will be able to modify the code.

jpfeuffer commented 3 months ago
Screenshot 2024-06-19 at 15 31 40

It just checks the wrong links. For everything but index.html it should add a html subfolder. Code is here: https://github.com/OpenMS/OpenMS/blob/develop/doc/doxygen/common/selectversion.js#L24

@JKVISION1101 Thanks for checking. You are correct with the evaluation of the problem but I think it is easier to fix it programmatically in the redirecting code linked above (instead of moving the folder structures).

Should be a simple

if not basename == index.html:
  redirectfolder.append("html").append(basename)

(Pseudocode)

Up to you.

JKVISION1101 commented 3 months ago

@jpfeuffer

Thanks for reply.

Your comment helped a lot.

I built doc in the [openms build foler]/doc/OpenMS_doc.sln successfully.

image

However, the output index.html has button for version selector, but doesn't have dropdown for version.

image

Do you know how to make dropdown come out?

jpfeuffer commented 3 months ago

You will need to build another version and put it in the same parent folder.

JKVISION1101 commented 3 months ago

@jpfeuffer

I checked selectversion.js file.

` docs = docs.map((x) => '<a class="verslink" href="'

i think this code is related with site directory linked to specifiic version.

and there are only

/archive/openms/Documentation/release/version/index.html

How about add /html/ in this code?

` docs = docs.map((x) => '<a class="verslink" href="'

However, one thing I don't understand is why the index page and the subfolder have the same HTML header, but the generated links are different.

JKVISION1101 commented 3 months ago

@jpfeuffer

Could you tell me how can i build anoter version and put same parent folder in detail.

and then I want to try above code.

Another suspicious aspect is that the fact that the header file is not being applied in the doxyfile_dot.in file is also questionable.

image

Could you tell me what is doxyfile_dot.in's role?

jpfeuffer commented 3 months ago

You can just copy the docs of same version, rename and put them next to each other. doxyfile_dot is not used for the full documentation.

jpfeuffer commented 3 months ago

@jpfeuffer

I checked selectversion.js file.

` docs = docs.map((x) => '<a class="verslink" href="'

  • urlrootdir
  • '/release/' + x + '/' + patharr[patharr.length - 1] + '">'
  • x
  • '');`

i think this code is related with site directory linked to specifiic version.

and there are only

/archive/openms/Documentation/release/version/index.html

How about add /html/ in this code?

` docs = docs.map((x) => '<a class="verslink" href="'

  • urlrootdir
  • '/release/' + x + '/' + 'html/' + patharr[patharr.length - 1] + '">'
  • x
  • '');`

Yes this is the solution. But you need an if-case for the index.html. For index.html, the current code is correct.

However, one thing I don't understand is why the index page and the subfolder have the same HTML header, but the generated links are different.

What do you mean the links are different? I think they are the same and this is the problem.

JKVISION1101 commented 3 months ago

What do you mean the links are different? I think they are the same and this is the problem.

The index page doesn't produce an error because the linked address contains "html." (I am not sure as abibuilder is not accessible now.)

However, the subfolder page does produce an error because its linked address doesn't contain "html." That's why I mentioned that the generated links are different.

Both the index and subfolder pages apply the same selectversion.js. I'm curious why the index page includes "html" in the address and doesn't encounter an error, while the subfolder page doesn't include "html" and does encounter an error.

Currently, abibuilder is not accessible, so my understanding might be incorrect. Please bear with me.

JKVISION1101 commented 3 months ago

@jpfeuffer

You can just copy the docs of same version, rename and put them next to each other. doxyfile_dot is not used for the full documentation.

in my case, i copied doc folder and rename "2.8.0" in the "openms_development folder"" image

And then go to the doc file and build doc target in the openms_doc.sln. image

image

However, there is no dropdown in the index.html file in the doc folder.

image

I'm always grateful for your answers.

jpfeuffer commented 3 months ago

What do you mean the links are different? I think they are the same and this is the problem.

The index page doesn't produce an error because the linked address contains "html." (I am not sure as abibuilder is not accessible now.)

However, the subfolder page does produce an error because its linked address doesn't contain "html." That's why I mentioned that the generated links are different.

Both the index and subfolder pages apply the same selectversion.js. I'm curious why the index page includes "html" in the address and doesn't encounter an error, while the subfolder page doesn't include "html" and does encounter an error.

Currently, abibuilder is not accessible, so my understanding might be incorrect. Please bear with me.

No, it is the other way round. Selectversion.js NEVER adds html. Index.html works WITHOUT "html/", the rest of the pages only works WITH "html/". It all depends on where the pages lie on the webserver. It is common practice to have the homepage under folder/index.html and the rest under folder/html/anysubpage.html

jpfeuffer commented 3 months ago

@jpfeuffer

You can just copy the docs of same version, rename and put them next to each other. doxyfile_dot is not used for the full documentation.

in my case, i copied doc folder and rename "2.8.0" in the "openms_development folder"" image

And then go to the doc file and build doc target in the openms_doc.sln. image

image

However, there is no dropdown in the index.html file in the doc folder.

image

I'm always grateful for your answers.

Selectversion.js needs very specific folder structures/paths that are adapted to our abibuilder/openms.de

https://github.com/OpenMS/OpenMS/blob/27a46abba2dedf9ebc9aeb826074faa030297a09/doc/doxygen/common/selectversion.js#L2

You need to either adapt it to be more general or reproduce the exact folder structure locally.

jpfeuffer commented 3 months ago

You can also just adapt selectversion.js to your local structure for testing, or if possible even better, make it more general overall to work with more structures.

You can also fix selectversion.js by hard coding/mocking a set of paths (e.g. by copying them from the browser and pasting them in an array). Then comment out the parseDirectoryListing function (and revert before commiting).

JKVISION1101 commented 3 months ago

@jpfeuffer

Thanks Julianus.

I think I found the solution.

This is index page. and as seen below, the href don't have html.

image

And the rest of pages also don't have html

image

So, selectversion.js doesn't make 'html' in both index page and the rest of pages.






the reason why only index page works is that even if the site address does not include 'html', accessing the site automatically generates 'html'.

for example, In index page, If i click red one (this href is "archive/openms/Documentation/release/2.8.0/index.html") in the below image,

image

however, this go to https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/2.8.0/html/index.html (including "html")

image






However, In rest of pages, If i clicked red one (this href is https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/2.8.0/pages.html) in the below image,

image

however, this go to https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/2.8.0/index.html ( NOT including "html") and this make error. image

In summary, It operates solely based on the index page, which automatically redirects to where 'html' exists in the site directory, even if 'html' is not explicitly included. (So, If we add html in the index page by changing selectversion.js code, it doesn't make problem)

docs = docs.map((x) => '<a class="verslink" href="' + urlrootdir + '/release/' + x + '/' + 'html/' + patharr[patharr.length - 1] + '">' + x + '</a>');

Changing the code as described above will resolve the issue.

jpfeuffer commented 3 months ago

Yes, true. Since root/index.html redirects to root/html/index.html, I guess always adding html should be fine! Feel free to prepare a pull request.

JKVISION1101 commented 3 months ago

@jpfeuffer

I tried pull request adding html in the selectversion.js.

However, I haven't do the pull request. so I am not sure that i did it properly.

If possible, please check it.

I really appreciated your help.

Thanks.