Skip to content

Commit dc36e73

Browse files
authored
Merge pull request #134 from dgarcia360/docs-setup-project
docs: add sample site
2 parents 39dd81e + d3b7a1c commit dc36e73

File tree

12 files changed

+1615
-0
lines changed

12 files changed

+1615
-0
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/docs"
5+
schedule:
6+
interval: "daily"
7+
allow:
8+
- dependency-name: "sphinx-scylladb-theme"
9+
- dependency-name: "sphinx-multiversion-scylla"

.github/workflows/docs-pages.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Docs / Publish"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- 'branch-**'
10+
paths:
11+
- "docs/**"
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.event.repository.default_branch }}
22+
persist-credentials: false
23+
fetch-depth: 0
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
29+
- name: Set up env
30+
run: make -C docs setupenv
31+
32+
- name: Build docs
33+
run: make -C docs multiversion
34+
35+
- name: Build redirects
36+
run: make -C docs redirects
37+
38+
- name: Tar folder
39+
run: |
40+
tar \
41+
--dereference --hard-dereference \
42+
--directory docs/_build/dirhtml/ \
43+
-cvf ${{ runner.temp }}/artifact.tar \
44+
.
45+
46+
- name: Upload artifact
47+
uses: actions/[email protected]
48+
with:
49+
name: github-pages
50+
path: ${{ runner.temp }}/artifact.tar
51+
retention-days: "1"
52+
53+
release:
54+
# Add a dependency to the build job
55+
needs: build
56+
57+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
58+
permissions:
59+
pages: write # to deploy to Pages
60+
id-token: write # to verify the deployment originates from an appropriate source
61+
contents: read # to read private repo
62+
63+
# Deploy to the github-pages environment
64+
environment:
65+
name: github-pages
66+
url: ${{ steps.deployment.outputs.page_url }}
67+
68+
# Specify runner + deployment step
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v4

.github/workflows/docs-pr.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Docs / Build PR"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- master
9+
paths:
10+
- "docs/**"
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
persist-credentials: false
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.10'
26+
27+
- name: Set up env
28+
run: make -C docs setupenv
29+
30+
- name: Build docs
31+
run: make -C docs test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ scylla-rust-wrapper/target/
55
cmake-build-debug/
66
.cache/
77
version
8+
docs/_build
89
log/

docs/Makefile

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Global variables
2+
# You can set these variables from the command line.
3+
POETRY = poetry
4+
SPHINXOPTS = -j auto
5+
SPHINXBUILD = $(POETRY) run sphinx-build
6+
PAPER =
7+
BUILDDIR = _build
8+
SOURCEDIR = source
9+
10+
# Internal variables
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
14+
TESTSPHINXOPTS = $(ALLSPHINXOPTS) -W --keep-going
15+
16+
.PHONY: all
17+
all: dirhtml
18+
19+
# Setup commands
20+
.PHONY: setupenv
21+
setupenv:
22+
pip install -q poetry
23+
24+
.PHONY: setup
25+
setup:
26+
$(POETRY) install
27+
28+
.PHONY: update
29+
update:
30+
$(POETRY) update
31+
32+
# Clean commands
33+
.PHONY: pristine
34+
pristine: clean
35+
git clean -dfX
36+
37+
.PHONY: clean
38+
clean:
39+
rm -rf $(BUILDDIR)/*
40+
41+
# Generate output commands
42+
.PHONY: dirhtml
43+
dirhtml: setup
44+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
45+
@echo
46+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
47+
48+
.PHONY: singlehtml
49+
singlehtml: setup
50+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
51+
@echo
52+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
53+
54+
.PHONY: epub
55+
epub: setup
56+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
57+
@echo
58+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
59+
60+
.PHONY: epub3
61+
epub3: setup
62+
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
63+
@echo
64+
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
65+
66+
.PHONY: multiversion
67+
multiversion: setup
68+
$(POETRY) run sphinx-multiversion source $(BUILDDIR)/dirhtml
69+
@echo
70+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
71+
72+
.PHONY: redirects
73+
redirects: setup
74+
$(POETRY) run redirects-cli fromfile --yaml-file _utils/redirects.yaml --output-dir $(BUILDDIR)/dirhtml
75+
@echo
76+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
77+
78+
# Preview commands
79+
.PHONY: preview
80+
preview: setup
81+
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
82+
83+
.PHONY: multiversionpreview
84+
multiversionpreview: multiversion
85+
$(POETRY) run python -m http.server 5500 --directory $(BUILDDIR)/dirhtml
86+
87+
# Test commands
88+
.PHONY: test
89+
test: setup
90+
$(SPHINXBUILD) -b dirhtml $(TESTSPHINXOPTS) $(BUILDDIR)/dirhtml
91+
@echo
92+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
93+
94+
.PHONY: linkcheck
95+
linkcheck: setup
96+
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck

docs/_utils/redirects.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### a dictionary of redirects
2+
#old path: new path
3+
#
4+
5+
# removing redirection html script files
6+
# test: /
7+
8+
/stable/test-redirect.html: /stable/index.html

0 commit comments

Comments
 (0)