浏览代码

add doc index

olinox 8 年之前
父节点
当前提交
6c981bca70
共有 3 个文件被更改,包括 74 次插入21 次删除
  1. 1 1
      docs/conf.py
  2. 73 0
      docs/index.md
  3. 0 20
      docs/index.rst

+ 1 - 1
docs/conf.py

@@ -40,7 +40,7 @@ templates_path = ['_templates']
 # You can specify multiple suffix as a list of string:
 #
 # source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
+source_suffix = '.md'
 
 # The master toctree document.
 master_doc = 'index'

+ 73 - 0
docs/index.md

@@ -0,0 +1,73 @@
+**xdice**
+
+*xdice* is a lightweight python library for managing dice, scores, and dice-notation patterns.
+
+It allows to easily interpret literal expressions as rolls of dice ('1d6', '3d4+3', '12d6+1d4'...etc.), then manipulate the results.
+
+#### Python Versions
+
+DiceRollParser has been tested with python 3.3+
+
+#### Examples:  
+
+	import dice
+
+	## Roll simple dices with **rolldice()**
+	
+	score = rolldice(6, amount=2)
+	
+	# manipulates score as an integer
+	
+	print( score, score * 2, score == 11 )
+	>> 11		22		True
+	
+	
+	# Iterates over the results
+	
+	for result in score:
+		print(result)
+	>> 5
+	>> 6
+
+	# Parse patterns with **roll()**
+	
+	ps = roll("2d6+18")
+	
+	print( ps, ps.format() )
+	>> 28		'[5,6]+18'
+
+
+#### CLI
+
+Run `python roll.py [options] <expr>`
+	
+	Usage:
+	    roll [options] <expr>
+	
+	Options:
+	    -s               Numeric score only
+	
+	    -h --help        Displays help message
+	    --version        Displays current xdice version
+
+
+#### CONTRIBUTION
+
+Any opinion / contribution is welcome, please contact us.
+
+#### TO INSTALL
+
+	pip install xdice
+
+#### License
+
+*xdice* is under GNU License
+
+#### Author
+
+Olivier Massot, 2017, with *Cro-ki Lab*
+
+#### Tags
+
+	dice roll d20 game random parser dices role board
+	

+ 0 - 20
docs/index.rst

@@ -1,20 +0,0 @@
-.. xdice documentation master file, created by
-   sphinx-quickstart on Thu Sep 21 21:32:02 2017.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to xdice's documentation!
-=================================
-
-.. toctree::
-   :maxdepth: 2
-   :caption: Contents:
-
-
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`