canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
16 stars 42 forks source link

Default PDF build does not support tabbed content #302

Open AnneCYH opened 1 week ago

AnneCYH commented 1 week ago

The default .readthedocs.yaml file includes pdf as one of the output formats (aside from HTML).

The generated PDF does not support tabbed content. The tab title + content is printed properly for the last tab; but only the tab titles are printed for the rest.

Screenshot of PDF output: tabbed-content-pdf

Example PDF with tabbed content: canonical-kernel-docs-readthedocs-hosted-com-en-latest.pdf

Tabbed content source:

`````{tabs}
````{tab} Noble Numbat 24.04 (and newer)

Add "deb-src" to the `Types`: line in the
{file}`/etc/apt/sources.list.d/ubuntu.sources` file.

```{code-block} text
:emphasize-lines: 1

Types: deb deb-src
URIs: http://archive.ubuntu.com/ubuntu
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
```
````

````{tab} Mantic Minotaur 23.10 (and older)

Check that you have the following entries in the {file}`/etc/apt/sources.list`
file. If not, add or uncomment these lines for your Ubuntu release.
```{code-block} text

deb-src http://archive.ubuntu.com/ubuntu jammy main
deb-src http://archive.ubuntu.com/ubuntu jammy-updates main
```
````
`````
SecondSkoll commented 1 week ago

This appears to be an issue with the sphinx-tabs extension. Using the Sphinx Design tabs works for the PDF output.

`````{tab-set}
````{tab-item} Noble Numbat 24.04 (and newer)

Add "deb-src" to the `Types`: line in the
{file}`/etc/apt/sources.list.d/ubuntu.sources` file.

```{code-block} text
:emphasize-lines: 1

Types: deb deb-src
URIs: http://archive.ubuntu.com/ubuntu
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

````{tab-item} Mantic Minotaur 23.10 (and older)

Check that you have the following entries in the {file}`/etc/apt/sources.list`
file. If not, add or uncomment these lines for your Ubuntu release.
```{code-block} text

deb-src http://archive.ubuntu.com/ubuntu jammy main
deb-src http://archive.ubuntu.com/ubuntu jammy-updates main


Outputs to 
![image](https://github.com/user-attachments/assets/591ad706-66a2-4575-8c3a-7e0961794016)

We'll have to move away from the sphinx-tabs extension.