-
Notifications
You must be signed in to change notification settings - Fork 5
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
Updated /docs/source/PCs/ARM/RK3399/Manuals/Hardware/index #259
Conversation
Hi Randy, Thanks so much for investigating the issue. When I was rewriting these index pages, I tried it like you proposed, the problem is we have many index pages before combining different product lines into one index page. For example, we had this: https://docs.chipsee.com/PCs/ARM/RK3399/Manuals/Hardware/index.html, it's a legacy index page (https://github.com/Chipsee/Documentation/blob/main/docs/source/PCs/ARM/RK3399/Manuals/Hardware/index.rst?plain=1). If I write the relative link like the proposed method, the links in this old index pages will not work, it will show a 404 because the link will go to this page(http://localhost:8000/PCs/ARM/RK3399/Manuals/Hardware/RK3399/Manuals/Hardware/CS10600R070.html), you can test it locally. But some people might still visit these old index pages (which is relatively rare), so it will cause those people to navigate to 404. I hope this give you more information |
You are right. If you still need those index pages then this solution won't work well. Let me take another look and get back to you. |
So upon reading the .. |PPC-A72-101| image:: /Media/ARM/A72/CS12800R101P/CS12800R101P-Front-Low.jpeg
:class: index-item-img
:target: `PPC-A72-101`_ This solves the problem for both the new and old index pages but this approach is not working in the docs because we refer to the reference name ( /home/isolveit/Documents/myCodes/Codes/Work/chipsee_demo/chipsee_docs/docs/source/PCs/ARM/RK3399/Manuals/Hardware/index:31: WARNING: undefined label: 'ppc-a72-101'
/home/isolveit/Documents/myCodes/Codes/Work/chipsee_demo/chipsee_docs/docs/source/PCs/ARM/RK3399/Manuals/Hardware/index:31: WARNING: undefined label: 'ppc-a72-101' I am researching a way to fix this then I am sure it will fix the issue. Will get back to you soon. |
That looks promising! |
Seems like Sphinx doesn't support internal link for images, which is specified by reST but not implemented in Sphinx: |
Maybe we can just leave a link to the combined index page in the legacy index page, and let user click; or let Wordpress redirect user from legacy index page to combined index page? |
After some more investigation, it seems there is no way to handle this Can you please also take a look at the icon images in the software part (http://chipsee.kinsta.cloud/docs/PCs/ARM/index-rockchip.html#software)? The images are here:
And the files are here: https://github.com/Chipsee/Documentation/blob/4a45fae3460b8bf900d1c0b0155916b9da75a14c/docs/source/_static/images/os_logo_linux.png. Same relative path problem, I don't know if Sphinx is able to handle these. Please also take a look at the 3D models, we need them like in this page: https://docs.chipsee.com/PCs/Pi/A72/Manuals/Hardware/CS10600RA4070P-D.html#d-model, you can click the big red link and view them in a 3D viewer. But they don't seem to work in sub folder, like this: http://chipsee.kinsta.cloud/docs/PCs/Pi/A72/Manuals/Hardware/CS10600RA4070P-D.html#d-model. The 3D model page uses an orphan .RST page: https://github.com/Chipsee/Documentation/blob/main/docs/source/ThreeD/three_d_model.rst?plain=1, and just load a three.js package. I also need to HEAD for 3D files with JS, to find out how many 3D files there are of a product. For example, the link above has one PPC 3D file, but this one: https://docs.chipsee.com/PCs/Pi/A72/Manuals/Hardware/CS10600RA4070.html#d-model, has two 3D file, because there is no "if-else condition" if Sphinx, I have to HEAD with Javascript every time the page is opened by the user to determine, check this function I wrote for this:
With the sub folder, these 3D files in the I'm not sure if this is the Sphinx way to do all these, I have very little knowledge about Sphinx, if you can find a way to give our users same information, you can alter the codes, it doesn't have to be the way I wrote it, anything that can work can be a solution for us. |
Yeah. By default, the Sphinx target option doesn't support referencing internal hyperlink targets from a different document. |
I will also check the other issues you have stated here and see if I could do something about that too. |
…rget:` option - Updated some software index files to show how it is done.
Hi @printfinn , So if you want to add a document's HTML file as a target link to an image, you just need to pass an absolute path like below: .. |EPC/PPC-A72-101-C| image:: /Media/ARM/A72/CS12800R101/PPC-A72-101-C-Front-Low.jpeg
:class: index-item-img
:target: /PCs/ARM/RK3399/Manuals/Hardware/CS12800R101.html
.. OR
.. image:: /_static/images/os_logo_linux.png
:width: 100px
:class: img-fluid text-center
:target: /PCs/ARM/RK3568/Manuals/Software/Buildroot_Linux_Qt_5_15.html Then the custom image directive will fix the URI provided to the I also updated some software index files to show how it can be done. I will like to tackle the 3D model issue separately to better understand how to fix it. |
The value for the ☑️ Fixed issue in this commit: I have reviewed the code and seen the issue you were asking about. Although the implementation works, it fails as you described above. Let me correct the issue and get back to you. You can try the example you gave above and it will work. |
It works! I'm working on rewriting all these links in the index pages now. |
Great 👍🏽. You must merge this PR into the main branch to add the custom image directive and other changes. |
I've pushed my changes of the other index pages to this branch. As for the 3D models, I've written a message in the doc. We can merge this PR first, then you can work on the 3D model, and use another PR to fix the 3D models part. Is that OK? |
Fixed image target link issues in /docs/source/PCs/ARM/RK3399/Manuals/Hardware/index.
When setting the value for the
:target:
option under the..image
directive, it will be best if we use relative target links.So instead of using an absolute path which works not under the
/docs/
path like below:We can set the
:target:
option to a relative path like below:The relative path is just a link to the RST document (i.e.
RK3399/Manuals/Hardware/CS12102R170P.rst
) but will have an.html
suffix (i.e.RK3399/Manuals/Hardware/CS12102R170P.html
)