Skip to content

Conversation

@jordanpadams
Copy link
Member

@jordanpadams jordanpadams commented Oct 11, 2025

🗒️ Summary

Implements MkDocs-based documentation as modern alternative to DocBook/WebHelp.

New Features:

  • WriteMkDocsFiles.java generates Markdown documentation for MkDocs
  • Individual pages for classes, attributes, and datatypes with cross-references
  • Namespace organization by type (Common/Discipline/Mission)
  • Collapsible navigation for 30+ namespaces
  • Full-text search with Material theme
  • Python venv-based workflow documented

Implementation Details:

  • Integrated into ExportModels for both full IM (-pW) and LDD generation
  • Dynamic categorization: pds=Common, isDiscipline=Discipline, else=Mission
  • Generates ~1500+ Markdown files organized by namespace
  • Auto-generated mkdocs.yml with hierarchical navigation

Documentation:

  • Added MKDOCS_DOCUMENTATION.md with complete setup and deployment guide
  • Updated README.md with quick start instructions
  • Updated .gitignore for Python virtual environments

⚙️ Test Data and/or Report

I was able to generate this site in ~30 seconds with 30 LDDs.

To run, see docs/MKDOCS_DOCUMENTATION.md in the branch.

1. Generate Documentation

Run LDDTool with the -W flag to generate both JSON and Markdown documentation:

# Build LDDTool (from repository root)
mvn clean package

# Extract the built lddtool package
tar -xzf model-lddtool/target/lddtool-*-bin.tar.gz

# Generate documentation
./lddtool-*/bin/lddtool -pW

# or 
./lddtool-*/bin/lddtool -lpW PDS4_RINGS_IngestLDD.xml PDS4_GEOM_IngestLDD.xml etc...

This creates:

  • export/docs/ - Markdown files structured for MkDocs

2. Set Up Python Virtual Environment (First Time Only)

It's recommended to use a Python virtual environment to isolate dependencies:

# Create a virtual environment in the export/docs directory
python3 -m venv venv

# Activate the virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate

# Install mkdocs-material
pip install mkdocs-material

# To deactivate the virtual environment when done:
# deactivate

Note: You'll need to activate the virtual environment (step 2) each time you want to build or serve the documentation in a new terminal session.

3. Build and Preview

# Activate virtual environment (if not already activated)
source venv/bin/activate  # macOS/Linux
# venv\Scripts\activate   # Windows

# Navigate to the generated docs
cd export/docs

# Option A: Build static HTML
mkdocs build
# Output will be in export/docs/site/

# Option B: Serve locally with live reload
python3 -m http.server 8000

# Then open http://localhost:8000 in your browser
# Ctrl+C to exit

# When done, deactivate the virtual environment
deactivate
Screenshot 2025-10-11 at 1 08 20 PM

♻️ Related Issues

Resolves #926.

@jordanpadams jordanpadams requested a review from a team as a code owner October 11, 2025 20:08
@jordanpadams jordanpadams requested review from Copilot and jshughes and removed request for a team October 11, 2025 20:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements MkDocs-based documentation generation as a modern alternative to DocBook/WebHelp for the PDS4 Information Model. The implementation generates ~1500+ Markdown files organized by namespace, with features including full-text search, collapsible navigation, and cross-references between classes, attributes, and datatypes.

Key changes:

  • New WriteMkDocsFiles.java class generates Markdown documentation integrated into ExportModels
  • Documentation organized into Common/Discipline/Mission categories based on namespace properties
  • Python virtual environment workflow with mkdocs-material theme

Reviewed Changes

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

File Description
model-dmdocument/src/main/java/gov/nasa/pds/model/plugin/WriteMkDocsFiles.java Core implementation that generates Markdown files, mkdocs.yml config, and organizes content by namespace type
docs/MKDOCS_DOCUMENTATION.md Comprehensive guide covering setup, build process, deployment options, and troubleshooting
README.md Added quick start section for documentation generation with link to detailed guide

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jordanpadams
Copy link
Member Author

@jshughes this is not a final solution, but a start towards a more robust solution. we can talk more about this on Monday, but it is pretty easy to get running locally. see instructions above.

@jordanpadams jordanpadams changed the title Add MkDocs documentation generation for PDS4 Information Model Implements MkDocs-based documentation as modern alternative to DocBook/WebHelp. Oct 13, 2025
  Implements MkDocs-based documentation as modern alternative to DocBook/WebHelp.
  Resolves #926.

  New Features:
  - WriteMkDocsFiles.java generates Markdown documentation for MkDocs
  - Individual pages for classes, attributes, and datatypes with cross-references
  - Namespace organization by type (Common/Discipline/Mission)
  - Collapsible navigation for 30+ namespaces
  - Full-text search with Material theme
  - Python venv-based workflow documented

  Implementation Details:
  - Integrated into ExportModels for both full IM (-pW) and LDD generation
  - Dynamic categorization: pds=Common, isDiscipline=Discipline, else=Mission
  - Generates ~1500+ Markdown files organized by namespace
  - Auto-generated mkdocs.yml with hierarchical navigation
  - Export to export/docs/ directory alongside existing webapp/

  Documentation:
  - Added MKDOCS_DOCUMENTATION.md with complete setup and deployment guide
  - Updated README.md with quick start instructions
  - Archived webapp-src/ JavaScript implementation for future reference
  - Updated .gitignore for Python virtual environments
@jordanpadams jordanpadams marked this pull request as draft October 13, 2025 16:54
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
8.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

Refactor PDS4 Data Dictionary Search to Support Scalability

2 participants