sphinx-doc/sphinx

Toctree `numbered` option doesn't create <ol> element

Open

#7,934 建立於 2020年7月10日

在 GitHub 查看
 (15 留言) (1 反應) (0 負責人)Python (1,985 fork)batch import
builder:htmlhelp wantedinternals:toctreetype:proposal

倉庫指標

Star
 (5,625 star)
PR 合併指標
 (平均合併 10天 11小時) (30 天內合併 11 個 PR)

描述

Describe the bug When building HTML, the toctree numbered option doesn't create <ol> element but instead, keeps an <ul> and add a number to the title of the linked pages.

To Reproduce


.. toctree::
   :maxdepth: 1
   :numbered:

   page1.rst
   page2.rst

Gives

<ul>
<li class="toctree-l1"><a href="page1.html">1. My title</a></li>
<li class="toctree-l1"><a href="page2.html">2. My other title</a></li>
</ul>

That also creates styling problems like have a bullet in front of numbers.

Expected behavior

Semantically, wouldn't it be better to get:

<ol>
<li class="toctree-l1"><a href="page1.html">1. My title</a></li>
<li class="toctree-l1"><a href="page2.html">2. My other title</a></li>
</ol>

Environment info

  • OS: macos
  • Python version: 3.7.5
  • Sphinx version: 3.1.1

貢獻者指南