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

Move V2 API docs to Github Pages #3874

Merged
merged 13 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/docs_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- uses: ./.github/workflows/composite/setup
with:
WORKING_DIRECTORY: docs/v3
- name: Render V2 docs
working-directory: docs/v2
run: ./render.sh
- name: Run docs tests
run: |
bundle config set --local without 'development'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test.out
!/.devcontainer/**/*

#DOCS
docs/v2/index.html

docs/v3/*.gem
docs/v3/*.rbc
Expand Down
9 changes: 7 additions & 2 deletions docs/v2/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Cloud Foundry v2 API Docs
=========================

To render these docs locally, run `python3 -m http.server 8000` and view at
`localhost:8000`.
To render these docs locally, run:
```
./render.sh
python3 -m http.server 8000
```

The docs can then be viewed at `localhost:8000`.
14 changes: 14 additions & 0 deletions docs/v2/index.html → docs/v2/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
</head>
<body>
<div class="container">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Version Note:</h3>
</div>
<div class="panel-body">
These docs were last changed with
<a href="https://github.com/cloudfoundry/cloud_controller_ng/commit/<%= ENV['DOC_CHANGE_COMMIT'] %>" class="alert-link"><%= ENV['DOC_CHANGE_COMMIT'] %></a>
, and therefore they are up-to-date for CAPI version <%= ENV['DOC_CHANGE_VERSION'] %>.
The V2 API is considered stable, and further changes are not expected.
For previous versions, see the <code>docs/v2</code> directory at
<a href="https://github.com/cloudfoundry/cloud_controller_ng/commits/main/config/version_v2" class="alert-link">the desired version</a>
</div>
</div>

<h1>Cloud Foundry API</h1>

<div class="article">
Expand Down
13 changes: 13 additions & 0 deletions docs/v2/render.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail

repo_root="$(git rev-parse --show-toplevel)"

pushd "$repo_root"
export DOC_CHANGE_COMMIT="$(git log -1 --format=format:%h -- docs/v2)"
git checkout $DOC_CHANGE_COMMIT -- config/version_v2
export DOC_CHANGE_VERSION="$(cat config/version_v2)"
git checkout -- config/version_v2
popd

erb index.html.erb > index.html