Repository: LizardByte/.github
Pull request #436: docs(rtd): separate active from archived projects
Author: login: ReenigneArcher
Created: 2025-03-02T23:59:32Z | Merged: 2025-03-03T01:21:07Z

## Description
<!--- Please include a summary of the changes. --->
This PR labels archived projects and adds them at the end of the list.


### Screenshot
<!--- Include screenshots if the changes are UI-related. --->


### Issues Fixed or Closed
<!--- Close issue example: `- Closes #1` --->
<!--- Fix bug issue example: `- Fixes #2` --->
<!--- Resolve issue example: `- Resolves #3` --->


## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [x] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files, e.g. `.github/...`)

## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components



Diff:
diff --git a/docs/source/_static/js/projects.js b/docs/source/_static/js/projects.js
index d71d89fa..1c29c0e1 100644
--- a/docs/source/_static/js/projects.js
+++ b/docs/source/_static/js/projects.js
@@ -64,30 +64,44 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+
+            for (let a of [false, true]) {
+                for (let i in sorted_projects) {
+                    if (sorted_projects[i]['archived'] === a) {
+                        // create a new list item
+                        let project_list_item = document.createElement("li")
+                        project_list.appendChild(project_list_item)
+
+                        // create a new link
+                        let project_list_item_link = document.createElement("a")
+                        project_list_item_link.href = sorted_projects[i]['url']
+                        project_list_item_link.target = "_blank"
+                        project_list_item_link.textContent = sorted_projects[i]['name'] + (a ? " (Archived)" : "")
+                        project_list_item.appendChild(project_list_item_link)
+                    }
+                }
             }
         }
 
diff --git a/docs/source/conf.py b/docs/source/conf.py
index fc02d1d5..8761aa0e 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -7,7 +7,6 @@
 # standard imports
 from datetime import datetime
 import os
-import sys
 
 # -- Path setup --------------------------------------------------------------
 
@@ -19,17 +18,13 @@
 source_dir = os.path.dirname(script_dir)  # the source folder directory
 root_dir = os.path.dirname(source_dir)  # the root folder directory
 
-sys.path.append(script_dir)
-if script_dir:
-    import version
-
 # -- Project information -----------------------------------------------------
 project = 'LizardByte'
 project_copyright = f'{datetime.now().year}, {project}'
 author = 'ReenigneArcher'
 
 # The full version, including alpha/beta/rc tags
-version = version.version
+version = os.getenv('READTHEDOCS_VERSION', 'latest')
 
 # -- General configuration ---------------------------------------------------
 


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## PR Overview

This PR updates the documentation to differentiate active and archived projects by labeling archived ones and appending them at the end of the list.
- Added logic in projects.js to detect and label archived projects.
- Reordered and expanded the sorting/filtering loop and removed unused sys/path adjustments in conf.py.

### Reviewed Changes

| File                                | Description                                                   |
| ----------------------------------- | ------------------------------------------------------------- |
| docs/source/_static/js/projects.js  | Implements filtering and labelling of archived projects; includes debug log statements that may need removal. |
| docs/source/conf.py                 | Removes sys.path modifications and retrieves version from an environment variable. |

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.



state: COMMENTED
author_association: NONE
submitted_at: 2025-03-03T01:18:43Z

