useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
32 stars 14 forks source link

Content width too narrow #97

Open ramajoballester opened 7 months ago

ramajoballester commented 7 months ago

I am using numpydoc style for my documentation. Everything seems okay, except for a few warnings when running sphinx-build -M simplepdf docs/source/ docs/build/ -a:

Sphinx output ``` Running Sphinx v7.2.6 making output directory... done Setting theme to simplepdf_theme Generating css files from scss-templates [autosummary] generating autosummary for: api.rst, breakage.rst, countersink.rst, index.rst, manager.rst, readme.md, utils.rst loading intersphinx inventory from https://docs.python.org/3/objects.inv... loading intersphinx inventory from https://www.sphinx-doc.org/en/master/objects.inv... myst v2.0.0: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=set(), disable_syntax=[], all_links_external=False, url_schemes=('http', 'https', 'mailto', 'ftp'), ref_domains=None, fence_as_directive=set(), number_code_blocks=[], title_to_header=False, heading_anchors=0, heading_slug_func=None, html_meta={}, footnote_transition=True, words_per_minute=200, substitutions={}, linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True) building [mo]: all of 0 po files writing output... building [simplepdf]: all source files updating environment: [new config] 7 added, 0 changed, 0 removed reading sources... [100%] utils /home//utils/countersink.py:docstring of datasys_online.utils.countersink.Countersink.calculate_height:15: ERROR: Unexpected indentation. looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done assembling single document... readme api breakage countersink manager utils done writing... done writing additional files... done copying static files... done copying extra files... done dumping object inventory... done WARNING: Ignored `text-shadow: none` at 691:3, unknown property. WARNING: Ignored `flex-basis: unset` at 790:7, invalid value. WARNING: Ignored `min-width: unset` at 828:3, invalid value. WARNING: Ignored `max-width: unset` at 829:3, invalid value. WARNING: Ignored `white-space: -o-pre-wrap` at 852:3, invalid value. WARNING: Ignored `user-select: none` at 11:5, unknown property. WARNING: Ignored `stroke: currentColor` at 28:5, unknown property. WARNING: Ignored `outline-offset: 1px` at 34:3, unknown property. WARNING: Ignored `margin-bottom: 24 px` at 52:2, invalid value. WARNING: Expected a media type, got '(prefers-color-scheme: dark)' WARNING: Invalid media type ' (prefers-color-scheme: dark) ' the whole @media rule was ignored at 57:1. fsSelection bits 7, 8 and 9 are only defined in OS/2 table version 4 and up: version 3 ```

However, my pdf looks like this in some sections. It is also not consistent, as this width varies from one section to another.

Here is my config:

conf.py ``` # Configuration file for the Sphinx documentation builder. import os import sys from importlib.metadata import metadata from datetime import datetime sys.path.insert(0, os.path.abspath('../../')) # -- Project information project = 'datasys-online' project_slug = project.lower() author = metadata(project.lower())['Author-email'].split('<')[0][:-1] version = metadata(project.lower())['Version'] release = version copyright = f'{datetime.now().year}, {author}' # -- General configuration extensions = [ 'sphinx.ext.duration', 'sphinx.ext.doctest', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', 'sphinx_copybutton', 'numpydoc', 'sphinx.ext.autodoc.typehints', 'myst_parser', # For markdown support 'sphinx.ext.autosectionlabel', 'sphinx_tabs.tabs', 'sphinx.ext.viewcode', 'sphinx_markdown_tables', 'sphinx.ext.napoleon', 'sphinx_simplepdf', ] # SimplePDF Settings simplepdf_vars = { 'primary': '#333333', 'links': '#FF3333', } intersphinx_mapping = { 'python': ('https://docs.python.org/3/', None), 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), } intersphinx_disabled_domains = ['std'] templates_path = ['_templates'] # -- Options for HTML output html_theme = 'sphinx_rtd_theme' html_theme_options = { 'prev_next_buttons_location': None, # Add this to show TOC with singlehtml 'collapse_navigation': False, } html_show_sourcelink = False # -- Options for EPUB output epub_show_urls = 'footnote' # Configure autodoc to generate documentation for both class and module docstrings autodoc_default_options = { 'members': True, 'undoc-members': False, # 'no-show-inheritance': True, } # Prevent numpydoc from generating both class and __init__ docstrings numpydoc_show_class_members = False ```
danwos commented 7 months ago

Thanks for the bug report :+1:

From the first look, numpydoc seems to put the content inside a table, which column configuration is not correct. We need to check the built single HTML file, how the HTML-code looks for this part.

Maybe it is a simple CSS fix, by using the right selector.