Skip to content

Commit a3dab7f

Browse files
committed
Setup a fresh documentation
Set up a fresh sphinx-based documentation stub under docs/ subdir. Re-use some bits like sphinx config from the old docs/ directory.
1 parent c677161 commit a3dab7f

File tree

9 files changed

+32
-37
lines changed

9 files changed

+32
-37
lines changed

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ jobs:
2020
- name: Add latest generated docs to gh-pages
2121
shell: bash
2222
run: |
23-
touch _build/html/.nojekyll
24-
git --work-tree _build/html add --no-all -v .
23+
touch _build/.nojekyll
24+
rm -rf _build/.doctrees _build/_sources
25+
git --work-tree _build add --no-all -v .
2526
author=$(git log --merges --pretty=format:%an -n 1)
2627
email=$(git log --merges --pretty=format:%ae -n 1)
2728
git config --global user.name "$author"

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ BUILD_BUILDID := $(shell scripts/build/get-buildid --buildid --shell=no)
7878
RPM_VERSION := $(shell scripts/build/get-buildid --rpm --shell=no)
7979
DEB_VERSION := $(shell scripts/build/get-buildid --deb --shell=no)
8080
TAR_VERSION := $(shell scripts/build/get-buildid --tar --shell=no)
81+
SITE_VERSION := $(shell scripts/build/get-buildid --site --shell=no)
8182

8283
# Kubernetes version we pull in as modules and our external API versions.
8384
KUBERNETES_VERSION := $(shell grep 'k8s.io/kubernetes ' go.mod | sed 's/^.* //')
@@ -643,24 +644,24 @@ BUILDDIR = _build
643644

644645
vhtml: _work/venv/.stamp
645646
. _work/venv/bin/activate && \
646-
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) && \
647-
cp docs/html/index.html $(BUILDDIR)/html/index.html
647+
make -C docs html && \
648+
cp -r docs/_build .
648649

649650
html:
650-
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) && \
651-
cp docs/html/index.html $(BUILDDIR)/html/index.html
651+
$(SPHINXBUILD) -c docs . "$(BUILDDIR)" $(SPHINXOPTS)
652+
cp docs/index.html "$(BUILDDIR)"
652653

653654
clean-html:
654-
rm -rf $(BUILDDIR)/html
655+
rm -rf $(BUILDDIR)/*
655656

656657
site-build: .$(DOCKER_SITE_BUILDER_IMAGE).image.stamp
657658
$(Q)$(DOCKER_SITE_CMD) make html
658659

659660
site-serve: .$(DOCKER_SITE_BUILDER_IMAGE).image.stamp
660-
$(Q)$(DOCKER_SITE_CMD) bash -c "make html && cd _build/html && python3 -m http.server 8081"
661+
$(Q)$(DOCKER_SITE_CMD) bash -c "make html && cd _build && python3 -m http.server 8081"
661662

662-
.$(DOCKER_SITE_BUILDER_IMAGE).image.stamp: docs/Dockerfile
663-
docker build -t $(DOCKER_SITE_BUILDER_IMAGE) -f docs/Dockerfile .
663+
.$(DOCKER_SITE_BUILDER_IMAGE).image.stamp: docs/Dockerfile docs/requirements.txt
664+
docker build -t $(DOCKER_SITE_BUILDER_IMAGE) docs
664665
touch $@
665666

666667
# Set up a Python3 environment with the necessary tools for document creation.

docs-old/requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM sphinxdoc/sphinx:3.2.1
22

3-
COPY docs/requirements.txt .
3+
COPY requirements.txt .
44

55
RUN pip3 install -r requirements.txt

conf.py renamed to docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
copyright = '2020, various'
2525
author = 'various'
2626

27+
master_doc = 'docs/index'
2728

2829
##############################################################################
2930
#
@@ -47,9 +48,9 @@
4748
##############################################################################
4849

4950
baseBranch = "master"
50-
useGitHubURL = True
51+
useGitHubURL = False
5152
commitSHA = getenv('GITHUB_SHA')
52-
githubBaseURL = "https://github.com/intelkevinputnam/cri-resource-manager/"
53+
githubBaseURL = "https://github.com/intel/cri-resource-manager/"
5354
githubFileURL = githubBaseURL + "blob/"
5455
githubDirURL = githubBaseURL + "tree/"
5556
if commitSHA:
@@ -74,7 +75,7 @@
7475
# List of patterns, relative to source directory, that match files and
7576
# directories to ignore when looking for source files.
7677
# This pattern also affects html_static_path and html_extra_path.
77-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store','_work']
78+
exclude_patterns = ['_build', '_work', 'README.md', 'RELEASE.md']
7879

7980

8081
# -- Options for HTML output -------------------------------------------------

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<meta http-equiv="refresh" content="0; URL='docs/index.html'" />

docs/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. CRI Resource Manager documentation master file
2+
3+
Welcome to CRI Resource Manager's documentation!
4+
================================================
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:caption: Contents:
9+
10+
Project GitHub repository <https://github.com/intel/cri-resource-manager>

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx==3.2.1
2+
sphinx_rtd_theme
3+
recommonmark
4+
sphinx-markdown-tables

index.rst

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)