Review comments:
diff_hunk: @@ -64,30 +64,49 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+            console.log(sorted_projects)
+
+            for (let a of [false, true]) {
+                console.log(a)
+                for (let i in sorted_projects) {
+                    console.log(sorted_projects[i])
+                    console.log(sorted_projects[i]['name_lower'])
+                    console.log(sorted_projects[i]['archived'])
path: docs/source/_static/js/projects.js
user: login: Copilot
body: Remove the console.log statement to avoid leaking debug information in production code.
created_at: 2025-03-03T01:18:42Z
author_association: NONE
diff_hunk: @@ -64,30 +64,49 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+            console.log(sorted_projects)
+
+            for (let a of [false, true]) {
+                console.log(a)
+                for (let i in sorted_projects) {
+                    console.log(sorted_projects[i])
+                    console.log(sorted_projects[i]['name_lower'])
+                    console.log(sorted_projects[i]['archived'])
path: docs/source/_static/js/projects.js
user: login: Copilot
body: Remove the console.log statement to prevent unnecessary debug output in the final code.
created_at: 2025-03-03T01:18:42Z
author_association: NONE
diff_hunk: @@ -64,30 +64,49 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+            console.log(sorted_projects)
+
+            for (let a of [false, true]) {
+                console.log(a)
+                for (let i in sorted_projects) {
+                    console.log(sorted_projects[i])
+                    console.log(sorted_projects[i]['name_lower'])
+                    console.log(sorted_projects[i]['archived'])
path: docs/source/_static/js/projects.js
user: login: Copilot
body: Remove the console.log statement to clean up the debugging traces before deployment.
created_at: 2025-03-03T01:18:43Z
author_association: NONE
diff_hunk: @@ -64,30 +64,49 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+            console.log(sorted_projects)
+
+            for (let a of [false, true]) {
+                console.log(a)
+                for (let i in sorted_projects) {
+                    console.log(sorted_projects[i])
+                    console.log(sorted_projects[i]['name_lower'])
+                    console.log(sorted_projects[i]['archived'])
path: docs/source/_static/js/projects.js
user: login: Copilot
body: Remove the console.log statement used for debugging the project name; these logs should be cleared for production.
created_at: 2025-03-03T01:18:43Z
author_association: NONE
diff_hunk: @@ -64,30 +64,49 @@ $(document).ready(function() {
             let projects = []
 
             for (let i in data) {
-                // add the project to the dictionary
-                projects.push(
-                    {
-                        'name': data[i]['child']['name'],
-                        'name_lower': data[i]['child']['name'].toLowerCase(),
-                        'url': data[i]['child']['urls']['documentation']
+                // check if the project is archived
+                let archived = false
+                for (let tag in data[i]['child']['tags']) {
+                    if (data[i]['child']['tags'][tag] === "archived") {
+                        archived = true
                     }
-                )
+                }
+
+                // create a new project dictionary
+                let project = {
+                    'name': data[i]['child']['name'],
+                    'name_lower': data[i]['child']['name'].toLowerCase(),
+                    'url': data[i]['child']['urls']['documentation'],
+                    'archived': archived
+                }
+
+                // add the project to the list
+                projects.push(project)
             }
 
             // sort the projects by name
-            let sorted = projects.sort(rankingSorter('name_lower', 'name')).reverse()
-
-            for (let i in sorted) {
-                // create a new list item
-                let project_list_item = document.createElement("li")
-                project_list.appendChild(project_list_item)
-
-                // create a new link
-                let project_list_item_link = document.createElement("a")
-                project_list_item_link.href = sorted[i]['url']
-                project_list_item_link.target = "_blank"
-                project_list_item_link.textContent = sorted[i]['name']
-                project_list_item.appendChild(project_list_item_link)
+            let sorted_projects = projects.sort(rankingSorter('name_lower', 'name')).reverse()
+            console.log(sorted_projects)
+
+            for (let a of [false, true]) {
+                console.log(a)
+                for (let i in sorted_projects) {
+                    console.log(sorted_projects[i])
+                    console.log(sorted_projects[i]['name_lower'])
+                    console.log(sorted_projects[i]['archived'])
path: docs/source/_static/js/projects.js
user: login: Copilot
body: Remove the console.log statement to eliminate debug output from the production build.
created_at: 2025-03-03T01:18:43Z
author_association: NONE

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-03-03T01:20:20Z
body: ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=LizardByte_.github&pullRequest=436) **Quality Gate failed**  
Failed conditions  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [2 New issues](https://sonarcloud.io/project/issues?id=LizardByte_.github&pullRequest=436&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [2 New Code Smells](https://sonarcloud.io/dashboard?id=LizardByte_.github&pullRequest=436) (required ≤ 0)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=LizardByte_.github&pullRequest=436)

##   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)


author_association: NONE