Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 2, 2025

This PR adds a GitHub repository link to the generated Dhall documentation by inserting a GitHub icon next to the existing "Switch Light/Dark Mode" button in the navigation.

Changes Made

Added a new workflow step "Add repository reference to docs" that:

  • Runs after the generate-docs step but before uploading to Pages
  • Finds all HTML files in the generated documentation
  • Replaces the target navigation element with the same content plus a GitHub link icon
  • Uses GitHub Actions environment variables to dynamically construct the repository URL pointing to the current commit

Technical Implementation

The step uses find and sed to locate and modify all .html files:

find "${{ steps.generate-docs.outputs.path }}" -name "*.html" -type f -exec sed -i 's|<original-snippet>|<original-snippet> <github-link-with-icon>|g' {} \;

The GitHub link points to ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}, providing a direct link to view the source code at the exact commit that generated the documentation.

Result

Users viewing the generated Dhall documentation will now see a GitHub icon in the navigation bar that opens the source repository in a new tab, making it easy to access the underlying code.

Fixes #7.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nikita-volkov <1560937+nikita-volkov@users.noreply.github.com>
Copilot AI changed the title [WIP] Add a reference to this repository in the generated docs Add repository reference to generated Dhall documentation Sep 2, 2025
Copilot AI requested a review from nikita-volkov September 2, 2025 20:21
Copilot finished work on behalf of nikita-volkov September 2, 2025 20:21
@nikita-volkov nikita-volkov merged commit 2fc366d into master Sep 2, 2025
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.

Add a reference to this repository in the generated docs

2 participants