forked from readthedocs/sphinx_rtd_theme
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from khancyr/update-1.3.0
Update to sphinx theme master 1.3.0
- Loading branch information
Showing
86 changed files
with
2,822 additions
and
1,499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[sphinx-rtd-theme.sphinx-rtd-theme] | ||
file_filter = sphinx_rtd_theme/locale/<lang>/LC_MESSAGES/sphinx.po | ||
minimum_perc = 60 | ||
source_file = sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po | ||
source_lang = en | ||
minimum_perc = 60 | ||
|
||
[main] | ||
host = https://www.transifex.com | ||
type = PO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This implicitely includes Python 3.10 | ||
FROM node:14-alpine | ||
|
||
# Do not use --update since that will also fetch the | ||
# latest node-current package | ||
# 'make' is needed for building documentation | ||
RUN apk add npm make py3-pip py3-wheel | ||
|
||
# Add an extra verification that we have the right node | ||
# because the above caused issues | ||
RUN node -v && node -v | grep -q v14 &&\ | ||
python3 --version && python3 --version | grep -q "3.10" | ||
|
||
RUN pip install pip --upgrade | ||
|
||
RUN mkdir -p /project/src/ &&\ | ||
mkdir -p /project/docs/build/ &&\ | ||
mkdir -p /project-minimal-copy/sphinx_rtd_theme &&\ | ||
touch /project-minimal-copy/sphinx_rtd_theme/__init__.py | ||
|
||
# This is the main working directory where node_modules | ||
# gets built. During runtime, it's mixed with directories | ||
# from an external environment through a bind mount | ||
WORKDIR /project | ||
|
||
# Copy files necessary to run "npm install" and save | ||
# installed packages in the docker image (makes the runtime | ||
# so much faster) | ||
COPY package.json /project/ | ||
COPY bin/preinstall.js /project/bin/preinstall.js | ||
|
||
RUN cd /project | ||
|
||
# It matters that the node environment is installed into the same | ||
# folder, i.e. /project where we will run the environment from | ||
# TODO: We don't want to update package-lock.json here, we | ||
# should use npm ci instead | ||
RUN npm install --package-lock-only &&\ | ||
npm audit fix &&\ | ||
npm install | ||
|
||
# This is strictly speaking not necessary, just makes | ||
# running the container faster... | ||
# Install dependencies, then uninstall project itself | ||
COPY setup.py README.rst /project-minimal-copy/ | ||
RUN cd /project-minimal-copy &&\ | ||
pip install ".[dev]" &&\ | ||
/usr/bin/yes | pip uninstall sphinx_rtd_theme | ||
|
||
|
||
# Copy in files that we need to run the project. These files | ||
# will not be mounted into the runtime from external environment | ||
# so we copy them during build. | ||
COPY webpack.common.js webpack.dev.js webpack.prod.js /project/ | ||
|
||
# Copy in the entrypoint and we're done | ||
COPY docker-entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
SHELL := /bin/bash | ||
CWD := $(shell cd -P -- '$(shell dirname -- "$0")' && pwd -P) | ||
|
||
docker-images: | ||
docker-compose build | ||
|
||
docker-npm-build: | ||
rm -f .container_id | ||
docker-compose run -d sphinx_rtd_theme build > .container_id | ||
sleep 1s | ||
docker container wait "$(shell cat .container_id)" | ||
docker cp "$(shell cat .container_id):/project/sphinx_rtd_theme" . | ||
docker cp "$(shell cat .container_id):/project/package-lock.json" . | ||
@echo "Done building" | ||
|
||
docker-npm-dev: | ||
docker-compose run sphinx_rtd_theme dev | ||
|
||
docker-build-all: docker-images docker-npm-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "3.2" | ||
services: | ||
|
||
sphinx_rtd_theme: | ||
build: . | ||
volumes: | ||
- type: "bind" | ||
source: "./" | ||
target: "/project-readonly" | ||
read_only: true | ||
- type: "volume" | ||
target: "/project-readonly/sphinx_rtd_theme.egg-info" | ||
- type: "bind" | ||
source: "./src" | ||
target: "/project/src" | ||
read_only: true | ||
- type: "bind" | ||
source: "./docs" | ||
target: "/project/docs" | ||
read_only: false #todo: fix this | ||
- type: "volume" | ||
target: "/project/docs/_build" | ||
|
||
network_mode: host | ||
ports: | ||
- "1919:1919" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Update latest Python dependencies in case they have changed | ||
# Notice that we are using the 'eager' strategy | ||
# This should only be relevant to development environments where | ||
# the theme is being used. For purposes of "production" or | ||
# building the sdist/wheel, installing dependencies should not | ||
# affect the outcome. | ||
cd /project-readonly | ||
pip install --upgrade --upgrade-strategy eager -e ".[dev]" | ||
|
||
# This helps a potential permission issue, but might be removed | ||
# pending some more investigation of docker host file system | ||
# permissions in the bind mount | ||
# npm cache clean --force | ||
# npm install | ||
|
||
cd /project | ||
|
||
# TODO: This is a bad approach, it copies from the image which | ||
# may be outdated to the current git tree | ||
cp -r /project-readonly/sphinx_rtd_theme . | ||
|
||
echo "Going to invoke: npm run $@" | ||
npm run $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.