mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#303: `html_context
values given on the command line via
-A
`
should not override other values given in conf.py.
This commit is contained in:
parent
93cca3d4ac
commit
096725922a
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
|||||||
Release 0.6.4 (in development)
|
Release 0.6.4 (in development)
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
* #303: ``html_context`` values given on the command line via ``-A``
|
||||||
|
should not override other values given in conf.py.
|
||||||
|
|
||||||
* Fix a bug preventing incremental rebuilds for the ``dirhtml``
|
* Fix a bug preventing incremental rebuilds for the ``dirhtml``
|
||||||
builder.
|
builder.
|
||||||
|
|
||||||
|
@ -96,7 +96,6 @@ def main(argv):
|
|||||||
error = sys.stderr
|
error = sys.stderr
|
||||||
warnfile = None
|
warnfile = None
|
||||||
confoverrides = {}
|
confoverrides = {}
|
||||||
htmlcontext = {}
|
|
||||||
tags = []
|
tags = []
|
||||||
doctreedir = path.join(outdir, '.doctrees')
|
doctreedir = path.join(outdir, '.doctrees')
|
||||||
for opt, val in opts:
|
for opt, val in opts:
|
||||||
@ -142,7 +141,7 @@ def main(argv):
|
|||||||
val = int(val)
|
val = int(val)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
htmlcontext[key] = val
|
confoverrides['html_context.%s' % key] = val
|
||||||
elif opt == '-N':
|
elif opt == '-N':
|
||||||
nocolor()
|
nocolor()
|
||||||
elif opt == '-E':
|
elif opt == '-E':
|
||||||
@ -158,7 +157,6 @@ def main(argv):
|
|||||||
warnfile = val
|
warnfile = val
|
||||||
elif opt == '-P':
|
elif opt == '-P':
|
||||||
use_pdb = True
|
use_pdb = True
|
||||||
confoverrides['html_context'] = htmlcontext
|
|
||||||
|
|
||||||
if warning and warnfile:
|
if warning and warnfile:
|
||||||
warnfp = open(warnfile, 'w')
|
warnfp = open(warnfile, 'w')
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{% extends "!layout.html" %}
|
{% extends "!layout.html" %}
|
||||||
{% block extrahead %}
|
{% block extrahead %}
|
||||||
|
{# html_context variable from conf.py #}
|
||||||
<meta name="hc" content="{{ hckey }}" />
|
<meta name="hc" content="{{ hckey }}" />
|
||||||
|
{# html_context variable from confoverrides (as if given on cmdline) #}
|
||||||
|
<meta name="hc_co" content="{{ hckey_co }}" />
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -35,7 +35,7 @@ html_theme_options = {'testopt': 'testoverride'}
|
|||||||
html_style = 'default.css'
|
html_style = 'default.css'
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
html_last_updated_fmt = '%b %d, %Y'
|
html_last_updated_fmt = '%b %d, %Y'
|
||||||
html_context = {'hckey': 'hcval'}
|
html_context = {'hckey': 'hcval', 'hckey_co': 'wrong_hcval_co'}
|
||||||
|
|
||||||
htmlhelp_basename = 'SphinxTestsdoc'
|
htmlhelp_basename = 'SphinxTestsdoc'
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ HTML_XPATH = {
|
|||||||
},
|
},
|
||||||
'contents.html': {
|
'contents.html': {
|
||||||
".//meta[@name='hc'][@content='hcval']": '',
|
".//meta[@name='hc'][@content='hcval']": '',
|
||||||
|
".//meta[@name='hc_co'][@content='hcval_co']": '',
|
||||||
".//meta[@name='testopt'][@content='testoverride']": '',
|
".//meta[@name='testopt'][@content='testoverride']": '',
|
||||||
#".//td[@class='label']": r'\[Ref1\]', # docutils 0.5 only
|
#".//td[@class='label']": r'\[Ref1\]', # docutils 0.5 only
|
||||||
".//td[@class='label']": '',
|
".//td[@class='label']": '',
|
||||||
@ -179,6 +180,7 @@ def check_xpath(etree, fname, path, check):
|
|||||||
[node.text for node in nodes]))
|
[node.text for node in nodes]))
|
||||||
|
|
||||||
@gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True,
|
@gen_with_app(buildername='html', warning=html_warnfile, cleanenv=True,
|
||||||
|
confoverrides={'html_context.hckey_co': 'hcval_co'},
|
||||||
tags=['testtag'])
|
tags=['testtag'])
|
||||||
def test_html(app):
|
def test_html(app):
|
||||||
app.builder.build_all()
|
app.builder.build_all()
|
||||||
|
Loading…
Reference in New Issue
Block a user