-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
303 lines (286 loc) · 13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Start a new Python project</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
label {
text-align: right;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<ul class="breadcrumb">
<li><a href="https://diecutter.readthedocs.org">Diecutter</a></li>
<li><a href="https://diecutter.alwaysdata.net">Template index</a></li>
<li class="active">python-startproject</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-7 col-md-7 col-lg-7">
<h1>Start a Python project</h1>
<p class="lead">Configure, generate and download the layout of a new Python project.</p>
<div class="panel panel-default"><div class="panel-body">
<form id="sphinx_form" action="" method="POST" class="form-horizontal" role="form">
<fieldset>
<legend>Project</legend>
<div class="form-group">
<label for="sphinx_project_name" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Project name</label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<input class="form-control" id="sphinx_project_name" name="project_name" type="text" value="" />
</div>
</div>
<div class="form-group">
<label for="sphinx_author" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Author</label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<input id="sphinx_author" name="author" type="text" value="" placeholder="Author" class="form-control" />
<span class="help-block">Copyright holder.</span>
</div>
</div>
<div class="form-group">
<label for="sphinx_copyright_string" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Author's email address</label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<input id="sphinx_copyright" name="author_email" type="text" value="" placeholder="[email protected]" class="form-control" />
</div>
</div>
</fieldset>
<fieldset>
<legend>Python version</legend>
<div class="form-group">
<label for="sphinx_python_versions" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Python version(s)</label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<select id="sphinx_python_versions" name="python_versions" multiple class="form-control">
<option value="2.5">2.5</option>
<option value="2.6">2.6</option>
<option value="2.7" selected>2.7</option>
<option value="3.1">3.0</option>
<option value="3.1">3.1</option>
<option value="3.2">3.2</option>
<option value="3.3" selected>3.3</option>
<option value="3.4" selected>3.4</option>
</select>
<span class="help-block">The Python versions for which you provide support. Typically the ones you want to include in your test suites.</span>
</div>
</div>
</fieldset>
<fieldset>
<legend>Testing</legend>
<div class="form-group">
<label for="sphinx_with_tox" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Use <a href="https://testrun.org/tox/" target="_blank">Tox</a></label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<input type="checkbox" checked="checked" id="sphinx_with_tox" name="with_tox" />
<span class="help-block">Embed a tox.ini file ; make <code>python setup.py test</code> run Tox.</span>
</div>
</div>
<div class="form-group">
<label for="sphinx_with_travis" class="col-xs-4 col-sm-4 col-md-3 col-lg-3">Use <a href="https://travis-ci.org" target="_blank">Travis</a></label>
<div class="col-xs-8 col-sm-8 col-md-9 col-lg-9">
<input type="checkbox" checked="checked" id="sphinx_with_travis" name="with_travis" />
<span class="help-block">Embed a .travis.yml file.</span>
</div>
</div>
</fieldset>
<hr />
<div>
<button type="submit" id="sphinx_submit" class="btn btn-primary btn-lg center-block">
<span class="glyphicon glyphicon-circle-arrow-down"> </span>
Generate Python project
</button>
</div>
</form>
</div></div>
</div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<div class="well">
<h2>About this template</h2>
<p>
As <em>diecutter</em>'s authors, we are glad to share this page
with you.
<p>
<p>
The
<a href="https://github.com/diecutter/python-startproject/tree/master/template/">template</a>
should make it easy to generate the layout of a new Python project,
including nice features borrowed from Python's community best
practices.
</p>
<p>
The
<a href="https://github.com/diecutter/python-startproject/tree/master/index.html">user interface</a>
is just an HTML page.
</p>
<p>
Feel free to give feedback, report issues or request features in the
<a href="https://github.com/diecutter/python-startproject/issues">bugtracker</a>.
</p>
</div>
</div>
<div class="col-xs-12 col-sm-5 col-md-5 col-lg-5">
<div class="well">
<h2>About <em>diecutter</em></h2>
<p>
<em>diecutter</em> is a server that handles templates.
When you post data to a template resource, you retrieve the generated
content.
Templates can be either single files (returns single files) or directories
(returns archive). Learn more in
<a href="https://diecutter.readthedocs.org"><em>diecutter</em>'s documentation</a>.
</p>
<p>
<em>diecutter</em> is open-source template rendering software.
</p>
<p>
<em>diecutter.io</em> is the original online provider for diecutter.
</p>
<h3>Resources</h3>
<ul>
<li><a href="http://diecutter.io">SAAS platform</a></li>
<li><a href="http://diecutter.readthedocs.org">Documentation</a></li>
<li><a href="http://pypi.python.org/pypi/diecutter">PyPI page</a></li>
<li><a href="https://github.com/diecutter/diecutter">Code repository</a></li>
<li><a href="https://github.com/diecutter/diecutter/issues">Bugtracker</a></li>
<li><a href="https://travis-ci.org/diecutter/diecutter">Continuous integration</a></li>
</ul>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<form role="form" class="form-horizontal well">
<h2>How does it work?</h2>
<p>
When you submit the form above, you perform a <code>POST</code>
request to <em>diecutter</em>'s service.
</p>
<div class="form-group has-feedback">
<label for="diecutter_service" class="col-xs-3 col-sm-3 col-md-2 col-lg-2">Service</label>
<div class="col-xs-7 col-sm-7 col-md-8 col-lg-8">
<input class="form-control" id="diecutter_service" name="service" type="text" placeholder="http://" value="https://diecutter.alwaysdata.net/github" class="form-control" />
<span class="glyphicon glyphicon-question-sign form-control-feedback"></span>
<span class="help-block">
<em>diecutter</em>'s API root endpoint.
</span>
</div>
<button id="diecutter_service_test" class="btn col-xs-2 col-sm-2 col-md-2 col-lg-2"><span class="glyphicon glyphicon-refresh"></span> Check</button>
</div>
<div class="form-group">
<label for="diecutter_resource" class="col-xs-3 col-sm-3 col-md-2 col-lg-2">Resource</label>
<div class="col-xs-9 col-sm-9 col-md-10 col-lg-10">
<input id="diecutter_resource" name="resource" type="text" value="/diecutter/python-startproject/master/template/" class="form-control" />
<span class="help-block">
Template's path, relative to diecutter's service URL.
For <em>/github</em> endpoint, it is <code>/<owner>/<project>/<version>/<path></code>
</span>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- Scripts. -->
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
(function ( $ ) {
var diecutter_form = null;
var data_form_prefix = 'sphinx_';
var data_form = null;
/* Return URL for resource.
*
* Path is built with the following values:
*
* - value of the input with id="diecutter_service"
* - value of the input with id="diecutter_resource"
*
*/
function diecutter_url( path ) {
if( path === undefined ) {
path = $('#diecutter_resource').val();
if( path !== '' && path[0] != '/') {
path = '/' + path;
$('#diecutter_resource').val(path);
}
}
var service = $('#diecutter_service').val();
if ( service[service.length - 1] == '/' ) {
service = service.substr(0, service.length - 1);
}
url = service + path;
return url;
}
/* Set client form's "action" attribute to event's subject value. */
function update_form_action( event ) {
url = diecutter_url();
data_form.attr('action', url);
}
/* GET to diecutter service root. */
function get_diecutter_service_status( event ) {
// Disable button.
$( '#diecutter_service_test' ).attr('disabled', 'disabled');
// Show 'in progress' status.
$( '#diecutter_service' ).parent().removeClass('has-success has-error');
$( '#diecutter_service' ).parent().addClass('has-warning');
$( '#diecutter_service ~ span' ).first().removeClass('glyphicon-question-sign');
$( '#diecutter_service ~ span' ).first().addClass('glyphicon-refresh');
// AJAX call.
url = diecutter_url( '/' );
var jqxhr = $.ajax( url, {
type: 'GET',
dataType: 'json',
crossDomain: true,
processData: false
}).fail( function ( jqXHR, textStatus, errorThrown ) {
$( '#diecutter_service' ).parent()
.removeClass( 'has-warning' )
.addClass( 'has-error' );
$( '#diecutter_service ~ span' ).first()
.removeClass( 'glyphicon-refresh' )
.addClass( 'glyphicon-remove' );
}).done( function ( data, textStatus, jqXHR ) {
$( '#diecutter_service' ).parent()
.removeClass( 'has-warning' )
.addClass( 'has-success' );
$( '#diecutter_service ~ span' ).first()
.removeClass( 'glyphicon-refresh' )
.addClass( 'glyphicon-ok' );
}).always( function ( jqXHR, textStatus ) {
$( '#diecutter_service_test' ).removeAttr('disabled');
});
return false;
}
/* POST to diecutter resource. */
function post_diecutter( event ) {
data_form.submit();
}
$(document).ready(function() {
$('.collapse').collapse()
diecutter_form = $('#diecutter_form');
data_form = $('#' + data_form_prefix + 'form');
update_form_action();
get_diecutter_service_status();
// Event listeners.
$( '#diecutter_service' )
.on( 'change', get_diecutter_service_status );
$( '#diecutter_service_test' )
.on( 'click', get_diecutter_service_status );
$( '#diecutter_resource_get' )
.on( 'click', get_diecutter_resource );
$( '#diecutter_service' ).on( 'change', update_form_action );
$( '#diecutter_resource' ).on( 'change', update_form_action );
$( '#sphinx_submit' ).on( 'click', post_diecutter );
});
})( jQuery );
</script>
</body>
</html>