Skip to content

Commit

Permalink
docs: added multiversion_regex_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarcia360 authored and zimnx committed Jan 5, 2021
1 parent ef90418 commit f05d878
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/pages.yaml
@@ -1,13 +1,11 @@
name: Release docs

on:
workflow_dispatch:
push:
branches:
- master
- 'branch-**'
paths:
- 'docs/**'
- master
tags:
- '**'

jobs:
release:
Expand Down
10 changes: 6 additions & 4 deletions docs/Makefile
Expand Up @@ -45,7 +45,7 @@ singlehtml: setup
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

.PHONY: epub
epub: setup
epub: setup
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
Expand All @@ -66,11 +66,13 @@ dummy: setup
linkcheck: setup
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck

GIT_BRANCH = $(shell git branch --show-current)

.PHONY: multiversion
multiversion: setup
@mkdir -p $(HOME)/.cache/pypoetry/virtualenvs
$(POETRY) run sphinx-multiversion -D smv_branch_whitelist=$(GIT_BRANCH) -D smv_outputdir_format=$(GIT_BRANCH:branch-%=%) $(SOURCEDIR) $(BUILDDIR)/dirhtml
$(POETRY) run sphinx-multiversion $(SOURCEDIR) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

.PHONY: multiversionpreview
multiversionpreview: multiversion
$(POETRY) run python3 -m http.server 5500 --directory $(BUILDDIR)/dirhtml
7 changes: 5 additions & 2 deletions docs/source/conf.py
Expand Up @@ -5,6 +5,7 @@
from sphinx.util import logging
import recommonmark
from recommonmark.transform import AutoStructify
from sphinx_scylladb_theme.utils import multiversion_regex_builder

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -151,9 +152,11 @@ def setup(sphinx):

# -- Options for multiversion extension ----------------------------------
# Whitelist pattern for tags (set to None to ignore all tags)
smv_tag_whitelist = r'^.*$'
TAGS = []
smv_tag_whitelist = multiversion_regex_builder(TAGS)
# Whitelist pattern for branches (set to None to ignore all branches)
smv_branch_whitelist = r"^master$"
BRANCHES = ['master']
smv_branch_whitelist = multiversion_regex_builder(BRANCHES)
# Whitelist pattern for remotes (set to None to use local branches only)
smv_remote_whitelist = r"^origin$"
# Pattern for released versions
Expand Down

0 comments on commit f05d878

Please sign in to comment.