Skip to content

Commit

Permalink
docs: Symlink (instead of copying) the API reference
Browse files Browse the repository at this point in the history
[ upstream commit 944dddf ]

To generate the gRPC API reference, we copy the "api" repository at the
root of the repository to "Documentation/_api". This step is required
everywhere we need to build the docs:

  - Locally, we run it through the "copy-api" target in
    Documentation/Makefile, before generating the HTML.
  - Same thing for the Netlify preview, where "copy-api" is a dependency
    for the "html-netlify" target.
  - However, on ReadTheDocs, where we generate and host the online
    documentation, we do not perform this step; nor do we use the
    Makefile at all.

As a workaround, let's simplify the way we access the API reference.
Instead of copying the docs, just symlink them from the Documentation
directory.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
  • Loading branch information
qmonnet authored and aanm committed Jul 31, 2023
1 parent 0c14f2c commit 279f550
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
persist-credentials: false
- name: Run pre-requisites for validation
run: |
make -C Documentation copy-api # necessary for check-build.sh
- uses: docker://cilium/docs-builder:2023-03-01@sha256:36b233afd73482c2bc7ed43f7a1537f09962015c34679b86c4ca1fa618d67b95
with:
entrypoint: ./Documentation/check-build.sh
Expand Down
1 change: 0 additions & 1 deletion Documentation/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
_build
_api
_preview
_exts/__pycache__
Pipfile
Expand Down
8 changes: 2 additions & 6 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ ifeq ($(V),0)
SPHINX_OPTS += -q
endif

copy-api:
@$(ECHO_GEN)_api
$(QUIET)cp -r ../api/. _api

update-helm-values: $(HELM_VALUES) ## Update the Helm reference documentation.

HELM_DOCS_ROOT_PATH := $(DOCKER_CTR_ROOT_DIR)
Expand All @@ -101,11 +97,11 @@ $(HELM_VALUES): FORCE
$(QUIET)printf '..\n %s\n\n%s\n' "AUTO-GENERATED. Please DO NOT edit manually." "$$(cat $@)" > $@
$(QUIET)$(RM) -- $(TMP_FILE_1) $(TMP_FILE_2)

epub latex html: builder-image copy-api update-helm-values ## Check documentation and render it under the specified format.
epub latex html: builder-image update-helm-values ## Check documentation and render it under the specified format.
@$(ECHO_GEN)_build/$@
$(QUIET)$(DOCKER_RUN) ./check-build.sh $(@) $(SPHINX_OPTS)

html-netlify: copy-api
html-netlify:
@$(ECHO_GEN)_build/$@
$(QUIET) SKIP_LINT=1 ./check-build.sh html $(SPHINX_OPTS)

Expand Down
1 change: 1 addition & 0 deletions Documentation/_api

0 comments on commit 279f550

Please sign in to comment.