update sphinx extension to automatically pad lists to fill tables and avoid errors processing the documentation
This commit is contained in:
@ -132,10 +132,8 @@ An alphabetic list of all general LAMMPS commands.
|
|||||||
* :doc:`units <units>`
|
* :doc:`units <units>`
|
||||||
* :doc:`variable <variable>`
|
* :doc:`variable <variable>`
|
||||||
* :doc:`velocity <velocity>`
|
* :doc:`velocity <velocity>`
|
||||||
* :doc:`write\_coeff <write_coeff>`
|
* :doc:`write_coeff <write_coeff>`
|
||||||
* :doc:`write\_data <write_data>`
|
* :doc:`write_data <write_data>`
|
||||||
* :doc:`write\_dump <write_dump>`
|
* :doc:`write_dump <write_dump>`
|
||||||
* :doc:`write\_restart <write_restart>`
|
* :doc:`write_restart <write_restart>`
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
|
|||||||
@ -47,7 +47,6 @@ OPT.
|
|||||||
* :doc:`oxrna2/fene <bond_oxdna>`
|
* :doc:`oxrna2/fene <bond_oxdna>`
|
||||||
* :doc:`quartic (o) <bond_quartic>`
|
* :doc:`quartic (o) <bond_quartic>`
|
||||||
* :doc:`table (o) <bond_table>`
|
* :doc:`table (o) <bond_table>`
|
||||||
*
|
|
||||||
|
|
||||||
.. _angle:
|
.. _angle:
|
||||||
|
|
||||||
@ -89,7 +88,6 @@ OPT.
|
|||||||
* :doc:`quartic (o) <angle_quartic>`
|
* :doc:`quartic (o) <angle_quartic>`
|
||||||
* :doc:`sdk (o) <angle_sdk>`
|
* :doc:`sdk (o) <angle_sdk>`
|
||||||
* :doc:`table (o) <angle_table>`
|
* :doc:`table (o) <angle_table>`
|
||||||
*
|
|
||||||
|
|
||||||
.. _dihedral:
|
.. _dihedral:
|
||||||
|
|
||||||
@ -127,8 +125,6 @@ OPT.
|
|||||||
* :doc:`spherical <dihedral_spherical>`
|
* :doc:`spherical <dihedral_spherical>`
|
||||||
* :doc:`table (o) <dihedral_table>`
|
* :doc:`table (o) <dihedral_table>`
|
||||||
* :doc:`table/cut <dihedral_table_cut>`
|
* :doc:`table/cut <dihedral_table_cut>`
|
||||||
*
|
|
||||||
*
|
|
||||||
|
|
||||||
.. _improper:
|
.. _improper:
|
||||||
|
|
||||||
@ -162,4 +158,3 @@ OPT.
|
|||||||
* :doc:`ring (o) <improper_ring>`
|
* :doc:`ring (o) <improper_ring>`
|
||||||
* :doc:`sqdistharm <improper_sqdistharm>`
|
* :doc:`sqdistharm <improper_sqdistharm>`
|
||||||
* :doc:`umbrella (o) <improper_umbrella>`
|
* :doc:`umbrella (o) <improper_umbrella>`
|
||||||
*
|
|
||||||
|
|||||||
@ -163,6 +163,4 @@ KOKKOS, o = USER-OMP, t = OPT.
|
|||||||
* :doc:`vcm/chunk <compute_vcm_chunk>`
|
* :doc:`vcm/chunk <compute_vcm_chunk>`
|
||||||
* :doc:`voronoi/atom <compute_voronoi_atom>`
|
* :doc:`voronoi/atom <compute_voronoi_atom>`
|
||||||
* :doc:`xrd <compute_xrd>`
|
* :doc:`xrd <compute_xrd>`
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
|
|||||||
@ -240,7 +240,3 @@ OPT.
|
|||||||
* :doc:`wall/region <fix_wall_region>`
|
* :doc:`wall/region <fix_wall_region>`
|
||||||
* :doc:`wall/region/ees <fix_wall_ees>`
|
* :doc:`wall/region/ees <fix_wall_ees>`
|
||||||
* :doc:`wall/srd <fix_wall_srd>`
|
* :doc:`wall/srd <fix_wall_srd>`
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
|
|||||||
@ -37,4 +37,3 @@ OPT.
|
|||||||
* :doc:`pppm/stagger <kspace_style>`
|
* :doc:`pppm/stagger <kspace_style>`
|
||||||
* :doc:`pppm/tip4p (o) <kspace_style>`
|
* :doc:`pppm/tip4p (o) <kspace_style>`
|
||||||
* :doc:`scafacos <kspace_style>`
|
* :doc:`scafacos <kspace_style>`
|
||||||
*
|
|
||||||
|
|||||||
@ -257,4 +257,3 @@ OPT.
|
|||||||
* :doc:`yukawa (gko) <pair_yukawa>`
|
* :doc:`yukawa (gko) <pair_yukawa>`
|
||||||
* :doc:`yukawa/colloid (go) <pair_yukawa_colloid>`
|
* :doc:`yukawa/colloid (go) <pair_yukawa_colloid>`
|
||||||
* :doc:`zbl (gko) <pair_zbl>`
|
* :doc:`zbl (gko) <pair_zbl>`
|
||||||
*
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from sphinx.util.docutils import SphinxDirective
|
from sphinx.util.docutils import SphinxDirective
|
||||||
from docutils.nodes import Element, Node
|
from docutils.nodes import Element, Node, list_item
|
||||||
from typing import Any, Dict, List
|
from typing import Any, Dict, List
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx.util import logging
|
from sphinx.util import logging
|
||||||
@ -26,8 +26,12 @@ class TableFromList(SphinxDirective):
|
|||||||
raise SphinxError('table_from_list content is not a list')
|
raise SphinxError('table_from_list content is not a list')
|
||||||
fulllist = node.children[0]
|
fulllist = node.children[0]
|
||||||
|
|
||||||
|
# fill list with empty items to have a number of entries
|
||||||
|
# that is divisible by ncolumns
|
||||||
if (len(fulllist) % ncolumns) != 0:
|
if (len(fulllist) % ncolumns) != 0:
|
||||||
raise SphinxError('number of list elements not a multiple of column number')
|
missing = int(ncolumns - (len(fulllist) % ncolumns))
|
||||||
|
for i in range(0,missing):
|
||||||
|
fulllist += list_item()
|
||||||
|
|
||||||
table = nodes.table()
|
table = nodes.table()
|
||||||
tgroup = nodes.tgroup(cols=ncolumns)
|
tgroup = nodes.tgroup(cols=ncolumns)
|
||||||
|
|||||||
Reference in New Issue
Block a user