Skip to content

feat(docs): add nexus page BBCode generator#15

Merged
codepuncher merged 1 commit into
mainfrom
feat/nexus-page-sync
May 20, 2026
Merged

feat(docs): add nexus page BBCode generator#15
codepuncher merged 1 commit into
mainfrom
feat/nexus-page-sync

Conversation

@codepuncher

Copy link
Copy Markdown
Owner

Summary

Adds a Python script that generates Nexus Mods BBCode from the user-facing section of README.md, so requirements, installation, and compatibility only need to be maintained in one place.

  • scripts/generate-nexus-page.py: reads README nexus block, converts Markdown→BBCode, injects into template, prints to stdout

Usage:

python scripts/generate-nexus-page.py
# pipe to clipboard:
python scripts/generate-nexus-page.py | xclip -selection clipboard

Testing

Ran the script and verified output matches expected BBCode structure.

Breaking Changes

Related

Copilot AI review requested due to automatic review settings May 20, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small documentation toolchain to keep Nexus Mods page BBCode in sync with the user-facing README content, reducing duplication between README.md and docs/nexus-page.md.

Changes:

  • Added a Python script to extract a marked README block, convert limited Markdown to BBCode, and inject it into a Nexus page template.
  • Added a <!-- nexus:start/end --> block in README.md containing Requirements/Installation/Compatibility intended for Nexus.
  • Added <!-- generated:start/end --> markers inside the BBCode fence in docs/nexus-page.md to define the injection region.

Reviewed changes

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

File Description
scripts/generate-nexus-page.py New generator script: README block extraction, Markdown→BBCode conversion, and template injection to stdout.
README.md Adds the Nexus-specific user-facing block (requirements/install/compatibility) bounded by markers.
docs/nexus-page.md Adds generated block markers inside the BBCode template to support automated injection.
Comments suppressed due to low confidence (1)

scripts/generate-nexus-page.py:139

  • Same issue as above: if the end marker is before the start marker, the error only references the start marker constant. Please include both markers (or indices) to make the failure actionable when the template is malformed.
    if start >= end:
        sys.exit(f"error: end marker appears before start marker: {GEN_START!r}")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/generate-nexus-page.py Outdated
Comment thread scripts/generate-nexus-page.py Outdated
Comment thread scripts/generate-nexus-page.py
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch from 0988c9c to acc672f Compare May 20, 2026 17:38
Copilot AI review requested due to automatic review settings May 20, 2026 17:39
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch from acc672f to 8a43473 Compare May 20, 2026 17:39
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch 2 times, most recently from 99d65df to 90fd2ff Compare May 20, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

Comment thread docs/nexus-page.md Outdated
Comment thread scripts/generate-nexus-page.py
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch from 90fd2ff to f0b087d Compare May 20, 2026 17:48
@codepuncher
codepuncher requested a review from Copilot May 20, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

scripts/generate-nexus-page.py:146

  • inject_generated() finds GEN_END with bbcode_content.find(GEN_END) from the beginning of the BBCode block. If <!-- generated:end --> appears earlier than the intended region (or if multiple regions exist), this can select the wrong end marker and break injection. Find GEN_END starting after GEN_START (e.g., bbcode_content.find(GEN_END, start + len(GEN_START))) and consider checking for multiple occurrences to avoid ambiguous templates.
def inject_generated(bbcode_content: str, generated: str) -> str:
    start = bbcode_content.find(GEN_START)
    end = bbcode_content.find(GEN_END)
    if start == -1:
        sys.exit(f"error: marker not found: {GEN_START!r}")
    if end == -1:
        sys.exit(f"error: marker not found: {GEN_END!r}")
    if start >= end:
        sys.exit(f"error: end marker {GEN_END!r} appears before start marker {GEN_START!r}")
    return (
        bbcode_content[:start]
        + GEN_START + "\n"
        + generated + "\n"
        + bbcode_content[end:]
    )

Comment thread scripts/generate-nexus-page.py

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

Comment thread scripts/generate-nexus-page.py Outdated
Comment thread docs/nexus-page.md
Comment thread scripts/generate-nexus-page.py
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch from d71bb5a to 6f35adf Compare May 20, 2026 19:53
Copilot AI review requested due to automatic review settings May 20, 2026 19:54
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch 2 times, most recently from 778b9bf to 271ddf6 Compare May 20, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread docs/nexus-page.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

Comment thread scripts/generate-nexus-page.py Outdated
Comment thread scripts/generate-nexus-page.py
Comment thread docs/nexus-page.md Outdated
@codepuncher
codepuncher force-pushed the feat/nexus-page-sync branch from 468b35d to 5be1558 Compare May 20, 2026 20:06
- README.md: add user-facing Requirements, Installation, Compatibility
  block wrapped in nexus:start/end markers before dev Prerequisites
- docs/nexus-page.md: wrap generated sections in generated:start/end markers
- scripts/generate-nexus-page.py: extract nexus block from README, convert
  Markdown to BBCode, inject into nexus-page.md template, print to stdout
Copilot AI review requested due to automatic review settings May 20, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@codepuncher
codepuncher merged commit 1a8ac2f into main May 20, 2026
10 checks passed
@codepuncher
codepuncher deleted the feat/nexus-page-sync branch May 20, 2026 20:49
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.

2 participants