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

#1932 Publish v13 Docs using mike #1967

Merged
merged 19 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
13 changes: 9 additions & 4 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ jobs:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# We need to additionally fetch the gh-pages branch for mike deploy
with:
python-version: 3.x
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
- run: pip3 install mkdocs-material
run: pip3 install mike
- run: mike deploy --push --update-aliases v13 latest
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,26 @@ npm install
3. Install required mkdocs packages using pip3.
```
pip3 install -r requirements.txt
pip3 install mike
```

4. Run below command to start mkdocs server.
```
mkdocs serve
4. Run below commands to use `mike` to deploy multiple versions of docs.
```sh
# Initially delete everything from gh-pages branch to start creating version folders.
mike delete --all

# If above command throws an error please run below mkdocs command and then run mike deploy
mkdocs gh-deploy --force

# This command will create a folder named as v13 in gh-pages branch.
mike deploy --push --update-aliases v13 latest
mike set-default v13

# This command will create a folder named as v12.x in gh-pages branch.
mike deploy --push --update-aliases v12.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to create initial setup in gh-pages which will create a folder named v12.x and place all the doc changes in it. So when we select on v12.x from dropdown it will fetch docs from this folder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we won't have v12 docs should this be removed?

Copy link
Contributor Author

@srikant-ch5 srikant-ch5 May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this can be removed if there is no v12 docs. Should I remove this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should. @tomlyn do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I have removed that from Readme.


# Test changes in local.
mike serve
```

5. When complete, open the browser: http://127.0.0.1:8000/
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ theme:
- navigation.footer

extra:
version:
provider: mike
social:
- icon: fontawesome/brands/github
link: http://github.com/elyra-ai/canvas
Expand Down
9 changes: 9 additions & 0 deletions docs/pages/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ th {
max-width: 71rem;
}

.md-version__list {
background-color: black;
}

.md-version__link {
background-color: black;
color: white;
transition: color 0.3s ease;
}