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 #1385

Closed
wants to merge 110 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
23c6d25
sanitised pep2html.py
AA-Turner Aug 15, 2020
59d9c07
Current state
AA-Turner Apr 24, 2020
27fde33
Fix title generation
AA-Turner Apr 25, 2020
493aa25
Fix contents section location
AA-Turner Apr 25, 2020
7bda45b
Clarify contents page
AA-Turner Apr 25, 2020
157d0fa
Split pep_parser to files
AA-Turner Apr 25, 2020
2aa0582
Update conf
AA-Turner Apr 25, 2020
b4b93f2
clean imports
AA-Turner Apr 25, 2020
332b30b
get pep 0 generation to work
AA-Turner Apr 26, 2020
a8744f2
Update build and Makefile
AA-Turner Apr 26, 2020
4844eb8
Misc cleanup
AA-Turner Apr 26, 2020
bcd297c
Add sphinx dependency
AA-Turner Apr 26, 2020
17ccef3
update makefile
AA-Turner Apr 26, 2020
384262c
fix for read the docs
AA-Turner Apr 26, 2020
d424703
updates for contents
AA-Turner Apr 26, 2020
02618e0
support pythondotorg build process
AA-Turner Apr 26, 2020
cf15583
fix urls for read the docs
AA-Turner Apr 27, 2020
408bec4
fix import error
AA-Turner Apr 27, 2020
54ee81e
make compatible with read the docs
AA-Turner Apr 27, 2020
fc37a1c
update base url
AA-Turner Apr 27, 2020
56115d2
Fix numerical index (pep list was being overwritten)
AA-Turner Apr 27, 2020
9f80ed4
Fix name parsing
AA-Turner Apr 27, 2020
59a4fef
Update name parsing in PEP 0
AA-Turner Apr 28, 2020
78a97b4
Include requirements file
AA-Turner Apr 28, 2020
9a3ca3d
Update ToC to remove title
AA-Turner Apr 28, 2020
e71502a
Update Contents class
AA-Turner Apr 28, 2020
b58a901
Fixes as per Éric Araujo's comments
AA-Turner Apr 28, 2020
ed6701c
move Travis CI to use requirements.txt
AA-Turner Apr 28, 2020
2956767
Update build to include 3.8 and sanity checks
AA-Turner Apr 28, 2020
ac25685
Move to author metadata lookup for PEP index
AA-Turner Apr 28, 2020
190ae92
update .travis.yml
AA-Turner Apr 28, 2020
1df8640
Lint travis config with config.travis-ci.com
AA-Turner Apr 28, 2020
051c008
oops...
AA-Turner Apr 28, 2020
5f32b8f
Correct command calls
AA-Turner Apr 28, 2020
042672c
Move CSV to comma separated
AA-Turner Apr 29, 2020
3668d9f
Allow Failures in Travis
AA-Turner Apr 30, 2020
3d8c632
Update Makefile
AA-Turner May 1, 2020
580ec93
Re-organise extension
AA-Turner May 1, 2020
e0fa783
Update Makefile
AA-Turner May 1, 2020
2ddd470
Improve packaging process
AA-Turner May 15, 2020
7d7dfb2
Transform <code> to <tt>
AA-Turner May 15, 2020
e979d27
Transform literal blocks
AA-Turner May 15, 2020
52fe4e6
Transform blockquotes
AA-Turner May 16, 2020
70ecf71
Fix author sort
AA-Turner May 16, 2020
1e34ed0
PEP0 transforms
AA-Turner May 16, 2020
560e3d4
Fix minor regression in blocktest code
AA-Turner May 16, 2020
0483974
Fix minor regression in li/p code
AA-Turner May 16, 2020
6c55888
Try again on theming - starting over!
AA-Turner Jun 17, 2020
3ffd0d0
Type hinting: pep_zero.py
AA-Turner Jun 21, 2020
9eb858a
clean imports in PEPTargetNotes
AA-Turner Jun 21, 2020
daf9f64
Add github source link transform
AA-Turner Jun 21, 2020
e3b002b
Rename pep_target_notes.py to better reflect role
AA-Turner Jun 21, 2020
ea3a371
Remove header fields as per pydotorg converters
AA-Turner Jun 21, 2020
c199a7e
prevent unneeded source copying
AA-Turner Jun 21, 2020
e2ca10f
Clean up docutils.conf
AA-Turner Jun 21, 2020
b9684d2
Clean contents.rst - emphasise that we only use it for Sphinx
AA-Turner Jun 21, 2020
4fb6c49
PEP header styling changes
AA-Turner Jun 21, 2020
7851bcd
Add custom paragraph and ordered list visitors (based on html4css1 wr…
AA-Turner Jun 21, 2020
92c02ff
Add jinja2 filter for PEP Ids
AA-Turner Jun 21, 2020
eb7fd2b
Add math2html maths processor
AA-Turner Jun 21, 2020
ced40bc
Reduce page weight - remove jQuery and underscore.js
AA-Turner Jun 21, 2020
35d3839
Add pydotorg base styles (and fix fonts)
AA-Turner Jun 21, 2020
aa44a42
Add favicon
AA-Turner Jun 21, 2020
da943b9
Clean theme.conf
AA-Turner Jun 21, 2020
9670871
Add custom breadcrumbs template to mirror pydotorg
AA-Turner Jun 21, 2020
8ca3d31
Remove jQuery from the search page
AA-Turner Jun 21, 2020
a0b8ddf
Add custom sidebar templates
AA-Turner Jun 21, 2020
a333cee
subset of doctools.js and searchtools.js in plain ES6
AA-Turner Jun 21, 2020
e09c79e
Core layout template
AA-Turner Jun 21, 2020
0182cd7
clear PEP styles
AA-Turner Jun 21, 2020
26ed310
PEP style overrides
AA-Turner Jun 21, 2020
97a3875
Misc conf.py changes
AA-Turner Jun 21, 2020
f9e46ff
Check translator class used by RTD
AA-Turner Jun 21, 2020
446bad0
Add make clean option
AA-Turner Jun 22, 2020
d439676
Add GH pages
AA-Turner Jun 22, 2020
59136db
Add index file
AA-Turner Jun 22, 2020
624c919
Only deploy for upstream to prevent forks failing (#1537)
hugovk Jul 24, 2020
3f3ad24
Clean up RSS generation
AA-Turner Jun 22, 2020
eb19cb8
Remove old pyramid files
AA-Turner Jun 22, 2020
137a533
Re-organise pep_processor
AA-Turner Jun 22, 2020
6a722e0
Rename pep zero generator files for consistency
AA-Turner Jun 22, 2020
c9404ca
Reorganise pep theme
AA-Turner Jun 22, 2020
f52b38e
Clean conf.py
AA-Turner Jun 22, 2020
90850b1
Clean imports
AA-Turner Jun 22, 2020
ecd0329
Modern class defs
AA-Turner Jun 22, 2020
ab7802b
Type hints
AA-Turner Jun 22, 2020
c32075d
Compile regex
AA-Turner Jun 22, 2020
52d7479
PEPError helper method
AA-Turner Jun 22, 2020
021a48b
Functionise
AA-Turner Jun 22, 2020
dcc97e6
Move constants
AA-Turner Jun 22, 2020
8abbbd8
Small changes to pep_zero_generator
AA-Turner Jun 22, 2020
1a08b32
Update excludes
AA-Turner Jun 22, 2020
411cb8c
Conf updates
AA-Turner Jun 22, 2020
8ce1fde
Update sphinx version
AA-Turner Aug 14, 2020
b43f509
Remove unneeded files
AA-Turner Aug 14, 2020
e8680e5
Fix typos
AA-Turner Aug 14, 2020
5ccf1a5
Use pydotorg mathematics rendering
AA-Turner Aug 14, 2020
985840d
Edits for style in __init__.py
AA-Turner Aug 14, 2020
cf4eb09
Clarify elements in build flow
AA-Turner Aug 14, 2020
c749e59
Update pep2rss to closer match current output
AA-Turner Aug 15, 2020
078c126
Use absolute path
AA-Turner Aug 15, 2020
a03ab68
Add venv to gitignore
AA-Turner Aug 15, 2020
75345ee
Match current state of name parsing branch
AA-Turner Aug 15, 2020
c4302a2
Makefile should be generating rss!
AA-Turner Aug 15, 2020
8aaf8a6
PEP 249 style is different
AA-Turner Aug 15, 2020
7773a3a
Implemented auto-linking with the PEP pattern
AA-Turner Aug 15, 2020
95f7b27
Definition list styling only applies to headers and footnotes
AA-Turner Aug 15, 2020
5240d4b
Add last-modified date to footer re python/pythondotorg#1564
AA-Turner Aug 15, 2020
a2e1cee
Reflect A-S-S-theming changes
AA-Turner Aug 15, 2020
9acd31e
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