Skip to content

Commit 8191559

Browse files
committed
style README
1 parent 18876f9 commit 8191559

File tree

1 file changed

+32
-12
lines changed

1 file changed

+32
-12
lines changed

README.rst

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ Fonts, colors and charts are not supported.
1818
Installation
1919
============
2020

21-
You can install it via pip::
21+
You can install it via pip:
2222

23-
$ pip install pyexcel-xls
23+
.. code-block:: bash
2424
2525
26-
or clone it and install it::
26+
or clone it and install it:
27+
28+
.. code-block:: bash
2729
2830
$ git clone http://github.com/chfw/pyexcel-xls.git
2931
$ cd pyexcel-xls
@@ -49,7 +51,9 @@ Write to an xls file
4951
>>> from pyexcel_io import OrderedDict
5052

5153

52-
Here's the sample code to write a dictionary to an xls file::
54+
Here's the sample code to write a dictionary to an xls file:
55+
56+
.. code-block:: python
5357
5458
>>> from pyexcel_xls import save_data
5559
>>> data = OrderedDict() # from collections import OrderedDict
@@ -60,7 +64,9 @@ Here's the sample code to write a dictionary to an xls file::
6064
Read from an xls file
6165
**********************
6266

63-
Here's the sample code::
67+
Here's the sample code:
68+
69+
.. code-block:: python
6470
6571
>>> from pyexcel_xls import get_data
6672
>>> data = get_data("your_file.xls")
@@ -71,7 +77,9 @@ Here's the sample code::
7177
Write an xls to memory
7278
**********************
7379

74-
Here's the sample code to write a dictionary to an xls file::
80+
Here's the sample code to write a dictionary to an xls file:
81+
82+
.. code-block:: python
7583
7684
>>> from pyexcel_xls import save_data
7785
>>> data = OrderedDict()
@@ -87,7 +95,9 @@ Here's the sample code to write a dictionary to an xls file::
8795
Read from an xls from memory
8896
*****************************
8997

90-
Continue from previous example::
98+
Continue from previous example:
99+
100+
.. code-block:: python
91101
92102
>>> # This is just an illustration
93103
>>> # In reality, you might deal with xls file upload
@@ -100,7 +110,9 @@ Continue from previous example::
100110
As a pyexcel plugin
101111
--------------------
102112

103-
Import it in your file to enable this plugin::
113+
Import it in your file to enable this plugin:
114+
115+
.. code-block:: python
104116
105117
from pyexcel.ext import xls
106118
@@ -109,7 +121,9 @@ Please note only pyexcel version 0.0.4+ support this.
109121
Reading from an xls file
110122
************************
111123

112-
Here is the sample code::
124+
Here is the sample code:
125+
126+
.. code-block:: python
113127
114128
>>> import pyexcel as pe
115129
>>> from pyexcel.ext import xls
@@ -129,14 +143,18 @@ Here is the sample code::
129143
Writing to an xls file
130144
**********************
131145

132-
Here is the sample code::
146+
Here is the sample code:
147+
148+
.. code-block:: python
133149
134150
>>> sheet.save_as("another_file.xls")
135151
136152
Reading from a IO instance
137153
================================
138154

139-
You got to wrap the binary content with stream to get xls working::
155+
You got to wrap the binary content with stream to get xls working:
156+
157+
.. code-block:: python
140158
141159
>>> # This is just an illustration
142160
>>> # In reality, you might deal with xls file upload
@@ -162,7 +180,9 @@ You got to wrap the binary content with stream to get xls working::
162180
Writing to a StringIO instance
163181
================================
164182

165-
You need to pass a StringIO instance to Writer::
183+
You need to pass a StringIO instance to Writer:
184+
185+
.. code-block:: python
166186
167187
>>> data = [
168188
... [1, 2, 3],

0 commit comments

Comments
 (0)