Skip to content

Commit d758fe8

Browse files
authored
Documentation improvements (#92)
* Fix formatting * Use wider alignment for new rtd layout * Restrict depth * Condense version history links * Fix stray unicode character * Fix code block formatting * Remove travis-ci since we're off it * Fix formatting * Address sphinx warnings
1 parent 62a96ce commit d758fe8

File tree

9 files changed

+21
-9
lines changed

9 files changed

+21
-9
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Versions releases 0.2.x & above
2+
###############################
3+
14
0.3.0 (Unreleased)
25
==================
36

CHANGES_OLD.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Versions releases 0.1.x
2+
#######################
3+
14
0.1.9 (2015-09-24)
25
==================
36

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
htmlhelp_basename = 'sqlalchemy_mpttdoc'
6666

6767
html_theme_options = {
68-
'travis_button': True,
6968
'github_button': True,
7069
'github_user': 'uralbash',
7170
'github_repo': 'sqlalchemy_mptt',

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ sqlalchemy_mptt
77
===============
88

99
.. image:: _static/mptt_insert.jpg
10-
:width: 450px
1110
:alt: MPTT (nested sets) INSERT
12-
:align: right
1311

1412
Library for implementing Modified Preorder Tree Traversal with your
1513
`SQLAlchemy` Models and working with trees of Model instances, like
@@ -36,7 +34,7 @@ API:
3634
----
3735

3836
.. toctree::
39-
:maxdepth: 4
37+
:maxdepth: 2
4038

4139
sqlalchemy_mptt
4240

@@ -60,6 +58,7 @@ We welcome any contribution: suggestions, ideas, commits with new
6058
futures, bug fixes, refactoring, docs, tests, translations, etc...
6159

6260
If you have any questions:
61+
6362
* Use the `Discussion board <https://github.com/uralbash/sqlalchemy_mptt/discussions>`_
6463
* Contact the maintainer via email: fayaz.yusuf.khan@gmail.com
6564
* Contact the author via email: sacrud@uralbash.ru or #sacrud IRC channel |IRC Freenode|
@@ -68,6 +67,7 @@ Changelog
6867
=========
6968

7069
.. toctree::
70+
:maxdepth: 1
7171

7272
CHANGES.rst
7373
CHANGES_OLD.rst

sqlalchemy_mptt/mixins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def drilldown_tree(self, session=None, json=False, json_fields=None):
342342
)
343343

344344
def path_to_root(self, session=None, order=desc):
345-
"""Generate path from a leaf or intermediate node to the root.
345+
r"""Generate path from a leaf or intermediate node to the root.
346346
347347
For example:
348348
@@ -372,7 +372,7 @@ def path_to_root(self, session=None, order=desc):
372372
return self._base_order(query, order=order)
373373

374374
def get_siblings(self, include_self=False, session=None):
375-
"""
375+
r"""
376376
* https://github.com/uralbash/sqlalchemy_mptt/issues/64
377377
* https://django-mptt.readthedocs.io/en/latest/models.html#get-siblings-include-self-false
378378
@@ -414,7 +414,7 @@ def get_siblings(self, include_self=False, session=None):
414414
return query
415415

416416
def get_children(self, session=None):
417-
"""
417+
r"""
418418
* https://github.com/uralbash/sqlalchemy_mptt/issues/64
419419
* https://github.com/django-mptt/django-mptt/blob/fd76a816e05feb5fb0fc23126d33e514460a0ead/mptt/models.py#L563
420420

sqlalchemy_mptt/tests/cases/edit_node.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ def test_update_wo_move(self):
44
""" Update node w/o move
55
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
66
.. code::
7+
78
level Nested sets example
89
1 1(1)22
910
_______________|___________________
@@ -52,6 +53,7 @@ def test_update_wo_move_like_sacrud_save(self):
5253
""" Just change attr from node w/o move
5354
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
5455
.. code::
56+
5557
level Nested sets example
5658
1 1(1)22
5759
_______________|___________________
@@ -97,6 +99,7 @@ def test_insert_node(self):
9799
""" Insert node with parent==6
98100
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
99101
.. code::
102+
100103
level Nested sets example
101104
1 1(1)22
102105
_______________|___________________
@@ -155,6 +158,7 @@ def test_insert_node_near_subtree(self):
155158
""" Insert node with parent==4
156159
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
157160
.. code::
161+
158162
level Nested sets example
159163
1 1(1)22
160164
_______________|___________________
@@ -216,6 +220,7 @@ def test_delete_node(self):
216220
""" Delete node(4)
217221
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
218222
.. code::
223+
219224
level Test delete node
220225
1 1(1)22
221226
_______________|___________________
@@ -269,6 +274,7 @@ def test_update_node(self):
269274
""" Set parent_id==5 for node(8)
270275
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
271276
.. code::
277+
272278
level Test update node
273279
1 1(1)22
274280
_______________|___________________

sqlalchemy_mptt/tests/cases/get_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def go(id):
281281
self.assertEqual(tree, reference_tree)
282282

283283
def test_path_to_root(self):
284-
"""Generate path from a leaf or intermediate node to the root.
284+
r"""Generate path from a leaf or intermediate node to the root.
285285
286286
For example:
287287

sqlalchemy_mptt/tests/cases/integrity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_level_odd_when_left_odd_and_vice_versa(self):
7575
7676
.. code-block:: sql
7777
78-
SELECT id, MOD((left level + 2) / 2) AS modulo FROM tree
78+
SELECT id, MOD((left - level + 2) / 2) AS modulo FROM tree
7979
WHERE modulo = 1
8080
"""
8181
table = self.model

sqlalchemy_mptt/tests/cases/move_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def test_move_one_tree_before_another(self):
7979
initial state of the tree :mod:`sqlalchemy_mptt.tests.add_mptt_tree`
8080
8181
.. code::
82+
8283
<--------------------------------
8384
|
8485
level Nested sets tree1 |

0 commit comments

Comments
 (0)