sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.39k stars 2.09k forks source link

spinx-intl (gettext) skips table #10959

Closed craiq closed 7 months ago

craiq commented 1 year ago

Describe the bug

Hello,

I'm using Sphinx 5.3.0 with myst v0.18.1

Tables that are included like:

```{table} Title
h1 | h2
--- | ---
content | content

are not written in the *.pot file when using `.\make.bat gettext`

### How to Reproduce

Minimal method (you can also paste the contents of ``index.rst`` and
``conf.py`` into this report):

index.md

(homepage)=

Dokumentation


h1 | h2
--- | ---
content 1 | content 2

conf.py

Configuration file for the Sphinx documentation builder.

#

This file only contains a selection of the most common options. For a full

list see the documentation:

https://www.sphinx-doc.org/en/master/usage/configuration.html

-- Path setup --------------------------------------------------------------

If extensions (or modules to document with autodoc) are in another directory,

add these directories to sys.path here. If the directory is relative to the

documentation root, use os.path.abspath to make it absolute, like shown here.

#

import os

import sys

sys.path.insert(0, os.path.abspath('.'))

-- Project information -----------------------------------------------------

project = 'a' copyright = 'b' author = 'c'

The full version, including alpha/beta/rc tags

release = '0.8.21' version = '0.8.21'

-- General configuration ---------------------------------------------------

Add any Sphinx extension module names here, as strings. They can be

extensions coming with Sphinx (named 'sphinx.ext.*') or your custom

ones.

extensions = [ 'myst_parser', # https://myst-parser.readthedocs.io/en/latest/index.html 'sphinx_rtd_theme', # https://sphinx-rtd-theme.readthedocs.io/en/latest/ 'sphinxcontrib.mermaid', # https://github.com/mgaitan/sphinxcontrib-mermaid 'sphinx_last_updated_by_git', # https://github.com/mgeier/sphinx-last-updated-by-git/ 'sphinxcontrib.youtube', # https://github.com/sphinx-contrib/youtube 'sphinx_changelog', # https://sphinx-changelog.readthedocs.io/en/latest/ "sphinxcontrib.jquery", # https://github.com/sphinx-contrib/jquery ]

Add any paths that contain templates here, relative to this directory.

templates_path = ['_templates']

The language for content autogenerated by Sphinx. Refer to documentation

for a list of supported languages.

#

This is also used if you do content translation via gettext catalogs.

Usually you set "language" from the command line for these cases.

language = 'de'

https://www.sphinx-doc.org/en/master/usage/advanced/intl.html

locale_dirs = ['locale/'] # path is example but recommended. gettext_compact = True # optional. gettext_allow_fuzzy_translations = False gettext_additional_targets = ['raw', 'literal-block', 'doctest-block']

List of patterns, relative to source directory, that match files and

directories to ignore when looking for source files.

This pattern also affects html_static_path and html_extra_path.

exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'snippets', 'readme.md', 'changelog.md', 'backlog', 'shared', 'changes', 'changelog.rst', 'node_modules', 'venv', '.git']

-- Options for HTML output -------------------------------------------------

The theme to use for HTML and HTML Help pages. See the documentation for

a list of builtin themes.

# html_theme = 'alabaster' html_theme = 'sphinx_rtd_theme'

Add any paths that contain custom static files (such as style sheets) here,

relative to this directory. They are copied after the builtin static files,

so a file named "default.css" will overwrite the builtin "default.css".

html_static_path = ['_static']

- theming options

html_theme_options = {

Set the name of the project to appear in the navigation.

'nav_title': 'IT-Doku',

https://sphinx-rtd-theme.readthedocs.io/en/stable/configuring.html

'globaltoc_collapse': True,
'collapse_navigation': False,
'prev_next_buttons_location': 'both',
'style_external_links': True,
'style_nav_header_background': '#0062a8'

}

html_show_sourcelink = False

https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars

html_sidebars = { "**": ['globaltoc.html', 'localtoc.html', 'searchbox.html', 'relations.html'] }

html_logo = 'static/logo_w.png' html_favicon = 'static/favicon.ico'

https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-numfig

numfig = True

https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-numfig_secnum_depth

numfig_secnum_depth = 3

If this is not None, a ‘Last updated on:’ timestamp is inserted at every page bottom, using the given strftime() format. The empty string is equivalent to '%b %d, %Y' (or a locale-dependent equivalent).

html_last_updated_fmt = ""

html_css_files = [ 'custom.css' ]

html_js_files = [ 'custom.js', ]

myst_enable_extensions = [ "colon_fence", "deflist", "substitution", "linkify" ]

https://www.sphinx-doc.org/en/master/latex.html

latex_logo = 'static/logo.png'

latex_elements = { 'extraclassoptions': 'openany', 'preamble': r''' \renewcommand\sphinxstyletheadfamily {\bfseries} ''' }

mermaid_cmd = 'C:\Users\d\AppData\Local\Programs\npm_extension\node_modules\.bin\mmdc.cmd'


```bash
$ sphinx-build -M gettext . _build
$ # open _build/gettext/index.pot

Environment Information

text Platform: win32; (Windows-10-10.0.19042-SP0) Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]) Python implementation: CPython Sphinx version: 5.3.0 Docutils version: 0.17.1 Jinja2 version: 3.1.2

Sphinx extensions

['myst_parser', 'sphinx_rtd_theme', 'sphinxcontrib.mermaid', 'sphinx_last_updated_by_git', 'sphinxcontrib.youtube', 'sphinx_changelog', "sphinxcontrib.jquery"]

Additional context

No response

craiq commented 1 year ago

push