Skip to content

Commit

Permalink
Merge pull request #808 from samjwu/gsitever
Browse files Browse the repository at this point in the history
Google Site Verification
  • Loading branch information
samjwu authored Jun 6, 2024
2 parents 4cefb5e + 5a86147 commit 0185a42
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Fetch config
shell: sh
run: |
test -f .markdownlint.yaml && echo "Using local config file" || curl --silent --show-error --fail --location https://raw.github.com/RadeonOpenCompute/rocm-docs-core/develop/.markdownlint.yaml -O
test -f .markdownlint.yaml && echo "Using local config file" || curl --silent --show-error --fail --location https://raw.github.com/ROCm/rocm-docs-core/develop/.markdownlint.yaml -O
- name: Use markdownlint-cli2
uses: DavidAnson/markdownlint-cli2-action@v10.0.1
with:
Expand All @@ -37,8 +37,8 @@ jobs:
if: ${{ ! contains( github.repository, 'rocm-docs-core') }}
shell: sh
run: |
curl --silent --show-error --fail --location https://raw.github.com/RadeonOpenCompute/rocm-docs-core/develop/.spellcheck.yaml -O
curl --silent --show-error --fail --location https://raw.github.com/RadeonOpenCompute/rocm-docs-core/develop/.wordlist.txt >> .wordlist.txt
curl --silent --show-error --fail --location https://raw.github.com/ROCm/rocm-docs-core/develop/.spellcheck.yaml -O
curl --silent --show-error --fail --location https://raw.github.com/ROCm/rocm-docs-core/develop/.wordlist.txt >> .wordlist.txt
- name: Run spellcheck
uses: rojopolis/spellcheck-github-actions@0.30.0
- name: On fail
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository is comprised of utilities, styling, scripts, and additional HTML

- Install this repository as a Python package using pip
- From PyPi: `pip install rocm-docs-core`
- From GitHub: `pip install git+https://github.com/RadeonOpenCompute/rocm-docs-core.git`.
- From GitHub: `pip install git+https://github.com/ROCm/rocm-docs-core.git`.

- Set `rocm_docs_theme` as the HTML theme
- Add `rocm_docs` as an extension
Expand Down
4 changes: 2 additions & 2 deletions docs/developer_guide/dependabot.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Dependabot is automated dependency management tool.
It is used to keep ROCm documentation dependencies up to date.

