Skip to content
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

.github: Add destination depth to doc build #592

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

gastmaier
Copy link
Contributor

This repo stores different versions of the doc into multiple directories of the gh-pages branch.
Due to this, links requiring to reach the website root (not the content root of the doc itself), are broken if the deploy directory is different than ./ (e.g. ./main, ./prs/1234)

To resolve this issue, the ADOC_TARGET_DEPTH env variable was implemented analogdevicesinc/doctools@1da4cf1 to allow tuning the depth before the doc build.

Example of ADOC_TARGET_DEPTH values:

  • ./ : ../ (0 or unset)
  • ./main/ : ../../ (1)
  • ./prs/1234 : ../../../ (2)

On Doctools I also added a snipped to generate a JSON with the tags/branches/prs of the build docs, but since this repo uses peaceiris/actions-gh-pages@v3 action to commit and push to gh-pages, I didn't implement it here.
However, this tags.json file would be nice to create a dropdown to switch between versions on the live doc.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

This feature was tested on the Doctools repo itself, with different builds linking properly:
https://analogdevicesinc.github.io/doctools/
https://analogdevicesinc.github.io/doctools/v0.3.38/

Then I tested different values of ADOC_TARGET_DEPTH while building this repo doc locally.

Documentation

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

ADOC_TARGET_DEPTH sets the relative link to reach the documentation
root, for example:

* ./         : ../       (0)
* ./main/    : ../../    (1)
* ./prs/1234 : ../../../ (2)

This fixes the system level navigation links.

Signed-off-by: Jorge Marques <[email protected]>
Copy link

Generated documentation for this PR is available at Link

Copy link

github-actions bot commented Aug 22, 2024

Test Results

1 600 tests  ±0     357 ✅ ±0   12m 5s ⏱️ +21s
    1 suites ±0   1 243 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 8366cdc. ± Comparison against base commit 764dd5b.

♻️ This comment has been updated with latest results.

@tfcollins tfcollins merged commit 4f17d27 into main Aug 22, 2024
54 checks passed
@tfcollins tfcollins deleted the ci-doc-add-depth branch August 22, 2024 15:20
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