Skip to content

Commit 4d821bf

Browse files
committed
updated docs
1 parent 227565d commit 4d821bf

File tree

8 files changed

+23
-572
lines changed

8 files changed

+23
-572
lines changed

README.md

Lines changed: 2 additions & 502 deletions
Large diffs are not rendered by default.

docs/source/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
# import sys
1515
# sys.path.insert(0, os.path.abspath('.'))
1616

17+
import datetime
1718

1819
# -- Project information -----------------------------------------------------
1920

2021
project = 'lorem'
21-
copyright = '2020, Jarry Shaw'
22+
copyright = f'2020-{datetime.datetime.today().year}, Jarry Shaw' # pylint: disable=redefined-builtin
2223
author = 'Jarry Shaw'
2324

2425
# The full version, including alpha/beta/rc tags
25-
release = '1.1.1'
26+
release = '1.2.0'
2627

2728

2829
# -- General configuration ---------------------------------------------------
@@ -65,7 +66,7 @@
6566
# List of patterns, relative to source directory, that match files and
6667
# directories to ignore when looking for source files.
6768
# This pattern also affects html_static_path and html_extra_path.
68-
exclude_patterns = []
69+
exclude_patterns = [] # type: list[str]
6970

7071

7172
# -- Options for HTML output -------------------------------------------------

docs/source/index.rst

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Pythonic Lorem Ipsum Generator
77
==============================
88

99
.. toctree::
10-
:maxdepth: 4
10+
:maxdepth: 3
1111

1212
lorem
1313
test_lorem
@@ -40,13 +40,13 @@ The :mod:`lorem` module provides two different ways for getting random words.
4040

4141
.. code-block:: python
4242
43-
word(count=1, func=None, args=(), kwargs={}) -> Iterator[str]
43+
def word(count=1, func=None, args=(), kwargs={}) -> Iterator[str]: ...
4444
4545
2. :func:`~lorem.get_word` -- return random words
4646

4747
.. code-block:: python
4848
49-
get_word(count=1, sep=' ', func=None, args=(), kwargs={}) -> str
49+
def get_word(count=1, sep=' ', func=None, args=(), kwargs={}) -> str: ...
5050
5151
Get Random Sentences
5252
--------------------
@@ -57,13 +57,13 @@ The :mod:`lorem` module provides two different ways for getting random sentences
5757

5858
.. code-block:: python
5959
60-
sentence(count=1, comma=(0, 2), word_range=(4, 8)) -> Iterator[str]
60+
def sentence(count=1, comma=(0, 2), word_range=(4, 8)) -> Iterator[str]: ...
6161
6262
2. :func:`~lorem.get_sentence` -- return random sentences
6363

6464
.. code-block:: python
6565
66-
get_sentence(count=1, sep=' ', comma=(0, 2), word_range=(4, 8)) -> Union[str]
66+
def get_sentence(count=1, sep=' ', comma=(0, 2), word_range=(4, 8)) -> Union[str]: ...
6767
6868
Get Random Paragraphs
6969
---------------------
@@ -74,25 +74,13 @@ The :mod:`lorem` module provides two different ways for getting random paragraph
7474

7575
.. code-block:: python
7676
77-
paragraph(count=1, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10)) -> Iterator[str]
77+
def paragraph(count=1, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10)) -> Iterator[str]: ...
7878
7979
2. :func:`~lorem.get_paragraph` -- return random paragraphs
8080

8181
.. code-block:: python
8282
83-
get_paragraph(count=1, sep=os.linesep, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10)) -> Union[str]
84-
85-
Customise Word Pool
86-
-------------------
87-
88-
If wanted, the :mod:`lorem` module also provides an interface to customise the word
89-
pool as you wish.
90-
91-
1. :func:`~lorem.set_pool` -- customise random word pool
92-
93-
.. code-block:: python
94-
95-
set_pool(pool)
83+
def get_paragraph(count=1, sep=os.linesep, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10)) -> Union[str]: ...
9684
9785
Indices and tables
9886
==================