[Here is an example PR that dependabot made on the ROCm repository](https://github.com/RadeonOpenCompute/ROCm/pull/2273)
[Here is an example PR that dependabot made on the ROCm repository](https://github.com/ROCm/ROCm/pull/2273)

[Dependabot Configuration used by this project](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/.github/dependabot.yml)
[Dependabot Configuration used by this project](https://github.com/ROCm/rocm-docs-core/blob/develop/.github/dependabot.yml)

[GitHub Dependabot Configuration Guide](https://docs.github.com/en/code-security/dependabot)
4 changes: 2 additions & 2 deletions docs/developer_guide/just.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ Development container setup and settings are added
for Visual Studio Development containers (and GitHub Codespaces) and Gitpod.

- [VS Code Dev Containers Guide](https://code.visualstudio.com/docs/devcontainers/containers)
- [Dev Container Dockerfile and Configuration](https://github.com/RadeonOpenCompute/rocm-docs-core/tree/develop/.devcontainer)
- [Dev Container Dockerfile and Configuration](https://github.com/ROCm/rocm-docs-core/tree/develop/.devcontainer)
- [Gitpod Guide](https://www.gitpod.io/docs/introduction/getting-started)
- [Gitpod Configuration](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/.gitpod.yml)
- [Gitpod Configuration](https://github.com/ROCm/rocm-docs-core/blob/develop/.gitpod.yml)
2 changes: 1 addition & 1 deletion docs/user_guide/doxygen_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ See the [source code](https://github.com/ROCm/rocm-docs-core) for details.
The `tests` folder in the `rocm-docs-core` project on GitHub
also has example configuration files.

See [this PR for a simple example of adding a Doxygen code snippet](https://github.com/RadeonOpenCompute/rocm-docs-core/pull/222).
See [this PR for a simple example of adding a Doxygen code snippet](https://github.com/ROCm/rocm-docs-core/pull/222).
6 changes: 3 additions & 3 deletions docs/user_guide/linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ format should be used:
{doc}`Text here<project_name:path/to/page_name>`
```

The [`projects.yaml`](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/src/rocm_docs/data/projects.yaml)
The [`projects.yaml`](https://github.com/ROCm/rocm-docs-core/blob/develop/src/rocm_docs/data/projects.yaml)
configuration file contains the names of projects
that should be used when making links that cross-reference documentation sites.

Expand All @@ -36,12 +36,12 @@ For other links, usual Markdown conventions should be used.
The following Markdown:

```Markdown
[Link Text](https://github.com/RadeonOpenCompute/ROCm)
[Link Text](https://github.com/ROCm/ROCm)
```

will be rendered as the following link:

[Link Text](https://github.com/RadeonOpenCompute/ROCm)
[Link Text](https://github.com/ROCm/ROCm)

#### Example: Relative Links to Current Project

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ dependencies = [
requires-python = ">=3.10"

[project.urls]
repository="https://github.com/RadeonOpenCompute/rocm-docs-core"
documentation="https://docs.amd.com"
repository="https://github.com/ROCm/rocm-docs-core"
documentation="https://rocm.docs.amd.com"

[project.optional-dependencies]
api_reference = [
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ click-log==0.4.0
# via doxysphinx
colorama==0.4.6
# via commitizen
commitizen==3.26.0
commitizen==3.27.0
# via rocm-docs-core (pyproject.toml)
cryptography==42.0.8
# via pyjwt
Expand Down Expand Up @@ -118,6 +118,8 @@ myst-parser==3.0.1
# via rocm-docs-core (pyproject.toml)
nodeenv==1.9.1
# via pre-commit
numpy==1.26.4
# via doxysphinx
packaging==24.0
# via
# black
Expand Down Expand Up @@ -239,7 +241,6 @@ tomli==2.0.1
# build
# mypy
# pip-tools
# pyproject-hooks
# pytest
# sphinx
tomlkit==0.12.5
Expand Down
2 changes: 1 addition & 1 deletion src/rocm_docs/data/projects.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/RadeonOpenCompute/rocm-docs-core/develop/src/rocm_docs/data/projects.schema.json",
"$id": "https://raw.githubusercontent.com/ROCm/rocm-docs-core/develop/src/rocm_docs/data/projects.schema.json",
"$defs": {
"doxygen": {
"type": ["object", "string"],
Expand Down
6 changes: 3 additions & 3 deletions src/rocm_docs/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Inventory: TypeAlias = str | None | tuple[str | None, ...]
ProjectMapping: TypeAlias = tuple[str, Inventory]

DEFAULT_INTERSPHINX_REPOSITORY = "RadeonOpenCompute/rocm-docs-core"
DEFAULT_INTERSPHINX_REPOSITORY = "ROCm/rocm-docs-core"
DEFAULT_INTERSPHINX_BRANCH = "develop"

logger = sphinx.util.logging.getLogger(__name__)
Expand Down Expand Up @@ -324,11 +324,11 @@ def _update_theme_configs(
) -> None:
"""Update configurations for use in theme.py"""
latest_version = requests.get(
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/header-versions/latest_version.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/latest_version.txt"
).text.strip("\r\n")
latest_version_string = f"docs-{latest_version}"
release_candidate = requests.get(
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/header-versions/release_candidate.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/release_candidate.txt"
).text.strip("\r\n")
release_candidate_string = f"docs-{release_candidate}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set repo_url = theme_repository_url|replace("-internal", "")
{%
set nav_secondary_items = {
"GitHub": repo_url,
"Community": "https://github.com/RadeonOpenCompute/ROCm/discussions",
"Community": "https://github.com/ROCm/ROCm/discussions",
"Documentation": "https://rocm.docs.amd.com/en/latest/",
"Infinity Hub": "https://www.amd.com/en/developer/resources/infinity-hub.html",
"Support": repo_url + "/issues/new/choose"
Expand Down
2 changes: 1 addition & 1 deletion src/rocm_docs/rocm_docs_theme/flavors/rocm/header.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{%
set nav_secondary_items = {
"GitHub": repo_url,
"Community": "https://github.com/RadeonOpenCompute/ROCm/discussions",
"Community": "https://github.com/ROCm/ROCm/discussions",
"Blogs": "https://rocm.blogs.amd.com/",
"Infinity Hub": "https://www.amd.com/en/developer/resources/infinity-hub.html",
"Support": repo_url + "/issues/new/choose"
Expand Down
3 changes: 3 additions & 0 deletions src/rocm_docs/rocm_docs_theme/flavors/rocm/meta.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% macro google_site_verification(google_site_verification_content) -%}
<meta name="google-site-verification" content="{{ google_site_verification_content }}" />
{%- endmacro -%}
7 changes: 7 additions & 0 deletions src/rocm_docs/rocm_docs_theme/sections/meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{%
from "flavors/" ~ theme_flavor ~ "/meta.jinja" import
google_site_verification
with context
%}

{{ google_site_verification(google_site_verification_content) }}
18 changes: 12 additions & 6 deletions src/rocm_docs/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,24 @@ def _add_custom_context(
doctree: object, # noqa: ARG001
) -> None:
header_latest_version = _get_version_from_url(
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/header-versions/latest_version.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/latest_version.txt"
)
context["header_latest_version"] = header_latest_version

header_release_candidate_version = _get_version_from_url(
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/header-versions/release_candidate.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/release_candidate.txt"
)

context["header_latest_version"] = header_latest_version
context["header_release_candidate_version"] = (
header_release_candidate_version
)

google_site_verification_content = _get_version_from_url(
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/google_site_verification.txt"
)
context["google_site_verification_content"] = (
google_site_verification_content
)


def _update_repo_opts(srcdir: str, theme_opts: dict[str, Any]) -> None:
default_branch_options: dict[str, Any] = {
Expand Down Expand Up @@ -119,11 +125,11 @@ def _update_theme_options(app: Sphinx) -> None:
)

header_latest_version = _get_version_from_url(
"https://raw.githubusercontent.com/RadeonOpenCompute/rocm-docs-core/header-versions/latest_version.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/latest_version.txt"
)

header_release_candidate_version = _get_version_from_url(
"https://raw.githubusercontent.com/RadeonOpenCompute/rocm-docs-core/header-versions/release_candidate.txt"
"https://raw.githubusercontent.com/ROCm/rocm-docs-core/data/release_candidate.txt"
)

default_config_opts = {
Expand Down

0 comments on commit 0185a42

Please sign in to comment.