Skip to content

Conversation

TanCodeX
Copy link
Contributor

What does this PR do?

This PR enhances the wiki generation script to improve inclusion, structure, and clarity of documentation for module-level content. It:

  • Adds support for README.md files in modules
  • Introduces a "Modules" section in the sidebar
  • Preserves actual module directory structure in navigation
  • Adds "Module: " prefix to titles for clarity
  • Retains existing handling for doc/ files

Fixes #1288

Summary of Changes

  • File Selection

    • Includes README.md files from all module directories (excluding paths in FILE_EXCLUDES)
  • Path Naming

    • Module README names like module-path-to-module ensure uniqueness
  • Title Generation

    • Uses the first heading in the file
    • Prefixes with "Module: " for module README files
  • Sidebar Updates

    • Adds a new “Modules” section to the sidebar
    • Maintains the module's folder hierarchy for clarity
  • Special Case Handling

    • Added "Modules" to format_name() special formatting logic

How to Test

  • Run the updated wiki generation script
  • Confirm that:
    • All doc/ content is present
    • Module README.md files are included under "Modules"
    • Sidebar hierarchy matches directory structure
    • Titles prefixed with "Module: " appear correctly
    • Internal links work in module documentation

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Chore / Maintenance

Mandatory Tasks

  • Self-reviewed the code
  • Verified the new output structure
  • Checked documentation for consistency
  • Validated link rendering in generated wiki

Checklist

  • I followed the project’s style guidelines
  • I tested my changes locally
  • I commented on complex areas of the code
  • I confirmed the script produces no warnings or errors
  • I ensured no breaking changes were introduced

@KernelDeimos
Copy link
Contributor

Hi, thanks for submitting this PR - that was pretty quick! I'm going to review this tomorrow. If you're able to set the indentation back to what it was before (4 spaces) that will make this a little easier to review. Generally I prefer indentation changes to be separate, and then we also need an explanation as to why (ex: other files using this convention). I assume in this case it's just an editor thing, and hopefully we'll fix inconsistencies like this by adding proper editor configs (btw are you using vscode or something else? I want to know why this happens for most contributors; I think I disabled that feature a long time ago)

@TanCodeX
Copy link
Contributor Author

Thanks for the feedback.
You're right - it was an editor thing. I'm using VS Code with the Prettier extension, which auto-formatted the file on save. I’ll revert the indentation back to 4 spaces and push an update shortly.

@KernelDeimos
Copy link
Contributor

Hi, thanks for the update. There are still too many formatting changes at the moment, but I reviewed the code and the approach looks good.

@TanCodeX
Copy link
Contributor Author

@KernelDeimos If you can list me all the formatting changes that need to be fixed (like earlier you mentioned keeping indentation to 4 spaces). I can update accordingly.

@KernelDeimos
Copy link
Contributor

You can see all the formatting changes under the "files changed" tab. If a line of code is not functionally changed, the formatting shouldn't be changed (it can be changed in a separate style-only PR)

@TanCodeX
Copy link
Contributor Author

TanCodeX commented Jun 1, 2025

I understand what you’ve mentioned. This PR was primarily meant for code modifications, not just formatting changes. However, some formatting updates got included later on because my vs code auto-formatted the code due to the Prettier extension. I’ll make sure to keep formatting and functional changes in separate pull requests in future. Thanks for the guidance!

@KernelDeimos
Copy link
Contributor

Looking at the wiki diff after running the tool, I'm noticing there were previously README.md files inside miscellaneous doc dirs as well, and these are now removed.

diff --git a/_Sidebar.md b/_Sidebar.md
index 809790c..712f581 100644
--- a/_Sidebar.md
+++ b/_Sidebar.md
@@ -1,13 +1,13 @@
 ## General
 
 * [Home](Home)
+* [Index (README.md)](README)
 * [Documentation for Robots](AI)
 * [Meta Documentation](docmeta)
 * [Puter in Production](prod)
 * [Testing with Email](testing_with_email)
 
 ## API
-* [Index (README.md)](api-README)
 * [api drivers](api-drivers)
 * [Group Endpoints](api-group)
 * [Notification Endpoints](api-notifications)
@@ -29,13 +29,100 @@
 * [Repository Structure and Tooling](contributors-structure)
 
 ### Extensions
-* [Index (README.md)](contributors-extensions-README)
 * [contributors extensions definitions](contributors-extensions-definitions)
 * [contributors extensions events](contributors-extensions-events)
 
 ## Devmeta
 * [Track Comments](devmeta-track_comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include module README.md files in wiki generation
2 participants