Skip to content

Upgrade all CI to Sphinx 1.8.5 #13903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .doctor-rst.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ whitelist:
- '/FOSUserBundle(.*)\.yml/'
- '/``.yml``/'
- '/(.*)\.orm\.yml/' # currently DoctrineBundle only supports .yml
- '/rst-class/'
lines:
- 'in config files, so the old ``app/config/config_dev.yml`` goes to'
- '#. The most important config file is ``app/config/services.yml``, which now is'
Expand All @@ -72,3 +73,4 @@ whitelist:
- '$var .= "Because of this `\xE9` octet (\\xE9),\n";'
- "`Deploying Symfony 4 Apps on Heroku`_."
- ".. _`Deploying Symfony 4 Apps on Heroku`: https://devcenter.heroku.com/articles/deploying-symfony4"
- '.. code-block:: twig'
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: sudo apt-get install python-dev build-essential

- name: "Cache pip"
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('_build/.requirements.txt') }}
Expand All @@ -41,7 +41,7 @@ jobs:
run: pip install -r _build/.requirements.txt

- name: "Build documentation"
run: make -C _build SPHINXOPTS=-nqW html
run: make -C _build SPHINXOPTS="-nqW -j auto" html

doctor-rst:
name: DOCtor-RST
Expand Down
15 changes: 4 additions & 11 deletions _build/.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
alabaster==0.7.10
Babel==2.4.0
docutils==0.13.1
imagesize==0.7.1
Jinja2==2.10.1
MarkupSafe==1.0
Pygments==2.2.0
pytz==2017.2
requests==2.20.0
six==1.10.0
snowballstemmer==1.2.1
sphinx==1.3.6
git+https://github.com/fabpot/[email protected]#egg_name=sphinx-php
sphinx==1.8.5
git+https://github.com/fabpot/[email protected]#egg_name=sphinx-php
jsx-lexer===0.0.8
sphinx_rtd_theme==0.5.0
Original file line number Diff line number Diff line change
@@ -1,81 +1,7 @@
from sphinx.highlighting import lexers, PygmentsBridge
from pygments.style import Style
from pygments.formatters import HtmlFormatter
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal

from sphinx.writers.html import HTMLTranslator
from docutils import nodes
from sphinx.locale import admonitionlabels, lazy_gettext

customadmonitionlabels = admonitionlabels
l_ = lazy_gettext
customadmonitionlabels['best-practice'] = l_('Best Practice')

def _getType(path):
return path[:path.find('/')]

def _isIndex(path):
return 'index' in path

class SensioHTMLTranslator(HTMLTranslator):
def __init__(self, builder, *args, **kwds):
HTMLTranslator.__init__(self, builder, *args, **kwds)
builder.templates.environment.filters['get_type'] = _getType
builder.templates.environment.tests['index'] = _isIndex
self.highlightlinenothreshold = 0

def visit_literal(self, node):
self.body.append(self.starttag(node, 'code', '', CLASS='docutils literal notranslate'))

def depart_literal(self, node):
self.body.append('</code>')

def visit_admonition(self, node, name=''):
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
self.body.append('<div class="admonition ' + name + '">')
if name and name != 'seealso':
node.insert(0, nodes.title(name, customadmonitionlabels[name]))
self.set_first_last(node)

def depart_admonition(self, node=None):
self.body.append('</div></div>\n')

def visit_sidebar(self, node):
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
self.body.append('<div class="admonition admonition-sidebar">')
self.set_first_last(node)
self.in_sidebar = 1

def depart_sidebar(self, node):
self.body.append('</div></div>\n')
self.in_sidebar = None

# overriden to add a new highlight div around each block
def visit_literal_block(self, node):
if node.rawsource != node.astext():
# most probably a parsed-literal block -- don't highlight
return BaseTranslator.visit_literal_block(self, node)
lang = self.highlightlang
linenos = node.rawsource.count('\n') >= \
self.highlightlinenothreshold - 1
highlight_args = node.get('highlight_args', {})
if node.has_key('language'):
# code-block directives
lang = node['language']
highlight_args['force'] = True
if node.has_key('linenos'):
linenos = node['linenos']
def warner(msg):
self.builder.warn(msg, (self.builder.current_docname, node.line))
highlighted = self.highlighter.highlight_block(
node.rawsource, lang, warn=warner, linenos=linenos,
**highlight_args)
starttag = self.starttag(node, 'div', suffix='',
CLASS='highlight-%s' % lang)
self.body.append('<div class="literal-block">' + starttag + highlighted + '</div></div>\n')
raise nodes.SkipNode

class SensioStyle(Style):
background_color = "#000000"
default_style = ""
Expand Down Expand Up @@ -158,8 +84,3 @@ class SensioStyle(Style):
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}

def setup(app):
app.set_translator('html', SensioHTMLTranslator)

return {'parallel_read_safe': True}
23 changes: 23 additions & 0 deletions _build/_static/rtd_custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
body {
font-family:Lucida Grande,Lucida Sans Unicode,Lucida Sans,Geneva,Verdana,sans-serif !important;
}

h1, h2, h3, h4, h5, h6 {
font-family:Georgia,Times New Roman,Times,serif !important;
line-height:1.2 !important;
margin-top:0 !important;
margin-bottom:.5em !important;
}
p, .rst-content li{
font-size:14px !important;
line-height:1.45 !important;
}
.wy-menu-vertical a {
font-size:14px !important;
padding-right:0 !important;
}

.highlight {
background:#1e2125 !important;
color:#fafafa !important;
}
1 change: 1 addition & 0 deletions _build/_static/symfony-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions _build/_themes/sphinx_rtd_theme/__init__.py

This file was deleted.

82 changes: 0 additions & 82 deletions _build/_themes/sphinx_rtd_theme/breadcrumbs.html

This file was deleted.

52 changes: 0 additions & 52 deletions _build/_themes/sphinx_rtd_theme/footer.html

This file was deleted.

Loading