-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/inbuilt docs: added new flag to show comprehensive docs in local browser #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5dffd0b
feat: added new flag to open up in-built documemtation for the tool
rohansen856 0fa153c
chore: updated package list
rohansen856 e58761b
tests: updated tests to not open docs for test runs
rohansen856 abad42d
chore: updated html template with more detailed documentation
rohansen856 25261b7
chore: workflow updated for releasing docs to github pages
rohansen856 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| name: Deploy Documentation to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build Documentation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🦀 Set up Rust | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev | ||
|
|
||
| - name: Cache Cargo | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry | ||
| ~/.cargo/git | ||
| target | ||
| key: ${{ runner.os }}-cargo-pages-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: 📦 Build project | ||
| run: cargo build --release | ||
|
|
||
| - name: 📚 Generate documentation | ||
| run: | | ||
| # Set environment variables to prevent browser opening | ||
| export GIT_EDITOR_NO_BROWSER=1 | ||
| export NO_BROWSER=1 | ||
|
|
||
| # Create docs directory | ||
| mkdir -p docs-site | ||
|
|
||
| # Generate the documentation HTML | ||
| cargo run --release -- --docs | ||
|
|
||
| # Copy the generated HTML to docs-site directory | ||
| cp /tmp/git-editor-docs.html docs-site/index.html | ||
|
|
||
| # Create a simple robots.txt for better SEO | ||
| echo -e "User-agent: *\nAllow: /" > docs-site/robots.txt | ||
|
|
||
| # Create a .nojekyll file to bypass Jekyll processing | ||
| touch docs-site/.nojekyll | ||
|
|
||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v4 | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: './docs-site' | ||
|
|
||
| deploy: | ||
| name: Deploy to GitHub Pages | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| # Only deploy on pushes to main/master, not on PRs | ||
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded path
/tmp/git-editor-docs.htmlcreates a tight coupling between the documentation generation logic and the GitHub Actions workflow. If the temp file location changes in the future, this workflow will break. Consider making the temp file location configurable or using a more predictable location.