Skip to content

Commit 8e2c948

Browse files
committed
doc: Fix underscore fixup on Sphinx 2.x
1 parent 4dffd7c commit 8e2c948

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/jekyll_fix.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@
3636
def remove_directory_underscores(app, exception):
3737
if exception:
3838
return
39-
app.info(bold('fixing directory names... '), True)
39+
# Get logger
40+
try:
41+
from sphinx.util import logging
42+
logger = logging.getLogger(__name__)
43+
except (ImportError, AttributeError):
44+
# Sphinx < 1.6
45+
logger = app
46+
logger.info(bold('fixing directory names... '), nonl=True)
4047
# Rewrite references in HTML/JS files
4148
for dirpath, _, filenames in os.walk(app.outdir):
4249
for filename in filenames:
@@ -61,7 +68,7 @@ def remove_directory_underscores(app, exception):
6168
newfile = os.path.join(newdir, filename)
6269
os.rename(oldfile, newfile)
6370
os.rmdir(olddir)
64-
app.info('done')
71+
logger.info('done')
6572

6673

6774
def setup(app):

0 commit comments

Comments
 (0)