mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch 'stable'
This commit is contained in:
commit
0008d576fc
9
.circleci/config.yml
Normal file
9
.circleci/config.yml
Normal file
@ -0,0 +1,9 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: sphinxdoc/docker-ci
|
||||
working_directory: /sphinx
|
||||
steps:
|
||||
- checkout
|
||||
- run: make test PYTHON=/python3.4/bin/python
|
15
.travis.yml
15
.travis.yml
@ -16,6 +16,7 @@ env:
|
||||
- TEST='-v --durations 25'
|
||||
- PYTHONFAULTHANDLER=x
|
||||
- PYTHONWARNINGS=all
|
||||
- SKIP_LATEX_BUILD=1
|
||||
matrix:
|
||||
- DOCUTILS=0.12
|
||||
- DOCUTILS=0.13.1
|
||||
@ -34,16 +35,8 @@ matrix:
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- graphviz
|
||||
- texlive-latex-recommended
|
||||
- texlive-latex-extra
|
||||
- texlive-fonts-recommended
|
||||
- texlive-fonts-extra
|
||||
- texlive-luatex
|
||||
- texlive-xetex
|
||||
- lmodern
|
||||
- latex-xcolor
|
||||
- imagemagick
|
||||
- graphviz
|
||||
- imagemagick
|
||||
install:
|
||||
- pip install -U pip setuptools
|
||||
- pip install docutils==$DOCUTILS
|
||||
@ -52,4 +45,4 @@ install:
|
||||
script:
|
||||
- flake8
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then make style-check type-check test-async; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION != '3.6' ]]; then SKIP_LATEX_BUILD=1 make test; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION != '3.6' ]]; then make test; fi
|
||||
|
5
CHANGES
5
CHANGES
@ -68,6 +68,11 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #3754: HTML builder crashes if HTML theme appends own stylesheets
|
||||
* #3756: epub: Entity 'mdash' not defined
|
||||
* #3758: Sphinx crashed if logs are emitted in conf.py
|
||||
* #3755: incorrectly warns about dedent with literalinclude
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -121,6 +121,7 @@ class CSSContainer(list):
|
||||
RemovedInSphinx20Warning)
|
||||
for item in other:
|
||||
self.append(item)
|
||||
return self
|
||||
|
||||
def __add__(self, other):
|
||||
ret = CSSContainer(self)
|
||||
@ -260,7 +261,11 @@ class StandaloneHTMLBuilder(Builder):
|
||||
|
||||
@property
|
||||
def default_translator_class(self):
|
||||
if self.config.html_experimental_html5_writer and html5_ready:
|
||||
use_html5_writer = self.config.html_experimental_html5_writer
|
||||
if use_html5_writer is None:
|
||||
use_html5_writer = self.default_html5_translator
|
||||
|
||||
if use_html5_writer and html5_ready:
|
||||
return HTML5Translator
|
||||
else:
|
||||
return HTMLTranslator
|
||||
|
@ -209,11 +209,7 @@ class LiteralIncludeReader(object):
|
||||
if 'tab-width' in self.options:
|
||||
text = text.expandtabs(self.options['tab-width'])
|
||||
|
||||
lines = text.splitlines(True)
|
||||
if 'dedent' in self.options:
|
||||
return dedent_lines(lines, self.options.get('dedent'), location=location)
|
||||
else:
|
||||
return lines
|
||||
return text.splitlines(True)
|
||||
except (IOError, OSError):
|
||||
raise IOError(_('Include file %r not found or reading it failed') % filename)
|
||||
except UnicodeError:
|
||||
@ -231,7 +227,8 @@ class LiteralIncludeReader(object):
|
||||
self.end_filter,
|
||||
self.lines_filter,
|
||||
self.prepend_filter,
|
||||
self.append_filter]
|
||||
self.append_filter,
|
||||
self.dedent_filter]
|
||||
lines = self.read_file(self.filename, location=location)
|
||||
for func in filters:
|
||||
lines = func(lines, location=location)
|
||||
@ -367,6 +364,12 @@ class LiteralIncludeReader(object):
|
||||
|
||||
return lines
|
||||
|
||||
def dedent_filter(self, lines, location=None):
|
||||
if 'dedent' in self.options:
|
||||
return dedent_lines(lines, self.options.get('dedent'), location=location)
|
||||
else:
|
||||
return lines
|
||||
|
||||
|
||||
class LiteralInclude(Directive):
|
||||
"""
|
||||
|
@ -306,7 +306,13 @@ class WarningSuppressor(logging.Filter):
|
||||
type = getattr(record, 'type', None)
|
||||
subtype = getattr(record, 'subtype', None)
|
||||
|
||||
if is_suppressed_warning(type, subtype, self.app.config.suppress_warnings):
|
||||
try:
|
||||
suppress_warnings = self.app.config.suppress_warnings
|
||||
except AttributeError:
|
||||
# config is not initialized yet (ex. in conf.py)
|
||||
suppress_warnings = []
|
||||
|
||||
if is_suppressed_warning(type, subtype, suppress_warnings):
|
||||
return False
|
||||
else:
|
||||
self.app._warncount += 1
|
||||
|
Loading…
Reference in New Issue
Block a user