diff --git a/03-project-hosting/050-homepage.rst b/03-project-hosting/050-homepage.rst index 52d7a57..45e6de8 100644 --- a/03-project-hosting/050-homepage.rst +++ b/03-project-hosting/050-homepage.rst @@ -13,12 +13,12 @@ 创建个人主页 -------------- -GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ ,用户为自己\ -的二级域名创建主页很容易,只要在托管空间下创建一个名为\ ``.github.com``\ +GitHub 为每一个用户分配了一个二级域名\ ``.github.io``\ ,用户为自己\ +的二级域名创建主页很容易,只要在托管空间下创建一个名为\ ``.github.io``\ 的版本库,向其\ ``master``\ 分支提交网站静态页面即可,其中网站首页为\ ``index.html``\ 。下面以\ ``gotgithub``\ 用户为例介绍如何创建个人主页。 -* 用户\ ``gotgithub``\ 创建一个名为\ ``gotgithub.github.com``\ 的Git版本库。 +* 用户\ ``gotgithub``\ 创建一个名为\ ``gotgithub.github.io``\ 的Git版本库。 在GitHub上创建版本库的操作,参见“第3.1节 :ref:`new-project`\ ”。 @@ -26,8 +26,8 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ :: - $ git clone git@github.com:gotgithub/gotgithub.github.com.git - $ cd gotgithub.github.com/ + $ git clone git@github.com:gotgithub/gotgithub.github.io.git + $ cd gotgithub.github.io/ * 在版本库根目录中创建文件\ ``index.html``\ 作为首页。 @@ -48,7 +48,7 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ $ git push origin master -* 访问网址: http://gotgithub.github.com/ 。 +* 访问网址: http://gotgithub.github.io/ 。 最多等待10分钟,GitHub就可以完成新网站的部署。网站完成部署后版本库\ 的所有者会收到邮件通知。 @@ -60,17 +60,17 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ 创建项目主页 --------------- -如前所述,GitHub会为每个账号分配一个二级域名\ ``.github.com``\ +如前所述,GitHub会为每个账号分配一个二级域名\ ``.github.io``\ 作为用户的首页地址。实际上还可以为每个项目设置主页,项目主页也通过\ 此二级域名进行访问。 例如\ ``gotgithub``\ 用户创建的\ ``helloworld``\ 项目如果启用了项目主页,\ -则可通过网址\ ``http://gotgithub.github.com/helloworld/``\ 访问。 +则可通过网址\ ``http://gotgithub.github.io/helloworld/``\ 访问。 为项目启用项目主页很简单,只需要在项目版本库中创建一个名为\ ``gh-pages``\ 的分支,并向其中添加静态网页即可。也就是说如果项目的Git版本库中包含了名为\ ``gh-pages``\ 分支的话,则表明该项目提供静态网页构成的主页,可以通过网址\ -``http://.github.com/``\ 访问到。 +``http://.github.io/``\ 访问到。 下面以用户\ ``gotgithub``\ 的项目\ ``helloworld``\ 为例,介绍如何维护项目主页。 @@ -221,7 +221,7 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ 无论哪种方法,一旦在GitHub远程版本库中创建分支\ ``gh-pages``\ ,项目的主页\ 就已经建立。稍后(不超过10分钟),用浏览器访问下面的地址即可看到刚刚提交的\ -项目首页: http://gotgithub.github.com/helloworld/ 。 +项目首页: http://gotgithub.github.io/helloworld/ 。 除了以上通过命令行创建\ ``gh-pages``\ 分支为项目设定主页之外,GitHub还提供\ 了图形操作界面。如图3-19所示。 @@ -256,32 +256,32 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ 首先按照前面章节介绍的步骤,为账号\ ``gotgit``\ 设置账户主页。 -1. 在账户\ ``gotgit``\ 下创建版本库\ ``gotgit.github.com``\ 以维护该账号主页。 +1. 在账户\ ``gotgit``\ 下创建版本库\ ``gotgit.github.io``\ 以维护该账号主页。 - 地址: https://github.com/gotgit/gotgit.github.com/ + 地址: https://github.com/gotgit/gotgit.github.io/ 2. 将网站内容提交并推送到该版本库\ ``master``\ 分支中。 - 即在\ ``gotgit.github.com``\ 版本库的根目录下至少包含一个首页文件,如\ + 即在\ ``gotgit.github.io``\ 版本库的根目录下至少包含一个首页文件,如\ ``index.html``\ 。还可以使用下节将要介绍到的 Jekyll 技术,让网页有统一的\ 显示风格,此时首页文件可能并非一个完整的HTML文档,而是套用了页面模版。 -3. 至此当访问网址\ http://gotgit.github.com\ 时,会将账号\ ``gotgit``\ - 的版本库\ ``gotgit.github.com``\ 中的内容作为网站内容显示出来。 +3. 至此当访问网址\ http://gotgit.github.io\ 时,会将账号\ ``gotgit``\ + 的版本库\ ``gotgit.github.io``\ 中的内容作为网站内容显示出来。 接下来进行如下操作,使得该网站能够使用专有域名\ ``www.worldhello.net``\ 提供服务。 -1. 在账号\ ``gotgit``\ 的版本库\ ``gotgit.github.com``\ 根目录下添加文件\ +1. 在账号\ ``gotgit``\ 的版本库\ ``gotgit.github.io``\ 根目录下添加文件\ ``CNAME``\ ,文件内容为:\ ``www.worldhello.net``\ 。 - 参见: https://github.com/gotgit/gotgit.github.com/blob/master/CNAME + 参见: https://github.com/gotgit/gotgit.github.io/blob/master/CNAME -2. 然后更改域名\ ``www.worldhello.net``\ 的IP地址,指向域名\ ``gotgit.github.com``\ +2. 然后更改域名\ ``www.worldhello.net``\ 的IP地址,指向域名\ ``gotgit.github.io``\ 对应的IP地址(注意不是\ ``github.com``\ 的IP地址)。 完成域名的DNS指向后,可试着用\ ``ping``\ 或\ ``dig``\ 命令确认域名\ - ``www.worldhello.net``\ 和\ ``gotgit.github.com``\ 指向同一IP地址。 + ``www.worldhello.net``\ 和\ ``gotgit.github.io``\ 指向同一IP地址。 :: @@ -290,13 +290,13 @@ GitHub 为每一个用户分配了一个二级域名\ ``.github.com``\ ; ANSWER SECTION: www.worldhello.net. 81078 IN A 204.232.175.78 - $ dig @8.8.8.8 -t a gotgit.github.com + $ dig @8.8.8.8 -t a gotgit.github.io ... ; ANSWER SECTION: - gotgit.github.com. 43200 IN A 204.232.175.78 + gotgit.github.io. 43200 IN A 204.232.175.78 设置完成后用浏览器访问 http://www.worldhello.net/ 即可看到由账号\ ``gotgit``\ -的版本库\ ``gotgit.github.com``\ 维护的页面。若将域名\ ``worldhello.net``\ +的版本库\ ``gotgit.github.io``\ 维护的页面。若将域名\ ``worldhello.net``\ (不带www前缀)也指向IP地址\ ``204.232.175.78``\ ,则访问网址\ http://worldhello.net/\ 会发现GitHub体贴地将该网址重定向到正确的地址\ http://www.worldhello.net/\ 。 diff --git a/04-work-with-others/010-fork-and-pull.rst b/04-work-with-others/010-fork-and-pull.rst index 88f9936..75397d3 100644 --- a/04-work-with-others/010-fork-and-pull.rst +++ b/04-work-with-others/010-fork-and-pull.rst @@ -99,7 +99,7 @@ GotGit版本库\ [#]_\ 用于维护《Git权威指南》一书的官网和勘误 $ git push -访问GitHub上的派生项目页面,会看到以用户whangsheng在\ ``master``\ 分支\ [#]_\ +访问GitHub上的派生项目页面,会看到以用户wangsheng在\ ``master``\ 分支\ [#]_\ 创建的提交。如图4-4所示。 .. figure:: /images/work-with-others/gotgit-new-commit.png diff --git a/06-side-projects/jobs.rst b/06-side-projects/jobs.rst index 090f249..abdbc41 100644 --- a/06-side-projects/jobs.rst +++ b/06-side-projects/jobs.rst @@ -21,7 +21,7 @@ GitHub的求职网站(如图6-16所示)。 图6-17:企业主发布招聘启示流程 -企业发布招聘启示,首先要按照模版填写职位说明及留下供求职着投递简历的邮件地址,\ +企业发布招聘启示,首先要按照模版填写职位说明及留下供求职者投递简历的邮件地址,\ 然后用信用卡付费,每一个招聘启示的付费标准为350美元/月。一旦付费完成招聘马上\ 生效。GitHub作为程序员的聚集地,无疑是招聘和应聘的理想之地。 diff --git a/Makefile b/Makefile index bb56482..51f4079 100644 --- a/Makefile +++ b/Makefile @@ -164,7 +164,14 @@ doctest: pre-build: images update-version images: - (cd graphics; rake convert[../images,600] ) + @(cd graphics; \ + if test -f Rakefile; then \ + rake convert[../images,600]; \ + else \ + echo "ERROR: Submodule 'graphics' not found. Please init submodule using: " >&2; \ + echo "ERROR: git submodule init && git submodule update" >&2; \ + exit 1; \ + fi) update-version: @sed -e "s##$$(git describe --dirty --always)#g" < _version.inc.in > _version.inc.tmp diff --git a/README.md b/README.md index f981d6a..b04f360 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,8 @@ * 通过子模组更新命令克隆子模组版本库(即保存图片的版本库)并检出。 - $ git submodule init - $ git submodule update + $ git submodule init + $ git submodule update ### 编译书稿 diff --git a/contrib/sphinx/0001-No-prefix-_-for-sphinx-build-output-directories.patch b/contrib/sphinx/0001-No-prefix-_-for-sphinx-build-output-directories.patch new file mode 100644 index 0000000..8b94fef --- /dev/null +++ b/contrib/sphinx/0001-No-prefix-_-for-sphinx-build-output-directories.patch @@ -0,0 +1,826 @@ +From d83d125e3dadcd13b7cc95fba28e4036b4089b85 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiang Xin +Date: Fri, 26 Aug 2011 10:39:23 +0800 +Subject: [PATCH] No prefix '_' for sphinx build output directories + +[This hack is based on sphinx 1.1.3.] + +Some phinx output dirs has a prefix such as '_static', '_sources', +'_images', '_downloads'. Because GitHub website host does not like +directories with a '_' prefix, and these paths are hard-coded (can +not be changed through config files), so comes this workaround. + +This patch change the hard-coded dirs from '_static', '_images', +'_sources', '_downloads' to 'static', 'images', 'sources', and +'downloads'. + +Signed-off-by: Jiang Xin +--- + doc/_templates/indexsidebar.html | 2 +- + doc/_templates/layout.html | 2 +- + doc/conf.py | 10 ++++---- + doc/config.rst | 6 ++--- + doc/templating.rst | 2 +- + sphinx/application.py | 4 +-- + sphinx/builders/html.py | 40 ++++++++++++++--------------- + sphinx/builders/htmlhelp.py | 2 +- + sphinx/builders/qthelp.py | 4 +-- + sphinx/builders/websupport.py | 10 ++++---- + sphinx/ext/graphviz.py | 2 +- + sphinx/ext/pngmath.py | 2 +- + sphinx/quickstart.py | 6 ++--- + sphinx/themes/agogo/layout.html | 4 +-- + sphinx/themes/basic/domainindex.html | 2 +- + sphinx/themes/basic/layout.html | 10 ++++---- + sphinx/themes/basic/search.html | 2 +- + sphinx/themes/basic/sourcelink.html | 2 +- + sphinx/themes/basic/static/searchtools.js_t | 2 +- + sphinx/themes/default/layout.html | 2 +- + sphinx/themes/haiku/layout.html | 8 +++--- + sphinx/themes/pyramid/layout.html | 4 +-- + sphinx/themes/pyramid/static/ie6.css | 2 +- + sphinx/themes/scrolls/layout.html | 4 +-- + sphinx/websupport/__init__.py | 2 +- + tests/root/_static/README | 1 - + tests/root/_static/excluded.css | 1 - + tests/root/_static/subdir/foo.css | 1 - + tests/root/conf.py | 2 +- + tests/root/static/README | 1 + + tests/root/static/excluded.css | 1 + + tests/root/static/subdir/foo.css | 1 + + tests/test_build_html.py | 24 ++++++++--------- + tests/test_quickstart.py | 11 +++++--- + 34 files changed, 91 insertions(+), 88 deletions(-) + delete mode 100644 tests/root/_static/README + delete mode 100644 tests/root/_static/excluded.css + delete mode 100644 tests/root/_static/subdir/foo.css + create mode 100644 tests/root/static/README + create mode 100644 tests/root/static/excluded.css + create mode 100644 tests/root/static/subdir/foo.css + +diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html +index feafd90..e3125f6 100644 +--- a/doc/_templates/indexsidebar.html ++++ b/doc/_templates/indexsidebar.html +@@ -1,5 +1,5 @@ + ++

