Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytest-dev/pytest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: andrewdotn/pytest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: pdf-docs-better-unicode-support
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 27, 2021

  1. Use Ubuntu 20.04, lualatex for readthedocs builds

    Read the Docs recently [added support for Ubuntu 20.04][2004]. This has
    a newer version of TeX Live with better Unicode support. Specifically,
    it is now possible to configure a list of fallback fonts to try for
    characters missing from the current font, instead of displaying question
    marks.
    
    In the existing PDF docs, you can see some missing Unicode characters in
    the descriptions for the pytest-addons-test and pytest-hammertime
    plugins, which contain placeholder question marks.
    
    Sadly, to get colour unicode support in PDFs, we will need to wait for
    even newer software from Read the Docs, e.g., the `LuaHBTeX, Version
    1.12.0 (TeX Live 2020/Debian)` of Ubuntu 20.10, to which one can add
    `"Noto Color Emoji:mode=harf;",` to the fallback list.
    
    [2004]: https://blog.readthedocs.com/new-build-specification/
    andrewdotn committed Oct 27, 2021
    Copy the full SHA
    4649191 View commit details

Commits on Oct 28, 2021

  1. Copy the full SHA
    70e8dfe View commit details
Showing with 21 additions and 4 deletions.
  1. +3 −1 .readthedocs.yml
  2. +1 −0 changelog/9242.doc.rst
  3. +17 −3 doc/en/conf.py
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
version: 2

python:
version: 3.7
install:
- requirements: doc/en/requirements.txt
- method: pip
path: .

build:
os: ubuntu-20.04
tools:
python: "3.9"
apt_packages:
- inkscape

1 change: 1 addition & 0 deletions changelog/9242.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade readthedocs configuration to use a [newer Ubuntu version](https://blog.readthedocs.com/new-build-specification/) with better unicode support for PDF docs.
20 changes: 17 additions & 3 deletions doc/en/conf.py
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import os
import shutil
import sys
from textwrap import dedent
from typing import List
from typing import TYPE_CHECKING

@@ -39,9 +40,22 @@
autodoc_typehints = "description"
todo_include_todos = 1

# Use a different latex engine due to possible Unicode characters in the documentation:
# https://docs.readthedocs.io/en/stable/guides/pdf-non-ascii-languages.html
latex_engine = "xelatex"
latex_engine = "lualatex"

latex_elements = {
"preamble": dedent(
r"""
\directlua{
luaotfload.add_fallback("fallbacks", {
"Noto Serif CJK SC:style=Regular;",
"Symbola:Style=Regular;"
})
}
\setmainfont{FreeSerif}[RawFeature={fallback=fallbacks}]
"""
)
}

# -- General configuration -----------------------------------------------------