Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for pages without sections (titles) #8356

Open
cglacet opened this issue Nov 1, 2020 · 4 comments
Open

Improve support for pages without sections (titles) #8356

cglacet opened this issue Nov 1, 2020 · 4 comments
Labels

Comments

@cglacet
Copy link

cglacet commented Nov 1, 2020

Is your feature request related to a problem? Please describe.
Pages that don't have any section seems to be hard to work with. Also, their HTML <title> looks odd (in the browser tabs for example). Currently, a page that doesn't have any section (with for example html_title set to 'test') will render <no title> — test.

Also it seems like the document can't be included in any toctree, even explicitly (using Title <test_doc>).

Describe the solution you'd like

  • Ability to remove the <no title> — part so my page title is equal to html_title (for example in conf.py).
  • Allow to explicitly reference documents that have no sections in a toctree.

Describe alternatives you've considered
I've tried patching it manually, without great success.

@cglacet cglacet added the type:enhancement enhance or introduce a new feature label Nov 1, 2020
@cglacet cglacet changed the title Improve support fo pages without sections (titles) Improve support for pages without sections (titles) Nov 1, 2020
@tk0miya
Copy link
Member

tk0miya commented Nov 28, 2020

-1: Sphinx expects all documents have their title. It's very difficult to support it. I can accept if somebody implemented it simply. How about using include directive instead?

@cglacet
Copy link
Author

cglacet commented Dec 2, 2020

I guess that would be ok if there was a way to hide/rename titles. In my case the problem is that I want to have a page that doesn't show any title at all. I can imagine it would be a problem for anyone with a long H1 title (which would look ugly/non-informative in the web browser tabs). In that second case hiding a title or defining a <title> independently of the first reST title (<h1>) would be nice too.

Similarly when you add a link using :doc: having two distinct titles would also make sense.

@tk0miya
Copy link
Member

tk0miya commented Dec 8, 2020

I marked this as "help wanted" to wait for a pull request for this. I'm welcome it :-)

@geographika
Copy link
Contributor

A workaround for HTML pages is to add the title but hide it as follows:

.. raw:: html

   <div style="visibility: hidden;">

My Title
========

.. raw:: html

   </div>

@AA-Turner AA-Turner added this to the some future version milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants