Browse Source

doc: fix pdf export (#12076)

Nathanaël Jourdane 9 months ago
parent
commit
5a8c33f34a

+ 1 - 0
CHANGELOG.txt

@@ -56,6 +56,7 @@ Changelog
  * Docs: Add better docs for generating URLs on creating admin views (Shlomo Markowitz)
  * Docs: Document the `vary_fields` property for custom image filters (Daniel Kirkham)
  * Docs: Fix documentation build errors (Himanshu Garg, Chris Shenton)
+ * Docs: Fix PDF export (Nathanaël)
  * Maintenance: Use `DjangoJSONEncoder` instead of custom `LazyStringEncoder` to serialize Draftail config (Sage Abdullah)
  * Maintenance: Refactor image chooser pagination to check `WAGTAILIMAGES_CHOOSER_PAGE_SIZE` at runtime (Matt Westcott)
  * Maintenance: Exclude the `client/scss` directory in Tailwind content config to speed up CSS compilation (Sage Abdullah)

+ 1 - 0
CONTRIBUTORS.md

@@ -826,6 +826,7 @@
 * Jeroen de Vries
 * Romein van Buren
 * Chris Shenton
+* Nathanaël
 
 ## Translators
 

+ 1 - 1
docs/Makefile

@@ -2,7 +2,7 @@
 #
 
 # You can set these variables from the command line.
-SPHINXOPTS    = -W --keep-going -n -jauto
+SPHINXOPTS    = --fail-on-warning -n -jauto
 SPHINXBUILD   = sphinx-build
 PAPER         =
 BUILDDIR      = _build

BIN
docs/_static/images/draftail_entity_stock_source.png


BIN
docs/_static/images/releasenotes_1_5_unlink.png


+ 7 - 0
docs/conf.py

@@ -17,9 +17,13 @@ from datetime import datetime
 
 import django
 import sphinx_wagtail_theme
+from sphinx.builders.html import StandaloneHTMLBuilder
 
 from wagtail import VERSION, __version__
 
+# use png images as fallback, required to build pdf
+StandaloneHTMLBuilder.supported_image_types = ["image/gif", "image/png"]
+
 # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
 on_rtd = os.environ.get("READTHEDOCS", None) == "True"
 
@@ -246,6 +250,9 @@ htmlhelp_basename = "Wagtaildoc"
 
 # -- Options for LaTeX output ---------------------------------------------
 
+# Xelatex engine is required to include unicode characters in the doc
+latex_engine = "xelatex"
+
 latex_elements = {
     # The paper size ('letterpaper' or 'a4paper').
     # 'papersize': 'letterpaper',

+ 3 - 1
docs/extending/extending_draftail.md

@@ -156,7 +156,9 @@ They want to write articles about the stock market, refer to specific stocks any
 
 The editor toolbar could contain a "stock chooser" that displays a list of available stocks, then inserts the user’s selection as a textual token. For our example, we will just pick a stock at random:
 
-![Draftail entity stock source](../_static/images/draftail_entity_stock_source.gif)
+```{eval-rst}
+.. image:: ../_static/images/draftail_entity_stock_source.*
+```
 
 Those tokens are then saved in the rich text on publish. When the news article is displayed on the site, we then insert live market data coming from an API next to each token:
 

+ 1 - 1
docs/releases/1.5.rst

@@ -43,7 +43,7 @@ See :doc:`/reference/contrib/table_block` for documentation. This feature was de
 Improved link handling in rich text
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. image:: ../_static/images/releasenotes_1_5_unlink.gif
+.. image:: ../_static/images/releasenotes_1_5_unlink.*
 
 The user experience around inserting, editing and removing links inside rich text areas has been greatly improved: link destinations are shown as tooltips, and existing links can be edited as well as unlinked. This feature was developed by Loic Teixeira.
 

+ 1 - 0
docs/releases/6.2.md

@@ -82,6 +82,7 @@ This feature was developed by Albina Starykova and sponsored by The Motley Fool.
  * Add better docs for generating URLs on [creating admin views](../extending/admin_views.md) (Shlomo Markowitz)
  * Document the `vary_fields` property for [custom image filters](custom_image_filters) (Daniel Kirkham)
  * Fix documentation build errors (Himanshu Garg, Chris Shenton)
+ * Fix PDF export (Nathanaël)
 
 ### Maintenance
 

+ 1 - 1
setup.py

@@ -71,7 +71,7 @@ testing_extras = [
 documentation_extras = [
     "pyenchant>=3.1.1,<4",
     "sphinxcontrib-spelling>=7,<8",
-    "Sphinx>=1.5.2",
+    "Sphinx>=7.3",
     "sphinx-autobuild>=0.6.0",
     "sphinx-wagtail-theme==6.3.0",
     "myst_parser==2.0.0",