Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sphinx support - pydotorg compat (ref #1385) #1569

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
f4ced1b
Current state
AA-Turner Apr 24, 2020
f83e08f
Fix title generation
AA-Turner Apr 25, 2020
9cd91e4
Fix contents section location
AA-Turner Apr 25, 2020
4a36065
Clarify contents page
AA-Turner Apr 25, 2020
62edb6e
Split pep_parser to files
AA-Turner Apr 25, 2020
eb795e0
Update conf
AA-Turner Apr 25, 2020
a13f959
clean imports
AA-Turner Apr 25, 2020
c7b9cea
get pep 0 generation to work
AA-Turner Apr 26, 2020
9403363
Update build and Makefile
AA-Turner Apr 26, 2020
88e20a2
Misc cleanup
AA-Turner Apr 26, 2020
e6869ca
Add sphinx dependency
AA-Turner Apr 26, 2020
4080e62
update makefile
AA-Turner Apr 26, 2020
af0dfc3
fix for read the docs
AA-Turner Apr 26, 2020
531e860
updates for contents
AA-Turner Apr 26, 2020
c9e1c14
support pythondotorg build process
AA-Turner Apr 26, 2020
3dd68a1
fix urls for read the docs
AA-Turner Apr 27, 2020
ab28391
fix import error
AA-Turner Apr 27, 2020
1d64717
make compatible with read the docs
AA-Turner Apr 27, 2020
9d57d7f
update base url
AA-Turner Apr 27, 2020
e88699f
Fix numerical index (pep list was being overwritten)
AA-Turner Apr 27, 2020
cfafa99
Fix name parsing
AA-Turner Apr 27, 2020
d5fe06f
Update name parsing in PEP 0
AA-Turner Apr 28, 2020
0b2c7a4
Include requirements file
AA-Turner Apr 28, 2020
31fe99c
Update ToC to remove title
AA-Turner Apr 28, 2020
1fb3112
Update Contents class
AA-Turner Apr 28, 2020
cd600b4
Fixes as per Éric Araujo's comments
AA-Turner Apr 28, 2020
6bf48d5
move Travis CI to use requirements.txt
AA-Turner Apr 28, 2020
3c31d04
Update build to include 3.8 and sanity checks
AA-Turner Apr 28, 2020
f779673
Move to author metadata lookup for PEP index
AA-Turner Apr 28, 2020
cc2eb9e
update .travis.yml
AA-Turner Apr 28, 2020
992ec43
Lint travis config with config.travis-ci.com
AA-Turner Apr 28, 2020
12e8a96
oops...
AA-Turner Apr 28, 2020
a92fa4c
Correct command calls
AA-Turner Apr 28, 2020
d72d4f4
Move CSV to comma separated
AA-Turner Apr 29, 2020
0057861
Allow Failures in Travis
AA-Turner Apr 30, 2020
2f3b15e
Update Makefile
AA-Turner May 1, 2020
7351d99
Re-organise extension
AA-Turner May 1, 2020
4f6ea10
Update Makefile
AA-Turner May 1, 2020
f08e9ff
Improve packaging process
AA-Turner May 15, 2020
1e8ea36
Transform <code> to <tt>
AA-Turner May 15, 2020
72064da
Transform literal blocks
AA-Turner May 15, 2020
108615e
Transform blockquotes
AA-Turner May 16, 2020
441b35f
Fix author sort
AA-Turner May 16, 2020
d409205
PEP0 transforms
AA-Turner May 16, 2020
fa77eb0
Fix minor regression in blocktest code
AA-Turner May 16, 2020
761e66f
Fix minor regression in li/p code
AA-Turner May 16, 2020
c42e5f6
Try again on theming - starting over!
AA-Turner Jun 17, 2020
6213270
Type hinting: pep_zero.py
AA-Turner Jun 21, 2020
9aaff1f
clean imports in PEPTargetNotes
AA-Turner Jun 21, 2020
62e2536
Add github source link transform
AA-Turner Jun 21, 2020
15696fb
Rename pep_target_notes.py to better reflect role
AA-Turner Jun 21, 2020
c9da153
Remove header fields as per pydotorg converters
AA-Turner Jun 21, 2020
7a348b3
prevent unneeded source copying
AA-Turner Jun 21, 2020
1e73311
Clean up docutils.conf
AA-Turner Jun 21, 2020
ee3e9a5
Clean contents.rst - emphasise that we only use it for Sphinx
AA-Turner Jun 21, 2020
841fa31
PEP header styling changes
AA-Turner Jun 21, 2020
25b76ff
Add custom paragraph and ordered list visitors (based on html4css1 wr…
AA-Turner Jun 21, 2020
4ced4a0
Add jinja2 filter for PEP Ids
AA-Turner Jun 21, 2020
d5aab3b
Add math2html maths processor
AA-Turner Jun 21, 2020
6fd9795
Reduce page weight - remove jQuery and underscore.js
AA-Turner Jun 21, 2020
3bfadb2
Add pydotorg base styles (and fix fonts)
AA-Turner Jun 21, 2020
022a561
Add favicon
AA-Turner Jun 21, 2020
c5ba162
Clean theme.conf
AA-Turner Jun 21, 2020
68f87c7
Add custom breadcrumbs template to mirror pydotorg
AA-Turner Jun 21, 2020
9d82e6b
Remove jQuery from the search page
AA-Turner Jun 21, 2020
371a61d
Add custom sidebar templates
AA-Turner Jun 21, 2020
da69c1a
subset of doctools.js and searchtools.js in plain ES6
AA-Turner Jun 21, 2020
a4f227a
Core layout template
AA-Turner Jun 21, 2020
494db5c
clear PEP styles
AA-Turner Jun 21, 2020
9b66893
PEP style overrides
AA-Turner Jun 21, 2020
cd22dd7
Misc conf.py changes
AA-Turner Jun 21, 2020
ae8f901
Check translator class used by RTD
AA-Turner Jun 21, 2020
a7f3736
Add make clean option
AA-Turner Jun 22, 2020
47c5a66
Add GH pages
AA-Turner Jun 22, 2020
12a30ad
Add index file
AA-Turner Jun 22, 2020
754b684
Clean up RSS generation
AA-Turner Jun 22, 2020
3ab124a
Remove old pyramid files
AA-Turner Jun 22, 2020
1d1d8db
Re-organise pep_processor
AA-Turner Jun 22, 2020
819b0cb
Rename pep zero generator files for consistency
AA-Turner Jun 22, 2020
54b94fb
Reorganise pep theme
AA-Turner Jun 22, 2020
126195a
Clean conf.py
AA-Turner Jun 22, 2020
2dddd9c
Clean imports
AA-Turner Jun 22, 2020
8216159
Modern class defs
AA-Turner Jun 22, 2020
cf7fae2
Type hints
AA-Turner Jun 22, 2020
2e2cb32
Compile regex
AA-Turner Jun 22, 2020
d30356d
PEPError helper method
AA-Turner Jun 22, 2020
d0e57e0
Functionise
AA-Turner Jun 22, 2020
771d24e
Move constants
AA-Turner Jun 22, 2020
8e82d03
Small changes to pep_zero_generator
AA-Turner Jun 22, 2020
2385ded
Update excludes
AA-Turner Jun 22, 2020
1822c19
Conf updates
AA-Turner Jun 22, 2020
1e30f64
Update sphinx version
AA-Turner Aug 14, 2020
4b79aaf
Remove unneeded files
AA-Turner Aug 14, 2020
40d706a
Fix typos
AA-Turner Aug 14, 2020
6147159
Use pydotorg mathematics rendering
AA-Turner Aug 14, 2020
b661ccc
Edits for style in __init__.py
AA-Turner Aug 14, 2020
270b825
Clarify elements in build flow
AA-Turner Aug 14, 2020
4f15149
Update pep2rss to closer match current output
AA-Turner Aug 15, 2020
e257372
Use absolute path
AA-Turner Aug 15, 2020
c263371
Add venv to gitignore
AA-Turner Aug 15, 2020
116f3a7
Match current state of name parsing branch
AA-Turner Aug 15, 2020
e37b5d2
Makefile should be generating rss!
AA-Turner Aug 15, 2020
c44d852
PEP 249 style is different
AA-Turner Aug 15, 2020
ad4c6a1
Implemented auto-linking with the PEP pattern
AA-Turner Aug 15, 2020
6586784
Definition list styling only applies to headers and footnotes
AA-Turner Aug 15, 2020
ae53f01
Add last-modified date to footer re python/pythondotorg#1564
AA-Turner Aug 15, 2020
8f03eeb
Add sphinx support - pythondotorg compat.
AA-Turner Aug 15, 2020
08f55d7
Change html_title to lowercase (per @pradyunsg)
AA-Turner Aug 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to GitHub Pages
on: [push]
jobs:
deploy-to-pages:
runs-on: ubuntu-latest
steps:
# If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Set up Python (3.7) 🐍
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Cache pip 🧳
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

# Install dependencies and build PEPs using sphinx
- name: Install and Build 🔧
run: |
set -x
python -m pip install --upgrade pip
pip install -r requirements.txt
make pages

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ __pycache__
*env
.vscode
*.swp
/build
build
package
venv
71 changes: 56 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,61 @@
language: python
python:
- 3.7
- 3.7-dev
os: linux
dist: xenial

cache: pip

before_install:
- pip install docutils
script:
- make -j$(nproc)

deploy:
provider: script
script: bash deploy.bash
skip_cleanup: true
on:
branch: master
repo: python/peps
install:
- pip install -r requirements.txt

jobs:
fast_finish: true

include:
# Main run, tests build, RSS, and packaging
- name: "3.7 Makefile Build"
python: 3.7
env: COMMAND="make sphinx -j$(nproc)"
deploy:
provider: script
script: bash deploy.bash
skip_cleanup: true
on:
branch: master
repo: python/peps

# Tests build on 3.7-dev
- name: "3.7-dev Build Test"
python: 3.7-dev
env: COMMAND="make sphinx -j$(nproc)"

# Tests build on 3.8
- name: "3.8 Build Test"
python: 3.8
env: COMMAND="make sphinx -j$(nproc)"

# Tests build on 3.8-dev
- name: "3.8-dev Build Test"
python: 3.8-dev
env: COMMAND="make sphinx -j$(nproc)"

# Tests build with Fail on Warning
- name: "3.8 Fail on Warning"
python: 3.8
env:
- COMMAND="make fail_on_warning -j$(nproc)"

# linkcheck takes far too long (upwards of an hour)
# # Checks link references within PEPs
# - name: "3.8 Check Links"
# python: 3.8
# env:
# - COMMAND="make check_links -j$(nproc)"

allow_failures:
# Note test failure, but pass the build as a whole
- name: "3.8 Fail on Warning"

# # Check links can fail as it is dependent on external pages
# - name: "3.8 Check Links"

script: $COMMAND
12 changes: 12 additions & 0 deletions AUTHORS.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Full Name, Surname First, Name Reference
Ernest W. Durbin III, "Durbin, Ernest W., III", Durbin
Inada Naoki, "Inada, Naoki", Inada
Guido van Rossum, "van Rossum, Guido (GvR)", GvR
Just van Rossum, "van Rossum, Just (JvR)", JvR
The Python core team and community, The Python core team and community, python-dev
P.J. Eby, "Eby, Phillip J.", Eby
Greg Ewing, "Ewing, Gregory", Ewing
Jim Jewett, "Jewett, Jim J.", Jewett
Nathaniel Smith, "Smith, Nathaniel J.", Smith
Martin v. Löwis, "von Löwis, Martin", von Löwis

49 changes: 19 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
# Rules to only make the required HTML versions, not all of them,
# without the user having to keep track of which.
#
# Not really important, but convenient.
# Builds PEP files to HTML using sphinx
# Also contains testing targets

PEP2HTML=pep2html.py
all: sphinx

PYTHON=python3

.SUFFIXES: .txt .html .rst
pages: rss
$(PYTHON) build.py --index-file

.txt.html:
@$(PYTHON) $(PEP2HTML) $<
sphinx:
$(PYTHON) build.py

.rst.html:
@$(PYTHON) $(PEP2HTML) $<
fail_on_warning:
$(PYTHON) build.py -f

TARGETS= $(patsubst %.rst,%.html,$(wildcard pep-????.rst)) $(patsubst %.txt,%.html,$(wildcard pep-????.txt)) pep-0000.html

all: pep-0000.rst $(TARGETS)

$(TARGETS): pep2html.py

pep-0000.rst: $(wildcard pep-????.txt) $(wildcard pep-????.rst) $(wildcard pep0/*.py) genpepindex.py
$(PYTHON) genpepindex.py .
check_links:
$(PYTHON) build.py -c

rss:
$(PYTHON) pep2rss.py .

install:
echo "Installing is not necessary anymore. It will be done in post-commit."

clean:
-rm pep-0000.rst
-rm pep-0000.txt
-rm *.html
-rm -rf build
rm pep-0000.rst
rm *.html
rm -rf build

update:
git pull https://github.com/python/peps.git

venv:
$(PYTHON) -m venv venv
./venv/bin/python -m pip install -U docutils
./venv/bin/python -m pip install -r requirements.txt

package: all rss
mkdir -p build/peps
mkdir -p package/peps
$(PYTHON) package.py
cp pep-*.txt build/peps/
cp pep-*.rst build/peps/
cp *.html build/peps/
cp *.png build/peps/
cp *.rss build/peps/
tar -C build -czf build/peps.tar.gz peps
cp *.rss package/peps
tar -C package -czf package/peps.tar.gz peps
Loading