+ +

Download

+ {% if version.endswith('(hg)') %} +diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html +index 6e609e1..d748c8a 100644 +--- a/doc/_templates/layout.html ++++ b/doc/_templates/layout.html +@@ -18,6 +18,6 @@ + + {% block header %} +
+-Sphinx logo ++Sphinx logo +
+ {% endblock %} +diff --git a/doc/conf.py b/doc/conf.py +index 1b8ba3e..f5c49b1 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -20,7 +20,7 @@ show_authors = True + + html_theme = 'sphinxdoc' + modindex_common_prefix = ['sphinx.'] +-html_static_path = ['_static'] ++html_static_path = ['static'] + html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']} + html_additional_pages = {'index': 'index.html'} + html_use_opensearch = 'http://sphinx.pocoo.org' +@@ -34,13 +34,13 @@ epub_publisher = 'http://sphinx.pocoo.org/' + epub_scheme = 'url' + epub_identifier = epub_publisher + epub_pre_files = [('index.html', 'Welcome')] +-epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', +- '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', +- '_static/basic.css', 'search.html'] ++epub_exclude_files = ['static/opensearch.xml', 'static/doctools.js', ++ 'static/jquery.js', 'static/searchtools.js', 'static/underscore.js', ++ 'static/basic.css', 'search.html'] + + latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation', + 'Georg Brandl', 'manual', 1)] +-latex_logo = '_static/sphinx.png' ++latex_logo = 'static/sphinx.png' + latex_elements = { + 'fontpkg': '\\usepackage{palatino}', + } +diff --git a/doc/config.rst b/doc/config.rst +index 5d188c6..0da3f3a 100644 +--- a/doc/config.rst ++++ b/doc/config.rst +@@ -491,7 +491,7 @@ that use Sphinx' HTMLWriter class. + exceed 200 pixels. Default: ``None``. + + .. versionadded:: 0.4.1 +- The image file will be copied to the ``_static`` directory of the output ++ The image file will be copied to the ``static`` directory of the output + HTML, so an already existing file with that name will be overwritten. + + .. confval:: html_favicon +@@ -836,8 +836,8 @@ the `Dublin Core metadata `_. + template filename is empty, no html cover page is created. No cover at all + is created if the tuple is empty. Examples:: + +- epub_cover = ('_static/cover.png', 'epub-cover.html') +- epub_cover = ('_static/cover.png', '') ++ epub_cover = ('static/cover.png', 'epub-cover.html') ++ epub_cover = ('static/cover.png', '') + epub_cover = () + + The default value is ``()``. +diff --git a/doc/templating.rst b/doc/templating.rst +index 05a1346..1e24904 100644 +--- a/doc/templating.rst ++++ b/doc/templating.rst +@@ -198,7 +198,7 @@ Overriding works like this:: + + Add additional script files here, like this:: + +- {% set script_files = script_files + ["_static/myscript.js"] %} ++ {% set script_files = script_files + ["static/myscript.js"] %} + + .. data:: css_files + +diff --git a/sphinx/application.py b/sphinx/application.py +index bfb39a7..9d336bf 100644 +--- 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 8184037..1b38437 100644 +--- 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) +@@ -746,7 +746,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) +@@ -930,7 +930,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() +@@ -1003,7 +1003,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 fdf25cc..d122563 100644 +--- a/sphinx/builders/htmlhelp.py ++++ b/sphinx/builders/htmlhelp.py +@@ -212,7 +212,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 5e5deaf..f2fa13a 100644 +--- a/sphinx/builders/qthelp.py ++++ b/sphinx/builders/qthelp.py +@@ -155,8 +155,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/builders/websupport.py b/sphinx/builders/websupport.py +index b775730..f0a1135 100644 +--- a/sphinx/builders/websupport.py ++++ b/sphinx/builders/websupport.py +@@ -37,7 +37,7 @@ class WebSupportBuilder(PickleHTMLBuilder): + raise RuntimeError('websupport builder must be used with ' + 'the builtin templates') + # add our custom JS +- self.script_files.append('_static/websupport.js') ++ self.script_files.append('static/websupport.js') + + def set_webinfo(self, staticdir, virtual_staticdir, search, storage): + self.staticdir = staticdir +@@ -58,9 +58,9 @@ class WebSupportBuilder(PickleHTMLBuilder): + + self.cur_docname = docname + self.secnumbers = self.env.toc_secnumbers.get(docname, {}) +- self.imgpath = '/' + posixpath.join(self.virtual_staticdir, '_images') ++ self.imgpath = '/' + posixpath.join(self.virtual_staticdir, 'images') + self.post_process_images(doctree) +- self.dlpath = '/' + posixpath.join(self.virtual_staticdir, '_downloads') ++ self.dlpath = '/' + posixpath.join(self.virtual_staticdir, 'downloads') + self.docwriter.write(doctree, destination) + self.docwriter.assemble_parts() + body = self.docwriter.parts['fragment'] +@@ -129,7 +129,7 @@ class WebSupportBuilder(PickleHTMLBuilder): + # "show source" link + if ctx.get('sourcename'): + source_name = path.join(self.staticdir, +- '_sources', os_path(ctx['sourcename'])) ++ 'sources', os_path(ctx['sourcename'])) + ensuredir(path.dirname(source_name)) + copyfile(self.env.doc2path(pagename), source_name) + +@@ -142,7 +142,7 @@ class WebSupportBuilder(PickleHTMLBuilder): + PickleHTMLBuilder.handle_finish(self) + + # move static stuff over to separate directory +- directories = ['_images', '_static'] ++ directories = ['images', 'static'] + for directory in directories: + src = path.join(self.outdir, directory) + dst = path.join(self.staticdir, directory) +diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py +index ee93594..296cf0e 100644 +--- 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 100644 +--- 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/quickstart.py b/sphinx/quickstart.py +index 86dc047..4552e91 100644 +--- a/sphinx/quickstart.py ++++ b/sphinx/quickstart.py +@@ -160,7 +160,7 @@ html_theme = 'default' + # Add any paths that contain custom static files (such as style sheets) here, + # relative to this directory. They are copied after the builtin static files, + # so a file named "default.css" will overwrite the builtin "default.css". +-html_static_path = ['%(dot)sstatic'] ++html_static_path = ['static'] + + # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, + # using the given strftime format. +@@ -852,7 +852,7 @@ Either, you use a directory "_build" within the root path, or you separate + if 'dot' not in d: + print ''' + Inside the root directory, two more directories will be created; "_templates" +-for custom HTML templates and "_static" for custom stylesheets and other static ++for custom HTML templates and "static" for custom stylesheets and other static + files. You can enter another prefix (such as ".") to replace the underscore.''' + do_prompt(d, 'dot', 'Name prefix for templates and static dir', '_', ok) + +@@ -997,7 +997,7 @@ def generate(d, overwrite=True, silent=False): + d['exclude_patterns'] = repr(d['dot'] + 'build') + mkdir_p(builddir) + mkdir_p(path.join(srcdir, d['dot'] + 'templates')) +- mkdir_p(path.join(srcdir, d['dot'] + 'static')) ++ mkdir_p(path.join(srcdir, 'static')) + + def write_file(fpath, mode, content): + if overwrite or not path.isfile(fpath): +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 @@ +
+ {%- if logo %} + + {%- endif %} + {%- block headertitle %} +@@ -75,7 +75,7 @@ + {%- endfor %} + {%- if show_source and has_source and sourcename %} +
+- {{ _('Show Source') }} + {%- endif %} +
+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 %} + + {% if grouptype == 1 -%} +- + {%- endif %} + {% 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 %} + + {%- endif %} + {%- endblock %} +@@ -100,8 +100,8 @@ + {%- endmacro %} + + {%- macro css() %} +- +- ++ ++ + {%- for cssfile in css_files %} + + {%- endfor %} +@@ -120,10 +120,10 @@ + {%- if use_opensearch %} + ++ href="{{ pathto('static/opensearch.xml', 1) }}"/> + {%- endif %} + {%- if favicon %} +- ++ + {%- 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 %} +