Skip to content

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Oct 6, 2025

Summary

  • Refactored the documentation build script to use docc preview instead of Python HTTP server
  • Integrated preview mode directly into the docc command flow for better user experience
  • Added support for custom docc HTML rendering directory via DOCC_HTML_DIR environment variable

Changes

Use Native DocC Preview

  • Replaced python3 -m http.server with xcrun docc preview command
  • Preview mode now uses DocC's built-in preview server with live reloading and better rendering
  • Port handling moved earlier in the process for both catalog and non-catalog workflows

Script Improvements

  • Consolidated preview logic into main docc command execution (both for .docc catalogs and symbol graphs)
  • Removed redundant post-build preview section
  • Cleaner control flow with preview mode integrated into the convert/preview decision

Environment Variables

  • Added DOCC_HTML_DIR environment variable to specify custom HTML renderer location
  • Allows users to point to custom swift-docc-render builds for development

Testing

Tested with:

  • ./Scripts/build-documentation.sh --preview - works with native docc preview
  • Port conflict handling - correctly detects and handles occupied ports
  • Both catalog and non-catalog documentation builds

- Replace custom Python HTTP server with native 'docc preview' command
- Consolidate preview and build logic to avoid duplication
- Add DOCC_HTML_DIR environment variable support for custom render dist
- Improve port conflict handling with interactive prompt
- Simplify documentation build workflow by using docc's built-in preview
@Kyle-Ye Kyle-Ye merged commit b73162a into main Oct 6, 2025
7 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/docc-preview branch October 6, 2025 13:05
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request P2 Low priority labels Oct 6, 2025
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.42%. Comparing base (54b03b1) to head (e75c0d3).
⚠️ Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (54b03b1) and HEAD (e75c0d3). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (54b03b1) HEAD (e75c0d3)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #554      +/-   ##
==========================================
- Coverage   24.64%   16.42%   -8.23%     
==========================================
  Files         505      481      -24     
  Lines       29204    26838    -2366     
==========================================
- Hits         7198     4408    -2790     
- Misses      22006    22430     +424     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request P2 Low priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants