From 0905395774c40ecc94c4c1802e14bf0bf3efdd54 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 15 Jul 2015 20:20:06 +0900 Subject: [PATCH 01/15] Fix code --- create_framework/http-kernel-controller-resolver.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_framework/http-kernel-controller-resolver.rst b/create_framework/http-kernel-controller-resolver.rst index b0393b4cdd3..deca8f05abd 100644 --- a/create_framework/http-kernel-controller-resolver.rst +++ b/create_framework/http-kernel-controller-resolver.rst @@ -160,7 +160,7 @@ Let's conclude with the new version of our framework:: function render_template(Request $request) { - extract($request->attributes->all()); + extract($request->attributes->all(), EXTR_SKIP); ob_start(); include sprintf(__DIR__.'/../src/pages/%s.php', $_route); From 1e1a129c8dec5cc6fac810ea677f1f35f3fae542 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 1 Aug 2015 16:11:50 +0200 Subject: [PATCH 02/15] [Cookbook][Session] fix default expiry field name --- cookbook/doctrine/mongodb_session_storage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/doctrine/mongodb_session_storage.rst b/cookbook/doctrine/mongodb_session_storage.rst index 5b2811fab8f..12f304a2754 100644 --- a/cookbook/doctrine/mongodb_session_storage.rst +++ b/cookbook/doctrine/mongodb_session_storage.rst @@ -165,7 +165,7 @@ From the `MongoDB shell`_: .. code-block:: sql use session_db - db.session.ensureIndex( { "expireAt": 1 }, { expireAfterSeconds: 0 } ) + db.session.ensureIndex( { "expires_at": 1 }, { expireAfterSeconds: 0 } ) .. _installed and configured a MongoDB server: http://docs.mongodb.org/manual/installation/ .. _MongoDB shell: http://docs.mongodb.org/v2.2/tutorial/getting-started-with-the-mongo-shell/ From 4b23fdc6d2953c0783d4f9ea9f1fbb754464b691 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 4 Aug 2015 23:23:31 +0200 Subject: [PATCH 03/15] don't override existing variables When extracting the request attributes, existing variables must not be overridden so that the `$request` variable is passed to the template as is. --- create_framework/templating.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_framework/templating.rst b/create_framework/templating.rst index 987a9ea26d1..43e77f92623 100644 --- a/create_framework/templating.rst +++ b/create_framework/templating.rst @@ -41,7 +41,7 @@ rendered:: function render_template($request) { - extract($request->attributes->all()); + extract($request->attributes->all(), EXTR_SKIP); ob_start(); include sprintf(__DIR__.'/../src/pages/%s.php', $_route); @@ -110,7 +110,7 @@ Here is the updated and improved version of our framework:: function render_template($request) { - extract($request->attributes->all()); + extract($request->attributes->all(), EXTR_SKIP); ob_start(); include sprintf(__DIR__.'/../src/pages/%s.php', $_route); From dede18324286b72105e30f2ce337369560170215 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 3 Aug 2015 15:47:51 +0200 Subject: [PATCH 04/15] Updated the profiler matchers article --- cookbook/profiler/matchers.rst | 59 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst index 2a990aff333..0bf1ad9ef0e 100644 --- a/cookbook/profiler/matchers.rst +++ b/cookbook/profiler/matchers.rst @@ -4,20 +4,20 @@ How to Use Matchers to Enable the Profiler Conditionally ======================================================== -By default, the profiler is only activated in the development environment. But -it's imaginable that a developer may want to see the profiler even in -production. Another situation may be that you want to show the profiler only -when an admin has logged in. You can enable the profiler in these situations -by using matchers. +The Symfony profiler is only activated in the development environment to not hurt +your application performance. However, sometimes it may be useful to conditionally +enable the profiler in the production environment to assist you in hard to debug +issues. This behavior is implemented with the **Request Matchers**. Using the built-in Matcher -------------------------- -Symfony provides a +A Request Matcher is a class that checks whether a given ``Request`` instance +matches a set of conditions. Symfony provides a :class:`built-in matcher ` -which can match paths and IPs. For example, if you want to only show the -profiler when accessing the page with the ``168.0.0.1`` IP, then you can -use this configuration: +which matches paths and IPs. For example, if you want to only show the profiler +when accessing the page with the ``168.0.0.1`` IP, then you can use this +configuration: .. configuration-block:: @@ -50,22 +50,24 @@ use this configuration: You can also set a ``path`` option to define the path on which the profiler should be enabled. For instance, setting it to ``^/admin/`` will enable the -profiler only for the ``/admin/`` URLs. +profiler only for the URLs which start with ``/admin/``. -Creating a custom Matcher +Creating a Custom Matcher ------------------------- -You can also create a custom matcher. This is a service that checks whether -the profiler should be enabled or not. To create that service, create a class +Leveraging the concept of Request Matchers you can define a custom matcher to +enable the profiler conditionally in your application. To do so, create a class which implements :class:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface`. This interface requires one method: :method:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface::matches`. -This method returns false to disable the profiler and true to enable the -profiler. +This method returns ``false`` when the request doesn't match the conditions and +``true`` otherwise. Therefore, the custom matcher must return ``false`` to +disable the profiler and ``true`` to enable it. -To enable the profiler when a ``ROLE_SUPER_ADMIN`` is logged in, you can use -something like:: +Suppose that the profiler must be enabled whenever a user with a +``ROLE_SUPER_ADMIN`` is logged in. This is the only code needed for that custom +matcher:: // src/AppBundle/Profiler/SuperAdminMatcher.php namespace AppBundle\Profiler; @@ -89,7 +91,8 @@ something like:: } } -Then, you need to configure the service: +Then, configure a new service and set it as ``private`` because the application +won't use it directly: .. configuration-block:: @@ -97,16 +100,17 @@ Then, you need to configure the service: # app/config/services.yml services: - app.profiler.matcher.super_admin: + app.super_admin_matcher: class: AppBundle\Profiler\SuperAdminMatcher arguments: ["@security.context"] + public: false .. code-block:: xml - + @@ -116,12 +120,15 @@ Then, you need to configure the service: use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; - $container->setDefinition('app.profiler.matcher.super_admin', new Definition( + $definition = new Definition( 'AppBundle\Profiler\SuperAdminMatcher', array(new Reference('security.context')) ); + $definition->setPublic(false); -Now the service is registered, the only thing left to do is configure the + $container->setDefinition('app.super_admin_matcher', $definition); + +Once the service is registered, the only thing left to do is configure the profiler to use this service as the matcher: .. configuration-block:: @@ -133,7 +140,7 @@ profiler to use this service as the matcher: # ... profiler: matcher: - service: app.profiler.matcher.super_admin + service: app.super_admin_matcher .. code-block:: xml @@ -141,7 +148,7 @@ profiler to use this service as the matcher: @@ -151,6 +158,6 @@ profiler to use this service as the matcher: $container->loadFromExtension('framework', array( // ... 'profiler' => array( - 'service' => 'app.profiler.matcher.super_admin', + 'service' => 'app.super_admin_matcher', ), )); From 6c76b2bf0f04ca39a2ba524ac50d781a6da05aca Mon Sep 17 00:00:00 2001 From: WouterJ Date: Thu, 20 Aug 2015 11:06:52 +0200 Subject: [PATCH 05/15] [#5593] Very little rewording and improving config --- cookbook/profiler/matchers.rst | 46 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst index 0bf1ad9ef0e..0d7c1a4f2b8 100644 --- a/cookbook/profiler/matchers.rst +++ b/cookbook/profiler/matchers.rst @@ -6,13 +6,13 @@ How to Use Matchers to Enable the Profiler Conditionally The Symfony profiler is only activated in the development environment to not hurt your application performance. However, sometimes it may be useful to conditionally -enable the profiler in the production environment to assist you in hard to debug +enable the profiler in the production environment to assist you in debugging issues. This behavior is implemented with the **Request Matchers**. Using the built-in Matcher -------------------------- -A Request Matcher is a class that checks whether a given ``Request`` instance +A request matcher is a class that checks whether a given ``Request`` instance matches a set of conditions. Symfony provides a :class:`built-in matcher ` which matches paths and IPs. For example, if you want to only show the profiler @@ -33,16 +33,27 @@ configuration: .. code-block:: xml - - - + + + + + + + + .. code-block:: php // app/config/config.php $container->loadFromExtension('framework', array( + // ... 'profiler' => array( 'ip' => '168.0.0.1', ), @@ -145,12 +156,21 @@ profiler to use this service as the matcher: .. code-block:: xml - - - - + + + + + + + + .. code-block:: php From 1c8cfbe92cc9bda97f41ea215549e12b7eecefb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 20 Aug 2015 13:18:13 +0200 Subject: [PATCH 06/15] Update page_creation.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.7 | Fixed tickets | --- book/page_creation.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/page_creation.rst b/book/page_creation.rst index 9e649356024..e317c75deff 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -104,7 +104,7 @@ Just add a second method to ``LuckyController``:: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController + class LuckyController extends Controller { // ... @@ -137,7 +137,7 @@ You can even shorten this with the handy :class:`Symfony\\Component\\HttpFoundat // --> don't forget this new use statement use Symfony\Component\HttpFoundation\JsonResponse; - class LuckyController + class LuckyController extends Controller { // ... @@ -170,7 +170,7 @@ at the end: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController + class LuckyController extends Controller { /** * @Route("/lucky/number/{count}") @@ -224,7 +224,7 @@ The best part is that you can access this value and use it in your controller:: // src/AppBundle/Controller/LuckyController.php // ... - class LuckyController + class LuckyController extends Controller { /** From 9d2bc8ff9d6ef3d6378d27bb60e62edf03b40785 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Fri, 31 Jul 2015 12:03:26 +0200 Subject: [PATCH 07/15] Use symfony.com theme on Platform.sh builds --- .gitignore | 1 + .platform/_exts/symfonycom/__init__.py | 0 .platform/_exts/symfonycom/sphinx/__init__.py | 167 ++++++++++++++++++ .platform/_templates/globaltoc.html | 20 +++ .platform/_templates/layout.html | 72 ++++++++ .platform/_templates/localtoc.html | 6 + conf.py | 10 +- 7 files changed, 273 insertions(+), 3 deletions(-) create mode 100644 .platform/_exts/symfonycom/__init__.py create mode 100644 .platform/_exts/symfonycom/sphinx/__init__.py create mode 100644 .platform/_templates/globaltoc.html create mode 100644 .platform/_templates/layout.html create mode 100644 .platform/_templates/localtoc.html diff --git a/.gitignore b/.gitignore index 805ea28a8f0..29a1d85cb56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /_build /_exts +*.pyc diff --git a/.platform/_exts/symfonycom/__init__.py b/.platform/_exts/symfonycom/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.platform/_exts/symfonycom/sphinx/__init__.py b/.platform/_exts/symfonycom/sphinx/__init__.py new file mode 100644 index 00000000000..1c08bcc11c8 --- /dev/null +++ b/.platform/_exts/symfonycom/sphinx/__init__.py @@ -0,0 +1,167 @@ +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, 'tt', '', CLASS='docutils literal')) + self.body.append('') + + def depart_literal(self, node): + self.body.append('') + self.body.append('') + + def visit_admonition(self, node, name=''): + self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper'))) + self.body.append('
') + self.body.append('
') + 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('
\n') + + def visit_sidebar(self, node): + self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper'))) + self.body.append('') + self.body.append('
') + self.set_first_last(node) + self.in_sidebar = 1 + + def depart_sidebar(self, node): + self.body.append('
\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('
' + starttag + highlighted + '
\n') + raise nodes.SkipNode + +class SensioStyle(Style): + background_color = "#000000" + default_style = "" + + styles = { + # No corresponding class for the following: + #Text: "", # class: '' + Whitespace: "underline #f8f8f8", # class: 'w' + Error: "#a40000 border:#ef2929", # class: 'err' + Other: "#ffffff", # class 'x' + + Comment: "italic #B729D9", # class: 'c' + Comment.Single: "italic #B729D9", # class: 'c1' + Comment.Multiline: "italic #B729D9", # class: 'cm' + Comment.Preproc: "noitalic #aaa", # class: 'cp' + + Keyword: "#FF8400", # class: 'k' + Keyword.Constant: "#FF8400", # class: 'kc' + Keyword.Declaration: "#FF8400", # class: 'kd' + Keyword.Namespace: "#FF8400", # class: 'kn' + Keyword.Pseudo: "#FF8400", # class: 'kp' + Keyword.Reserved: "#FF8400", # class: 'kr' + Keyword.Type: "#FF8400", # class: 'kt' + + Operator: "#E0882F", # class: 'o' + Operator.Word: "#E0882F", # class: 'ow' - like keywords + + Punctuation: "#999999", # class: 'p' + + # because special names such as Name.Class, Name.Function, etc. + # are not recognized as such later in the parsing, we choose them + # to look the same as ordinary variables. + Name: "#ffffff", # class: 'n' + Name.Attribute: "#ffffff", # class: 'na' - to be revised + Name.Builtin: "#ffffff", # class: 'nb' + Name.Builtin.Pseudo: "#3465a4", # class: 'bp' + Name.Class: "#ffffff", # class: 'nc' - to be revised + Name.Constant: "#ffffff", # class: 'no' - to be revised + Name.Decorator: "#888", # class: 'nd' - to be revised + Name.Entity: "#ce5c00", # class: 'ni' + Name.Exception: "#cc0000", # class: 'ne' + Name.Function: "#ffffff", # class: 'nf' + Name.Property: "#ffffff", # class: 'py' + Name.Label: "#f57900", # class: 'nl' + Name.Namespace: "#ffffff", # class: 'nn' - to be revised + Name.Other: "#ffffff", # class: 'nx' + Name.Tag: "#cccccc", # class: 'nt' - like a keyword + Name.Variable: "#ffffff", # class: 'nv' - to be revised + Name.Variable.Class: "#ffffff", # class: 'vc' - to be revised + Name.Variable.Global: "#ffffff", # class: 'vg' - to be revised + Name.Variable.Instance: "#ffffff", # class: 'vi' - to be revised + + Number: "#1299DA", # class: 'm' + + Literal: "#ffffff", # class: 'l' + Literal.Date: "#ffffff", # class: 'ld' + + String: "#56DB3A", # class: 's' + String.Backtick: "#56DB3A", # class: 'sb' + String.Char: "#56DB3A", # class: 'sc' + String.Doc: "italic #B729D9", # class: 'sd' - like a comment + String.Double: "#56DB3A", # class: 's2' + String.Escape: "#56DB3A", # class: 'se' + String.Heredoc: "#56DB3A", # class: 'sh' + String.Interpol: "#56DB3A", # class: 'si' + String.Other: "#56DB3A", # class: 'sx' + String.Regex: "#56DB3A", # class: 'sr' + String.Single: "#56DB3A", # class: 's1' + String.Symbol: "#56DB3A", # class: 'ss' + + Generic: "#ffffff", # class: 'g' + Generic.Deleted: "#a40000", # class: 'gd' + Generic.Emph: "italic #ffffff", # class: 'ge' + Generic.Error: "#ef2929", # class: 'gr' + Generic.Heading: "#000080", # class: 'gh' + Generic.Inserted: "#00A000", # class: 'gi' + Generic.Output: "#888", # class: 'go' + Generic.Prompt: "#745334", # class: 'gp' + Generic.Strong: "bold #ffffff", # class: 'gs' + Generic.Subheading: "bold #800080", # class: 'gu' + Generic.Traceback: "bold #a40000", # class: 'gt' + } + +def setup(app): + app.set_translator('html', SensioHTMLTranslator) diff --git a/.platform/_templates/globaltoc.html b/.platform/_templates/globaltoc.html new file mode 100644 index 00000000000..0dfcc246dd7 --- /dev/null +++ b/.platform/_templates/globaltoc.html @@ -0,0 +1,20 @@ + diff --git a/.platform/_templates/layout.html b/.platform/_templates/layout.html new file mode 100644 index 00000000000..3264dbaf2dc --- /dev/null +++ b/.platform/_templates/layout.html @@ -0,0 +1,72 @@ +{% extends '!layout.html' %} + +{% set css_files = ['http://symfony.com/css/compiled/v5/all.css?v=4'] %} +{# make sure the Sphinx stylesheet isn't loaded #} +{% set style = '' %} +{% set isIndex = pagename is index %} + +{% block extrahead %} +{# add JS to support tabs #} + + +{# pygment's styles are still loaded, undo some unwanted styles #} + +{% endblock %} + +{% block header %} +{# ugly way, now we have 2 body tags, but styles rely on these classes #} + +{% endblock %} + +{% block content %} +
+
+ {%- if render_sidebar %} + + {%- endif %} + +
+ + +

{{ title }}

+ +
+ {% block body %}{% endblock %} +
+ + {% if prev and next %} + + {% endif %} +
+
+
+{% endblock %} + +{# relbar1 is at the top and should not render the quick navigation #} +{% block relbar1 %}{% endblock %} +{% block relbar2 %}{% endblock %} + +{# remove "generated by sphinx" footer #} +{% block footer %}{% endblock %} diff --git a/.platform/_templates/localtoc.html b/.platform/_templates/localtoc.html new file mode 100644 index 00000000000..0ffea6e1ecd --- /dev/null +++ b/.platform/_templates/localtoc.html @@ -0,0 +1,6 @@ +
+

{{ _('Table Of Contents') }}

+
+ {{ toc }} +
+
diff --git a/conf.py b/conf.py index ab4e823e384..db9676a43ed 100644 --- a/conf.py +++ b/conf.py @@ -19,6 +19,7 @@ #sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('_exts')) +sys.path.append(os.path.abspath('.platform/_exts')) # adding PhpLexer from sphinx.highlighting import lexers @@ -34,11 +35,14 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', - 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice'] +extensions = [ + 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', + 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice', 'sensio.sphinx.codeblock', + 'symfonycom.sphinx' +] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ['.platform/_templates'] # The suffix of source filenames. source_suffix = '.rst' From 3e829456c526463bb00a4821f0bc2cfddc99f476 Mon Sep 17 00:00:00 2001 From: Wouter J Date: Tue, 18 Aug 2015 13:10:30 +0200 Subject: [PATCH 08/15] Temporary disable codeblock --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index db9676a43ed..bff5cbee037 100644 --- a/conf.py +++ b/conf.py @@ -37,7 +37,7 @@ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', - 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice', 'sensio.sphinx.codeblock', + 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice', #'sensio.sphinx.codeblock', 'symfonycom.sphinx' ] From bafc2ec776065eb4e651d005d350734089123c3f Mon Sep 17 00:00:00 2001 From: Wouter J Date: Tue, 18 Aug 2015 13:16:17 +0200 Subject: [PATCH 09/15] Use a more recent version of Sphinx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 667ca86fa50..3ad82398f25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ cache: - $HOME/.cache/pip - _build -install: pip install sphinx==1.1.3 +install: pip install sphinx~=1.3 script: sphinx-build -nW -b html -d _build/doctrees . _build/html From f931d83258f02f9200e731c1f50e30d171f00f4d Mon Sep 17 00:00:00 2001 From: Wouter J Date: Tue, 18 Aug 2015 13:19:43 +0200 Subject: [PATCH 10/15] Update config --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index bff5cbee037..c9f5ce633ac 100644 --- a/conf.py +++ b/conf.py @@ -130,7 +130,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'classic' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the From a10683b37798e6a4b7ad46838937f5572052dab2 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 18 Aug 2015 18:57:11 +0200 Subject: [PATCH 11/15] Move Sphinx files to _theme --- {.platform => _theme}/_exts/symfonycom/__init__.py | 0 {.platform => _theme}/_exts/symfonycom/sphinx/__init__.py | 0 {.platform => _theme}/_templates/globaltoc.html | 0 {.platform => _theme}/_templates/layout.html | 0 {.platform => _theme}/_templates/localtoc.html | 0 conf.py | 6 +++--- 6 files changed, 3 insertions(+), 3 deletions(-) rename {.platform => _theme}/_exts/symfonycom/__init__.py (100%) rename {.platform => _theme}/_exts/symfonycom/sphinx/__init__.py (100%) rename {.platform => _theme}/_templates/globaltoc.html (100%) rename {.platform => _theme}/_templates/layout.html (100%) rename {.platform => _theme}/_templates/localtoc.html (100%) diff --git a/.platform/_exts/symfonycom/__init__.py b/_theme/_exts/symfonycom/__init__.py similarity index 100% rename from .platform/_exts/symfonycom/__init__.py rename to _theme/_exts/symfonycom/__init__.py diff --git a/.platform/_exts/symfonycom/sphinx/__init__.py b/_theme/_exts/symfonycom/sphinx/__init__.py similarity index 100% rename from .platform/_exts/symfonycom/sphinx/__init__.py rename to _theme/_exts/symfonycom/sphinx/__init__.py diff --git a/.platform/_templates/globaltoc.html b/_theme/_templates/globaltoc.html similarity index 100% rename from .platform/_templates/globaltoc.html rename to _theme/_templates/globaltoc.html diff --git a/.platform/_templates/layout.html b/_theme/_templates/layout.html similarity index 100% rename from .platform/_templates/layout.html rename to _theme/_templates/layout.html diff --git a/.platform/_templates/localtoc.html b/_theme/_templates/localtoc.html similarity index 100% rename from .platform/_templates/localtoc.html rename to _theme/_templates/localtoc.html diff --git a/conf.py b/conf.py index c9f5ce633ac..797ee53f18f 100644 --- a/conf.py +++ b/conf.py @@ -19,7 +19,7 @@ #sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('_exts')) -sys.path.append(os.path.abspath('.platform/_exts')) +sys.path.append(os.path.abspath('_theme/_exts')) # adding PhpLexer from sphinx.highlighting import lexers @@ -42,7 +42,7 @@ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['.platform/_templates'] +templates_path = ['_theme/_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -78,7 +78,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -# exclude_patterns = ['_build', 'bundles'] +exclude_patterns = ['_theme'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None From 01dd675da446051939f73d885041f0841d6cecd9 Mon Sep 17 00:00:00 2001 From: Wouter J Date: Wed, 19 Aug 2015 12:26:04 +0200 Subject: [PATCH 12/15] Add demo warning --- _theme/_templates/layout.html | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/_theme/_templates/layout.html b/_theme/_templates/layout.html index 3264dbaf2dc..2696efbeeed 100644 --- a/_theme/_templates/layout.html +++ b/_theme/_templates/layout.html @@ -13,6 +13,13 @@ {% endblock %} @@ -27,11 +34,17 @@ {%- if render_sidebar %} {%- endif %} @@ -59,6 +72,10 @@

{{ title }}

{{ next.title|striptags|e }} »
{% endif %} + +
+

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

+
From c70e1328b3f6e59de3c0624c38336847620e166d Mon Sep 17 00:00:00 2001 From: WouterJ Date: Wed, 19 Aug 2015 22:32:27 +0200 Subject: [PATCH 13/15] Use numbered code block --- _exts | 2 +- conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_exts b/_exts index 52f7bd2216c..1b7c4b794d7 160000 --- a/_exts +++ b/_exts @@ -1 +1 @@ -Subproject commit 52f7bd2216cc22ef52494f346c5643bb2a74513f +Subproject commit 1b7c4b794d75f7b0eb6749cadccc58f87e3158a0 diff --git a/conf.py b/conf.py index 797ee53f18f..9e846b32f84 100644 --- a/conf.py +++ b/conf.py @@ -37,7 +37,7 @@ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', - 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice', #'sensio.sphinx.codeblock', + 'sensio.sphinx.refinclude', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice', 'sensio.sphinx.codeblock', 'symfonycom.sphinx' ] From 62a99b3a733f3d5a67231e7f9735cb72e0f0cb05 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Wed, 19 Aug 2015 23:13:31 +0200 Subject: [PATCH 14/15] Use pip instead of submodules --- .gitmodules | 3 --- .travis.yml | 2 +- _exts | 1 - conf.py | 3 --- 4 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 .gitmodules delete mode 160000 _exts diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 486727b665d..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "sphinx-php"] - path = _exts - url = http://github.com/fabpot/sphinx-php diff --git a/.travis.yml b/.travis.yml index 3ad82398f25..29682488140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ cache: - $HOME/.cache/pip - _build -install: pip install sphinx~=1.3 +install: pip install sphinx~=1.3 git+https://github.com/fabpot/sphinx-php.git script: sphinx-build -nW -b html -d _build/doctrees . _build/html diff --git a/_exts b/_exts deleted file mode 160000 index 1b7c4b794d7..00000000000 --- a/_exts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1b7c4b794d75f7b0eb6749cadccc58f87e3158a0 diff --git a/conf.py b/conf.py index 9e846b32f84..e7c6b9d1800 100644 --- a/conf.py +++ b/conf.py @@ -16,9 +16,6 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -sys.path.append(os.path.abspath('_exts')) sys.path.append(os.path.abspath('_theme/_exts')) # adding PhpLexer From ebc0e0b98fa33465fc6d8456ee53931273fa857b Mon Sep 17 00:00:00 2001 From: WouterJ Date: Wed, 19 Aug 2015 23:24:48 +0200 Subject: [PATCH 15/15] Reset some more pygments styles --- _theme/_templates/layout.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/_theme/_templates/layout.html b/_theme/_templates/layout.html index 2696efbeeed..01bce31b749 100644 --- a/_theme/_templates/layout.html +++ b/_theme/_templates/layout.html @@ -11,7 +11,16 @@ {# pygment's styles are still loaded, undo some unwanted styles #}