Skip to content
Navigation Menu
{{ message }}
forked from gotgit/gotgithub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathno_underscore_dirs.patch
More file actions
411 lines (391 loc) · 19.1 KB
/
Copy pathno_underscore_dirs.patch
File metadata and controls
411 lines (391 loc) · 19.1 KB
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
commit b0709aba8f3896b9407da5b893b6f624989c2749
Author: Jiang Xin <worldhello.net@gmail.com>
Date: Fri Aug 26 10:39:23 2011 +0800
Hack sphinx: for html output, do not add prefix _ in some dirs.
For sphix html output, some dirs such as _static, _sources, _images
have prefix _ at the begining. But when host these files in github,
dirs begin with a _ prefix will not copy to the web server.
This patch change the hard-coded dirs from _static, _images, _sources
to static, images, and sources.
diff --git a/sphinx/application.py b/sphinx/application.py
index bfb39a7..9d336bf 100755
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -467,7 +467,7 @@ class Sphinx(object):
StandaloneHTMLBuilder.script_files.append(filename)
else:
StandaloneHTMLBuilder.script_files.append(
- posixpath.join('_static', filename))
+ posixpath.join('static', filename))
def add_stylesheet(self, filename):
from sphinx.builders.html import StandaloneHTMLBuilder
@@ -475,7 +475,7 @@ class Sphinx(object):
StandaloneHTMLBuilder.css_files.append(filename)
else:
StandaloneHTMLBuilder.css_files.append(
- posixpath.join('_static', filename))
+ posixpath.join('static', filename))
def add_lexer(self, alias, lexer):
from sphinx.highlighting import lexers
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index e909954..6a929e3 100755
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -71,8 +71,8 @@ class StandaloneHTMLBuilder(Builder):
embedded = False # for things like HTML help or Qt help: suppresses sidebar
# This is a class attribute because it is mutated by Sphinx.add_javascript.
- script_files = ['_static/jquery.js', '_static/underscore.js',
- '_static/doctools.js']
+ script_files = ['static/jquery.js', 'static/underscore.js',
+ 'static/doctools.js']
# Dito for this one.
css_files = []
@@ -104,7 +104,7 @@ class StandaloneHTMLBuilder(Builder):
if self.config.language is not None:
if self._get_translations_js():
- self.script_files.append('_static/translations.js')
+ self.script_files.append('static/translations.js')
def _get_translations_js(self):
candidates = [path.join(package_dir, 'locale', self.config.language,
@@ -412,9 +412,9 @@ class StandaloneHTMLBuilder(Builder):
doctree.settings = self.docsettings
self.secnumbers = self.env.toc_secnumbers.get(docname, {})
- self.imgpath = relative_uri(self.get_target_uri(docname), '_images')
+ self.imgpath = relative_uri(self.get_target_uri(docname), 'images')
self.post_process_images(doctree)
- self.dlpath = relative_uri(self.get_target_uri(docname), '_downloads')
+ self.dlpath = relative_uri(self.get_target_uri(docname), 'downloads')
self.current_docname = docname
self.docwriter.write(doctree, destination)
self.docwriter.assemble_parts()
@@ -452,7 +452,7 @@ class StandaloneHTMLBuilder(Builder):
if self.config.html_use_opensearch and self.name != 'htmlhelp':
self.info(' opensearch', nonl=1)
- fn = path.join(self.outdir, '_static', 'opensearch.xml')
+ fn = path.join(self.outdir, 'static', 'opensearch.xml')
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
self.info()
@@ -507,13 +507,13 @@ class StandaloneHTMLBuilder(Builder):
def copy_image_files(self):
# copy image files
if self.images:
- ensuredir(path.join(self.outdir, '_images'))
+ ensuredir(path.join(self.outdir, 'images'))
for src in self.status_iterator(self.images, 'copying images... ',
brown, len(self.images)):
dest = self.images[src]
try:
copyfile(path.join(self.srcdir, src),
- path.join(self.outdir, '_images', dest))
+ path.join(self.outdir, 'images', dest))
except Exception, err:
self.warn('cannot copy image file %r: %s' %
(path.join(self.srcdir, src), err))
@@ -521,14 +521,14 @@ class StandaloneHTMLBuilder(Builder):
def copy_download_files(self):
# copy downloadable files
if self.env.dlfiles:
- ensuredir(path.join(self.outdir, '_downloads'))
+ ensuredir(path.join(self.outdir, 'downloads'))
for src in self.status_iterator(self.env.dlfiles,
'copying downloadable files... ',
brown, len(self.env.dlfiles)):
dest = self.env.dlfiles[src][1]
try:
copyfile(path.join(self.srcdir, src),
- path.join(self.outdir, '_downloads', dest))
+ path.join(self.outdir, 'downloads', dest))
except Exception, err:
self.warn('cannot copy downloadable file %r: %s' %
(path.join(self.srcdir, src), err))
@@ -536,16 +536,16 @@ class StandaloneHTMLBuilder(Builder):
def copy_static_files(self):
# copy static files
self.info(bold('copying static files... '), nonl=True)
- ensuredir(path.join(self.outdir, '_static'))
+ ensuredir(path.join(self.outdir, 'static'))
# first, create pygments style file
- f = open(path.join(self.outdir, '_static', 'pygments.css'), 'w')
+ f = open(path.join(self.outdir, 'static', 'pygments.css'), 'w')
f.write(self.highlighter.get_stylesheet())
f.close()
# then, copy translations JavaScript file
if self.config.language is not None:
jsfile = self._get_translations_js()
if jsfile:
- copyfile(jsfile, path.join(self.outdir, '_static',
+ copyfile(jsfile, path.join(self.outdir, 'static',
'translations.js'))
# add context items for search function used in searchtools.js_t
@@ -557,7 +557,7 @@ class StandaloneHTMLBuilder(Builder):
themeentries = [path.join(themepath, 'static')
for themepath in self.theme.get_dirchain()[::-1]]
for entry in themeentries:
- copy_static_entry(entry, path.join(self.outdir, '_static'),
+ copy_static_entry(entry, path.join(self.outdir, 'static'),
self, ctx)
# then, copy over all user-supplied static files
staticentries = [path.join(self.confdir, spath)
@@ -570,18 +570,18 @@ class StandaloneHTMLBuilder(Builder):
if not path.exists(entry):
self.warn('html_static_path entry %r does not exist' % entry)
continue
- copy_static_entry(entry, path.join(self.outdir, '_static'), self,
+ copy_static_entry(entry, path.join(self.outdir, 'static'), self,
ctx, exclude_matchers=matchers)
# copy logo and favicon files if not already in static path
if self.config.html_logo:
logobase = path.basename(self.config.html_logo)
- logotarget = path.join(self.outdir, '_static', logobase)
+ logotarget = path.join(self.outdir, 'static', logobase)
if not path.isfile(logotarget):
copyfile(path.join(self.confdir, self.config.html_logo),
logotarget)
if self.config.html_favicon:
iconbase = path.basename(self.config.html_favicon)
- icontarget = path.join(self.outdir, '_static', iconbase)
+ icontarget = path.join(self.outdir, 'static', iconbase)
if not path.isfile(icontarget):
copyfile(path.join(self.confdir, self.config.html_favicon),
icontarget)
@@ -743,7 +743,7 @@ class StandaloneHTMLBuilder(Builder):
self.warn("error writing file %s: %s" % (outfilename, err))
if self.copysource and ctx.get('sourcename'):
# copy the source file for the "show source" link
- source_name = path.join(self.outdir, '_sources',
+ source_name = path.join(self.outdir, 'sources',
os_path(ctx['sourcename']))
ensuredir(path.dirname(source_name))
copyfile(self.env.doc2path(pagename), source_name)
@@ -927,7 +927,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
if self.config.html_use_opensearch:
self.info(' opensearch', nonl=1)
- fn = path.join(self.outdir, '_static', 'opensearch.xml')
+ fn = path.join(self.outdir, 'static', 'opensearch.xml')
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
self.info()
@@ -1000,7 +1000,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
# if there is a source file, copy the source file for the
# "show source" link
if ctx.get('sourcename'):
- source_name = path.join(self.outdir, '_sources',
+ source_name = path.join(self.outdir, 'sources',
os_path(ctx['sourcename']))
ensuredir(path.dirname(source_name))
copyfile(self.env.doc2path(pagename), source_name)
diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py
index f09f42e..1271c5a 100755
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -201,7 +201,7 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
outdir += os.sep
olen = len(outdir)
for root, dirs, files in os.walk(outdir):
- staticdir = root.startswith(path.join(outdir, '_static'))
+ staticdir = root.startswith(path.join(outdir, 'static'))
for fn in files:
if (staticdir and not fn.endswith('.js')) or \
fn.endswith('.html'):
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index b2ff26f..c653df5 100755
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -154,8 +154,8 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
outdir += os.sep
olen = len(outdir)
projectfiles = []
- staticdir = path.join(outdir, '_static')
- imagesdir = path.join(outdir, '_images')
+ staticdir = path.join(outdir, 'static')
+ imagesdir = path.join(outdir, 'images')
for root, dirs, files in os.walk(outdir):
resourcedir = root.startswith(staticdir) or \
root.startswith(imagesdir)
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index ee93594..296cf0e 100755
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -128,7 +128,7 @@ def render_dot(self, code, options, format, prefix='graphviz'):
if hasattr(self.builder, 'imgpath'):
# HTML
relfn = posixpath.join(self.builder.imgpath, fname)
- outfn = path.join(self.builder.outdir, '_images', fname)
+ outfn = path.join(self.builder.outdir, 'images', fname)
else:
# LaTeX
relfn = fname
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py
index 78c331a..e391e4c 100755
--- a/sphinx/ext/pngmath.py
+++ b/sphinx/ext/pngmath.py
@@ -78,7 +78,7 @@ def render_math(self, math):
shasum = "%s.png" % sha(math.encode('utf-8')).hexdigest()
relfn = posixpath.join(self.builder.imgpath, 'math', shasum)
- outfn = path.join(self.builder.outdir, '_images', 'math', shasum)
+ outfn = path.join(self.builder.outdir, 'images', 'math', shasum)
if path.isfile(outfn):
depth = read_png_depth(outfn)
return relfn, depth
diff --git a/sphinx/themes/agogo/layout.html b/sphinx/themes/agogo/layout.html
index d063194..fd6d4a2 100644
--- a/sphinx/themes/agogo/layout.html
+++ b/sphinx/themes/agogo/layout.html
@@ -15,7 +15,7 @@
<div class="header">
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ <img class="logo" src="{{ pathto('static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- block headertitle %}
@@ -75,7 +75,7 @@
{%- endfor %}
{%- if show_source and has_source and sourcename %}
<br/>
- <a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ <a href="{{ pathto('sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a>
{%- endif %}
</div>
diff --git a/sphinx/themes/basic/domainindex.html b/sphinx/themes/basic/domainindex.html
index 947a01e..776c034 100644
--- a/sphinx/themes/basic/domainindex.html
+++ b/sphinx/themes/basic/domainindex.html
@@ -39,7 +39,7 @@
in entries %}
<tr{% if grouptype == 2 %} class="cg-{{ groupid.current() }}"{% endif %}>
<td>{% if grouptype == 1 -%}
- <img src="{{ pathto('_static/minus.png', 1) }}" class="toggler"
+ <img src="{{ pathto('static/minus.png', 1) }}" class="toggler"
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
{%- endif %}</td>
<td>{% if grouptype == 2 %} {% endif %}
diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html
index 9fb989c..a00570e 100644
--- a/sphinx/themes/basic/layout.html
+++ b/sphinx/themes/basic/layout.html
@@ -52,7 +52,7 @@
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
- <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ <img class="logo" src="{{ pathto('static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- endblock %}
@@ -100,8 +100,8 @@
{%- endmacro %}
{%- macro css() %}
- <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
- <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
+ <link rel="stylesheet" href="{{ pathto('static/' + style, 1) }}" type="text/css" />
+ <link rel="stylesheet" href="{{ pathto('static/pygments.css', 1) }}" type="text/css" />
{%- for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{%- endfor %}
@@ -120,10 +120,10 @@
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
- href="{{ pathto('_static/opensearch.xml', 1) }}"/>
+ href="{{ pathto('static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- if favicon %}
- <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
+ <link rel="shortcut icon" href="{{ pathto('static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html
index 4cdc693..69a5b6e 100644
--- a/sphinx/themes/basic/search.html
+++ b/sphinx/themes/basic/search.html
@@ -9,7 +9,7 @@
#}
{% extends "layout.html" %}
{% set title = _('Search') %}
-{% set script_files = script_files + ['_static/searchtools.js'] %}
+{% set script_files = script_files + ['static/searchtools.js'] %}
{% block extrahead %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
diff --git a/sphinx/themes/basic/sourcelink.html b/sphinx/themes/basic/sourcelink.html
index 53f2f6b..7d2596b 100644
--- a/sphinx/themes/basic/sourcelink.html
+++ b/sphinx/themes/basic/sourcelink.html
@@ -10,7 +10,7 @@
{%- if show_source and has_source and sourcename %}
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
- <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ <li><a href="{{ pathto('sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a></li>
</ul>
{%- endif %}
diff --git a/sphinx/themes/basic/static/searchtools.js_t b/sphinx/themes/basic/static/searchtools.js_t
index 45989c6..3553113 100644
--- a/sphinx/themes/basic/static/searchtools.js_t
+++ b/sphinx/themes/basic/static/searchtools.js_t
@@ -275,7 +275,7 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
- $.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
+ $.get(DOCUMENTATION_OPTIONS.URL_ROOT + 'sources/' +
item[0] + '.txt', function(data) {
if (data != '') {
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
diff --git a/sphinx/themes/default/layout.html b/sphinx/themes/default/layout.html
index d91a565..9c6e06c 100644
--- a/sphinx/themes/default/layout.html
+++ b/sphinx/themes/default/layout.html
@@ -10,5 +10,5 @@
{% extends "basic/layout.html" %}
{% if theme_collapsiblesidebar|tobool %}
-{% set script_files = script_files + ['_static/sidebar.js'] %}
+{% set script_files = script_files + ['static/sidebar.js'] %}
{% endif %}
diff --git a/sphinx/themes/haiku/layout.html b/sphinx/themes/haiku/layout.html
index 719dba7..79973f2 100644
--- a/sphinx/themes/haiku/layout.html
+++ b/sphinx/themes/haiku/layout.html
@@ -8,8 +8,8 @@
:license: BSD, see LICENSE for details.
#}
{% extends "basic/layout.html" %}
-{% set script_files = script_files + ['_static/theme_extras.js'] %}
-{% set css_files = css_files + ['_static/print.css'] %}
+{% set script_files = script_files + ['static/theme_extras.js'] %}
+{% set css_files = css_files + ['static/print.css'] %}
{# do not display relbars #}
{% block relbar1 %}{% endblock %}
@@ -38,11 +38,11 @@
{%- block haikuheader %}
{%- if theme_full_logo != "false" %}
<a href="{{ pathto('index') }}">
- <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ <img class="logo" src="{{ pathto('static/' + logo, 1) }}" alt="Logo"/>
</a>
{%- else %}
{%- if logo -%}
- <img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ <img class="rightlogo" src="{{ pathto('static/' + logo, 1) }}" alt="Logo"/>
{%- endif -%}
<h1 class="heading"><a href="{{ pathto('index') }}">
<span>{{ shorttitle|e }}</span></a></h1>
diff --git a/sphinx/themes/scrolls/layout.html b/sphinx/themes/scrolls/layout.html
index 92cb694..fee5ff5 100644
--- a/sphinx/themes/scrolls/layout.html
+++ b/sphinx/themes/scrolls/layout.html
@@ -9,8 +9,8 @@
:license: BSD, see LICENSE for details.
#}
{% extends "basic/layout.html" %}
-{% set script_files = script_files + ['_static/theme_extras.js'] %}
-{% set css_files = css_files + ['_static/print.css'] %}
+{% set script_files = script_files + ['static/theme_extras.js'] %}
+{% set css_files = css_files + ['static/print.css'] %}
{# do not display relbars #}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
You can’t perform that action at this time.