docs/source/lorem.rst

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
Lorem Ipsum Generator
22
=====================
33

4-
---------------
5-
Module contents
6-
---------------
7-
84
Get Random Words
95
----------------
106

@@ -23,12 +19,6 @@ Get Random Paragraphs
2319
.. autofunction:: lorem.paragraph
2420
.. autofunction:: lorem.get_paragraph
2521

26-
Customise Word Pool
27-
-------------------
28-
29-
.. autofunction:: lorem.set_pool
30-
31-
------------------
3222
Internal utilities
3323
------------------
3424

@@ -44,7 +34,6 @@ Internal utilities
4434
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
4535
est laborum.
4636

47-
.. autofunction:: lorem._gen_pool
48-
.. autofunction:: lorem._gen_word
49-
.. autofunction:: lorem._gen_sentence
50-
.. autofunction:: lorem._gen_paragraph
37+
.. autoclass:: lorem.LoremGenerator
38+
:show-inheritance:
39+
:members:

docs/source/test_lorem.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Module Unittests
33

44
.. automodule:: test_lorem
55
:members:
6-
:undoc-members:
76
:show-inheritance:

lorem.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@
7171
7272
get_paragraph(count=1, sep=os.linesep, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10)) -> Union[str]
7373
74-
Customise Word Pool
75-
-------------------
76-
77-
If wanted, the :mod:`lorem` module also provides an interface to customise the word
78-
pool as you wish.
79-
80-
1. :func:`set_pool` -- customise random word pool
81-
82-
.. code-block:: python
83-
84-
set_pool(pool)
85-
8674
"""
8775
import itertools
8876
import os

setup.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,9 @@
7171
get_paragraph(count=1, comma=(0, 2), word_range=(4, 8), sentence_range=(5, 10), sep=os.linesep) -> Union[str]
7272
```
7373
74-
Customise Word Pool
75-
-------------------
76-
77-
If wanted, the `lorem` module also provides an interface to customise the word
78-
pool as you wish.
79-
80-
1. `set_pool` -- customise random word pool
81-
82-
```python
83-
set_pool(pool)
84-
```
85-
8674
"""
8775
# version string
88-
__version__ = '1.1.2'
76+
__version__ = '1.2.0'
8977

9078
# setup attributes
9179
attrs = dict(

test_lorem.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from typing import Any, Callable, Iterator, Optional, Sequence
1414

15-
#: Type variable.
15+
# Type variable.
1616
_T = TypeVar('_T')
1717

1818

@@ -49,18 +49,16 @@ def pool(self: 'lorem.LoremGenerator', dupe: 'int' = 1) -> 'Iterator[str]':
4949
class TestLorem(unittest.TestCase):
5050
"""Unittest case for :mod:`lorem` module."""
5151

52-
# mock :mod:`random` module functions
53-
#: Mock :func:`random.shuffle`
52+
# Mock :func:`random.shuffle`
5453
mock_shuffle = mock.patch('random.shuffle', shuffle)
55-
#: Mock :func:`random.randint`
54+
# Mock :func:`random.randint`
5655
mock_randint = mock.patch('random.randint', randint)
57-
#: Mock :func:`random.choice` by choosing the first item.
56+
# Mock :func:`random.choice` by choosing the first item.
5857
mock_choice_first = mock.patch('random.choice', choice_first)
59-
#: Mock :func:`random.choice` by choosing the last item.
58+
# Mock :func:`random.choice` by choosing the last item.
6059
mock_choice_last = mock.patch('random.choice', choice_last)
6160

62-
# mock :mod:`lorem` module functions
63-
#: Mock :func:`lorem._gen_pool`.
61+
# Mock :func:`lorem._gen_pool`.
6462
mock_pool = mock.patch('lorem.LoremGenerator._gen_pool', pool)
6563

6664
def test_lorem_init(self) -> 'None':

0 commit comments

Comments
 (0)