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

Add versioning to the documentation based on docausaurus #845

Open
Meakk opened this issue Jun 6, 2023 · 9 comments
Open

Add versioning to the documentation based on docausaurus #845

Meakk opened this issue Jun 6, 2023 · 9 comments
Labels
help wanted Please help with this issue! type:documentation Improvements or additions to documentation
Milestone

Comments

@Meakk
Copy link
Contributor

Meakk commented Jun 6, 2023

Context
Currently, the documentation in https://f3d.app is automatically generated when a commit is pushed on master.
Also, the "main" page is based on the readme from github, which is fine but may be a bit disoriented for users not familiat with github.

We need to add a nice looking, web-only welcome page containing:

  • A nice image and explanation of what F3D is
  • A download button for the last release (as in INSTALATION.md)
  • A way to simply jump to the doc of a specific version

Suggested solution

  • Craft a welcome page using web skills
  • On release make a copy of the website somewhere that do not evolve anymore, store in a dedicated folder in gh-pages
  • Add a selector logic in the website to switch between version

Skills

  • Jekyll
  • Web stuff

Selector code

diff --git a/assets/main.js b/assets/main.js
index a1817087..8d190acf 100644
--- a/assets/main.js
+++ b/assets/main.js
@@ -2,6 +2,26 @@ function onload(event) {
   if (window.location.pathname.endsWith("/INSTALLATION.html")) {
     enhance_install_page();
   }
+  add_version_selector();
+}
+
+const VERSIONS = ["master", "2.4.0", "2.3.0"];
+
+function add_version_selector() {
+  const select = document.createElement("select");
+  for (const version of VERSIONS) {
+    const option = document.createElement("option");
+    option.innerText = version;
+    select.appendChild(option);
+  }
+  select.addEventListener("change", (event) => {
+    window.location.href = event.target.value;
+  });
+
+  select.style.display = "block"; //TODO move to css
+
+  const footer = document.querySelector("footer");
+  footer.insertBefore(select, footer.firstChild);
 }
 
 function enhance_install_page() 
@mwestphal mwestphal added this to the 3.0.0 milestone Jul 5, 2023
@mwestphal mwestphal added the type:documentation Improvements or additions to documentation label Jul 5, 2023
@mwestphal mwestphal added the help wanted Please help with this issue! label Jan 7, 2024
@mwestphal mwestphal mentioned this issue Jan 23, 2024
7 tasks
@mwestphal mwestphal modified the milestones: 3.0.0, 2.4.0 Feb 3, 2024
@mwestphal
Copy link
Contributor

just-the-docs has an issue for this but it seems inactive: just-the-docs/just-the-docs#728

@mwestphal
Copy link
Contributor

github-pages-deploy-action seems to be able to deploy to a specific folder. We could deploy master on a dedicated master folder and add a step to the release to generate for release as well.

Then some javascript magic from @snoyer could make the combobox appears ? :)

@mwestphal mwestphal changed the title Add versioning in the documentation Add versioning in the documentation and a welcome page Mar 16, 2024
@mwestphal
Copy link
Contributor

After some investigation by @snoyer and myself, it looks like have an "out of version" welcome page with a javascript based selector should be the way to go, I will edit the issue accordingly

@mwestphal mwestphal modified the milestones: 2.4.0, 2.5.0 Apr 4, 2024
@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented May 15, 2024

Hello,

I have a question ? Using Jekyll is mandatory ? Do you think we can remove Jekyll from doc building system and use only sphinx ?

I made some tests with this theme, and I think we could reproduce the current documentation but with the same 'version selector' system of Blender API (Methods describe here)

image

Moreover by using sphinx building tool we can directly embed libf3d API doc inside the website and make it more visible than this link.

image

I found a lot of extensions to prevent convert of current md files to rst so we will just have to update the building tool note documentation

What do you think about that ? I can make some tests if you want I will have some spare time tomorrow

@mwestphal
Copy link
Contributor

Actually this is being discussed on discord and we are thinking to go with docausaurus, please join the discussion there https://discord.f3d.app

@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented May 16, 2024

Sorry, I'm not so active on discord ! I will read the fead asap ! Thanks a lot !

1 similar comment
@Ni-g-3l
Copy link
Contributor

Ni-g-3l commented May 16, 2024

Sorry, I'm not so active on discord ! I will read the fead asap ! Thanks a lot !

@mwestphal
Copy link
Contributor

No worries! Let me know if you want a TLDR of the discussion.

@mwestphal mwestphal changed the title Add versioning in the documentation and a welcome page Add versioning to the documentation based on docausaurus May 27, 2024
@mwestphal
Copy link
Contributor

@chirag-droid has created a prototype of this which is visible here:

#1338

@mwestphal mwestphal modified the milestones: 2.5.0, 3.0.0 Jun 26, 2024
@mwestphal mwestphal modified the milestones: 3.0.0, 3.1.0 Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help with this issue! type:documentation Improvements or additions to documentation
Projects
Status: To do
Development

No branches or pull requests

3 participants