Skip to content

Commit 0462405

Browse files
committed
use sphinxcontrib-excel to present sample.xls
1 parent 5719758 commit 0462405

File tree

8 files changed

+133
-46
lines changed

8 files changed

+133
-46
lines changed

.moban.d/docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{% extends 'docs/source/conf.py.jj2' %}
22

33
{%block SPHINX_EXTENSIONS%}
4-
'sphinxcontrib.spelling'
4+
'sphinxcontrib.spelling',
5+
'sphinxcontrib.excel'
56
{%endblock%}
67

78

.moban.d/docs/source/index.rst.jj2

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,7 @@ This example shows how to import uploaded excel file into django models. We are
9898
going to import
9999
`sample-data.xls <https://github.com/pyexcel/django-excel/blob/master/sample-data.xls>`_
100100

101-
.. table:: Sheet 1 of sample-data.xls
102-
103-
============================================ ============ =================
104-
Question Text Publish Date Unique Identifier
105-
============================================ ============ =================
106-
What is your favourite programming language? 28/01/15 language
107-
What is your favourite IDE? 29/01/15 ide
108-
============================================ ============ =================
109-
110-
.. table:: Sheet 2 of sample-data.xls
111-
112-
========== ============== ======
113-
Question Choice Votes
114-
========== ============== ======
115-
language Java 0
116-
language C++ 0
117-
language C 0
118-
ide Eclipse 0
119-
ide Visual Studio 0
120-
ide PyCharm 0
121-
ide IntelliJ 0
122-
========== ============== ======
101+
.. pyexcel-table:: ../../sample-data.xls
123102

124103
into the following data models:
125104

doc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
sphinxcontrib-spelling
2+
sphinxcontrib-excel
3+
24

doc/source/_static/handsontable.full.min.css

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/source/_static/handsontable.full.min.js

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/source/_themes/djangodocs/layout.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
{% if builder != "htmlhelp" %}
2323
{{ super() }}
2424
<script type="text/javascript" src="{{ pathto('templatebuiltins.js', 1) }}"></script>
25+
<link rel="stylesheet" type="text/css" href="_static/handsontable.full.min.css">
26+
<script src="_static/handsontable.full.min.js"></script>
27+
<style>
28+
body{font-family:Helvetica,sans-serif;margin:2 0 0 0}.tab{margin-bottom:0px !important;text-align:center;list-style:none;padding:0 0 0 10px;line-height:24px;height:26px;overflow:hidden;font-size:12px;font-family:verdana;position:relative;margin:0}.tab li{margin-left:0px !important;margin-top:2px !important;float:left;height:24px;border:1px solid #aaa;background:#d1d1d1;background:linear-gradient(top, #ececec 50%, #d1d1d1);display:inline-block;position:relative;z-index:0;border-top-left-radius:6px;border-top-right-radius:6px;box-shadow:0 3px 3px rgba(0,0,0,0.4),inset 0 1px 0 #fff;text-shadow:0 1px #fff;margin:0 -5px;padding:0 20px}.tab li.active{background:#fff;color:#333;z-index:2}.tab li:before{left:-6px;border-width:0 1px 1px 0;box-shadow:2px 2px 0 #d1d1d1}.tab li:after{right:-6px;border-width:0 0 1px 1px;box-shadow:-2px 2px 0 #d1d1d1}.tab a{color:#555;text-decoration:none !important}.tab:before{position:absolute;content:" ";width:100%;bottom:0;left:0;border-bottom:1px solid #aaa;z-index:1}.tabcontent{margin-top:-1px}
29+
</style>
2530
<script type="text/javascript">
2631
(function($) {
2732
if (!django_template_builtins) {

doc/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
'sphinx.ext.doctest',
1010
'sphinx.ext.intersphinx',
1111
'sphinx.ext.viewcode',
12-
'sphinxcontrib.spelling'
12+
'sphinxcontrib.spelling',
13+
'sphinxcontrib.excel'
1314
]
1415

1516
intersphinx_mapping = {

doc/source/index.rst

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -277,28 +277,7 @@ This example shows how to import uploaded excel file into django models. We are
277277
going to import
278278
`sample-data.xls <https://github.com/pyexcel/django-excel/blob/master/sample-data.xls>`_
279279

280-
.. table:: Sheet 1 of sample-data.xls
281-
282-
============================================ ============ =================
283-
Question Text Publish Date Unique Identifier
284-
============================================ ============ =================
285-
What is your favourite programming language? 28/01/15 language
286-
What is your favourite IDE? 29/01/15 ide
287-
============================================ ============ =================
288-
289-
.. table:: Sheet 2 of sample-data.xls
290-
291-
========== ============== ======
292-
Question Choice Votes
293-
========== ============== ======
294-
language Java 0
295-
language C++ 0
296-
language C 0
297-
ide Eclipse 0
298-
ide Visual Studio 0
299-
ide PyCharm 0
300-
ide IntelliJ 0
301-
========== ============== ======
280+
.. pyexcel-table:: ../../sample-data.xls
302281

303282
into the following data models:
304283

0 commit comments

Comments
 (0)