Improve HTML Download of Documentation (#4146)

This commit is contained in:
Bibo-Joshi 2024-03-05 17:16:14 +01:00 committed by GitHub
parent 1b98e440fa
commit 437261f716
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,46 +7,56 @@ version: 2
# Build documentation in the docs/ directory with Sphinx # Build documentation in the docs/ directory with Sphinx
sphinx: sphinx:
configuration: docs/source/conf.py configuration: docs/source/conf.py
# Optionally build your docs in additional formats such as PDF # Optionally build your docs in additional formats such as PDF
formats: formats:
- pdf - pdf
- htmlzip
# Optionally set the version of Python and requirements required to build your docs # Optionally set the version of Python and requirements required to build your docs
python: python:
install: install:
- method: pip - method: pip
path: . path: .
- requirements: docs/requirements-docs.txt - requirements: docs/requirements-docs.txt
build: build:
os: ubuntu-22.04 os: ubuntu-22.04
tools: tools:
python: "3" # latest stable cpython version python: "3" # latest stable cpython version
jobs:
post_build:
# Based on https://github.com/readthedocs/readthedocs.org/issues/3242#issuecomment-1410321534
# This provides a HTML zip file for download, with the same structure as the hosted website
- mkdir --parents $READTHEDOCS_OUTPUT/htmlzip
- cp --recursive $READTHEDOCS_OUTPUT/html $READTHEDOCS_OUTPUT/$READTHEDOCS_PROJECT
# Hide the "other versions" dropdown. This is a workaround for those versions being shown,
# but not being accessible, as they are not built. Also, they hide the actual sidebar menu
# that is relevant only on ReadTheDocs.
- echo "#furo-readthedocs-versions{display:none}" >> $READTHEDOCS_OUTPUT/$READTHEDOCS_PROJECT/_static/styles/furo-extensions.css
- cd $READTHEDOCS_OUTPUT ; zip --recurse-path --symlinks htmlzip/$READTHEDOCS_PROJECT.zip $READTHEDOCS_PROJECT
search: search:
ranking: # bump up rank of commonly searched pages: (default: 0, values range from -10 to 10) ranking: # bump up rank of commonly searched pages: (default: 0, values range from -10 to 10)
telegram.bot.html: 7 telegram.bot.html: 7
telegram.message.html: 3 telegram.message.html: 3
telegram.update.html: 3 telegram.update.html: 3
telegram.user.html: 2 telegram.user.html: 2
telegram.chat.html: 2 telegram.chat.html: 2
telegram.ext.application.html: 3 telegram.ext.application.html: 3
telegram.ext.filters.html: 3 telegram.ext.filters.html: 3
telegram.ext.callbackcontext.html: 2 telegram.ext.callbackcontext.html: 2
telegram.ext.inlinekeyboardbutton.html: 1 telegram.ext.inlinekeyboardbutton.html: 1
telegram.passport*.html: -7 telegram.passport*.html: -7
ignore: ignore:
- changelog.html - changelog.html
- coc.html - coc.html
- bot_methods.html# - bot_methods.html#
- bot_methods.html - bot_methods.html
# Defaults # Defaults
- search.html - search.html
- search/index.html - search/index.html
- 404.html - 404.html
- 404/index.html' - 404/index.html'