Commits

Sergey Astanin  committed d8367a0

README in rst markup

  • Participants
  • Parent commits 597e189

Comments (0)

Files changed (1)

-python-split -- functions to split and partition sequences
-==========================================================
+============
+python-split
+============
+
+Functions to split and partition sequences.
 
 Installation
 ------------
 
+::
+
     pip install split
 
 Usage
 -----
 
-To partition a sequence into chunks of equal size, use `chop`:
+To partition a sequence into chunks of equal size, use ``chop``::
 
     >>> from split import chop
     >>> list(chop(3, range(10)))
     [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
 
-If `truncate=True` keyword argument is given, sequence length is
+If ``truncate=True`` keyword argument is given, sequence length is
 truncated to a multiple of chunk size, and all chunks have the same
-size.
+size::
 
     >>> list(chop(3, range(10), truncate=True))
     [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
 
-To split a sequence into two by a given predicate, use `partition`:
+To split a sequence into two by a given predicate, use ``partition``::
 
     >>> from split import partition
     >>> def odd(x): return x%2
     >>> map(list, partition(odd, range(5)))
     [[1, 3], [0, 2, 4]]
 
-To break a sequence into chunks on some separator elements, use `split`:
+To break a sequence into chunks on some separator elements, use ``split``::
 
     >>> list(split(0, [1,2,3,0,4,5,0,0,6]))
     [[1, 2, 3], [4, 5], [], [6]]