Skip to content

Commit 49706d4

Browse files
authored
Merge pull request #1 from symfony/master
Merge from symfony-docs
2 parents 99e2996 + 62b3c9f commit 49706d4

File tree

973 files changed

+75048
-54654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

973 files changed

+75048
-54654
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Code of Conduct
2+
===============
3+
4+
This project follows a [Code of Conduct][code_of_conduct] in order to ensure an
5+
open and welcoming environment. Please read the full text for understanding the
6+
accepted and unaccepted behavior.
7+
8+
Please read also the [reporting guidelines][guidelines], in case you encountered
9+
or witnessed any misbehavior.
10+
11+
[code_of_conduct]: https://symfony.com/doc/current/contributing/code_of_conduct/code_of_conduct.html
12+
[guidelines]: https://symfony.com/doc/current/contributing/code_of_conduct/reporting_guidelines.html

.github/CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Contributing
2+
------------
3+
4+
We love contributors! For more information on how you can contribute to the
5+
Symfony documentation, please read [Contributing to the Documentation](https://symfony.com/doc/current/contributing/documentation/overview.html).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
3+
If your pull request fixes a BUG, use the oldest maintained branch that contains
4+
the bug (see https://symfony.com/roadmap for the list of maintained branches).
5+
6+
If your pull request documents a NEW FEATURE, use the same Symfony branch where
7+
the feature was introduced (and `master` for features of unreleased versions).
8+
9+
-->

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/_build
2-
/_exts
1+
/_build/doctrees
2+
/_build/html
3+
*.pyc

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.platform.app.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This file describes an application. You can have multiple applications
2+
# in the same project.
3+
4+
# The name of this app. Must be unique within a project.
5+
name: symfonydocs
6+
7+
# The toolstack used to build the application.
8+
type: "php"
9+
10+
build:
11+
flavor: "composer"
12+
13+
# The configuration of app when it is exposed to the web.
14+
web:
15+
# The public directory of the app, relative to its root.
16+
document_root: "/_build/html"
17+
index_files:
18+
- index.html
19+
whitelist:
20+
- \.html$
21+
- \.txt$
22+
23+
# CSS and Javascript.
24+
- \.css$
25+
- \.js$
26+
- \.hbs$
27+
28+
# image/* types.
29+
- \.gif$
30+
- \.png$
31+
- \.ico$
32+
- \.svgz?$
33+
34+
# fonts types.
35+
- \.ttf$
36+
- \.eot$
37+
- \.woff$
38+
- \.otf$
39+
40+
# robots.txt.
41+
- /robots\.txt$
42+
43+
# The size of the persistent disk of the application (in MB).
44+
disk: 512
45+
46+
# Build time dependencies.
47+
dependencies:
48+
python:
49+
virtualenv: 15.1.0
50+
51+
# The hooks that will be performed when the package is deployed.
52+
hooks:
53+
build: |
54+
virtualenv .virtualenv
55+
. .virtualenv/bin/activate
56+
# Platform.sh currently sets PIP_USER=1.
57+
export PIP_USER=
58+
pip install pip==9.0.1 wheel==0.29.0
59+
pip install -r _build/.requirements.txt
60+
find .virtualenv -type f -name "*.rst" -delete
61+
make -C _build html

.platform/routes.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
http://www.{default}/:
2+
to: http://{default}/
3+
type: redirect
4+
http://{default}/:
5+
cache:
6+
cookies:
7+
- '*'
8+
default_ttl: 0
9+
enabled: true
10+
headers:
11+
- Accept
12+
- Accept-Language
13+
ssi:
14+
enabled: false
15+
type: upstream
16+
upstream: symfonydocs:php

.platform/services.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Keeping this file empty to not deploy unused services.

.travis.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
language: python
22

3-
python:
4-
- "2.7"
3+
python: 2.7
54

65
sudo: false
6+
cache:
7+
directories: [$HOME/.cache/pip]
78

8-
install:
9-
- "pip install -q -r requirements.txt --use-mirrors"
9+
install: pip install -r _build/.requirements.txt
1010

11-
script: sphinx-build -nW -b html -d _build/doctrees . _build/html
11+
script: make -C _build SPHINXOPTS=-nW html
1212

1313
branches:
1414
except:
1515
- github-comments
16-

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.markdown

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
Symfony Documentation
22
=====================
33

4-
This documentation is rendered online at http://symfony.com/doc/current/
4+
This documentation is rendered online at https://symfony.com/doc/current/
55

66
Contributing
77
------------
88

99
>**Note**
10-
>Unless you're documenting a feature that was introduced *after* Symfony 2.3
11-
>(e.g. in Symfony 2.4), all pull requests must be based off of the **2.3** branch,
10+
>Unless you're documenting a feature that was introduced *after* Symfony 2.7
11+
>(e.g. in Symfony 2.8), all pull requests must be based off of the **2.7** branch,
1212
>**not** the master or older branches.
1313
1414
We love contributors! For more information on how you can contribute to the
1515
Symfony documentation, please read
16-
[Contributing to the Documentation](http://symfony.com/doc/current/contributing/documentation/overview.html)
16+
[Contributing to the Documentation](https://symfony.com/doc/current/contributing/documentation/overview.html)
17+
18+
Platform.sh
19+
-----------
20+
21+
Pull requests are automatically built by [Platform.sh](https://platform.sh).

_build/.requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
alabaster==0.7.10
2+
Babel==2.4.0
3+
docutils==0.13.1
4+
imagesize==0.7.1
5+
Jinja2==2.9.6
6+
MarkupSafe==1.0
7+
Pygments==2.2.0
8+
pytz==2017.2
9+
requests==2.12.5
10+
six==1.10.0
11+
snowballstemmer==1.2.1
12+
Sphinx==1.3.6
13+
git+https://github.com/fabpot/sphinx-php.git@7312eccce9465640752e51373a480da700e02345#egg_name=sphinx-php

Makefile renamed to _build/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
BUILDDIR = _build
8+
BUILDDIR = .
99

1010
# Internal variables.
1111
PAPEROPT_a4 = -D latex_paper_size=a4
1212
PAPEROPT_letter = -D latex_paper_size=letter
13-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
13+
ALLSPHINXOPTS = -c $(BUILDDIR) -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ../
1414
# the i18n builder cannot share the environment and doctrees with the others
1515
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1616

_build/_theme/_exts/symfonycom/__init__.py

Whitespace-only changes.
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
from sphinx.highlighting import lexers, PygmentsBridge
2+
from pygments.style import Style
3+
from pygments.formatters import HtmlFormatter
4+
from pygments.token import Keyword, Name, Comment, String, Error, \
5+
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
6+
7+
from sphinx.writers.html import HTMLTranslator
8+
from docutils import nodes
9+
from sphinx.locale import admonitionlabels, lazy_gettext
10+
11+
customadmonitionlabels = admonitionlabels
12+
l_ = lazy_gettext
13+
customadmonitionlabels['best-practice'] = l_('Best Practice')
14+
15+
def _getType(path):
16+
return path[:path.find('/')]
17+
18+
def _isIndex(path):
19+
return 'index' in path
20+
21+
class SensioHTMLTranslator(HTMLTranslator):
22+
def __init__(self, builder, *args, **kwds):
23+
HTMLTranslator.__init__(self, builder, *args, **kwds)
24+
builder.templates.environment.filters['get_type'] = _getType
25+
builder.templates.environment.tests['index'] = _isIndex
26+
self.highlightlinenothreshold = 0
27+
28+
def visit_literal(self, node):
29+
self.body.append(self.starttag(node, 'tt', '', CLASS='docutils literal'))
30+
self.body.append('<code>')
31+
32+
def depart_literal(self, node):
33+
self.body.append('</code>')
34+
self.body.append('</tt>')
35+
36+
def visit_admonition(self, node, name=''):
37+
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
38+
self.body.append('<div class="' + name + '"></div>')
39+
self.body.append('<div class="admonition admonition-' + name + '">')
40+
if name and name != 'seealso':
41+
node.insert(0, nodes.title(name, customadmonitionlabels[name]))
42+
self.set_first_last(node)
43+
44+
def depart_admonition(self, node=None):
45+
self.body.append('</div></div>\n')
46+
47+
def visit_sidebar(self, node):
48+
self.body.append(self.starttag(node, 'div', CLASS=('admonition-wrapper')))
49+
self.body.append('<div class="sidebar"></div>')
50+
self.body.append('<div class="admonition admonition-sidebar">')
51+
self.set_first_last(node)
52+
self.in_sidebar = 1
53+
54+
def depart_sidebar(self, node):
55+
self.body.append('</div></div>\n')
56+
self.in_sidebar = None
57+
58+
# overriden to add a new highlight div around each block
59+
def visit_literal_block(self, node):
60+
if node.rawsource != node.astext():
61+
# most probably a parsed-literal block -- don't highlight
62+
return BaseTranslator.visit_literal_block(self, node)
63+
lang = self.highlightlang
64+
linenos = node.rawsource.count('\n') >= \
65+
self.highlightlinenothreshold - 1
66+
highlight_args = node.get('highlight_args', {})
67+
if node.has_key('language'):
68+
# code-block directives
69+
lang = node['language']
70+
highlight_args['force'] = True
71+
if node.has_key('linenos'):
72+
linenos = node['linenos']
73+
def warner(msg):
74+
self.builder.warn(msg, (self.builder.current_docname, node.line))
75+
highlighted = self.highlighter.highlight_block(
76+
node.rawsource, lang, warn=warner, linenos=linenos,
77+
**highlight_args)
78+
starttag = self.starttag(node, 'div', suffix='',
79+
CLASS='highlight-%s' % lang)
80+
self.body.append('<div class="literal-block">' + starttag + highlighted + '</div></div>\n')
81+
raise nodes.SkipNode
82+
83+
class SensioStyle(Style):
84+
background_color = "#000000"
85+
default_style = ""
86+
87+
styles = {
88+
# No corresponding class for the following:
89+
#Text: "", # class: ''
90+
Whitespace: "underline #f8f8f8", # class: 'w'
91+
Error: "#a40000 border:#ef2929", # class: 'err'
92+
Other: "#ffffff", # class 'x'
93+
94+
Comment: "italic #B729D9", # class: 'c'
95+
Comment.Single: "italic #B729D9", # class: 'c1'
96+
Comment.Multiline: "italic #B729D9", # class: 'cm'
97+
Comment.Preproc: "noitalic #aaa", # class: 'cp'
98+
99+
Keyword: "#FF8400", # class: 'k'
100+
Keyword.Constant: "#FF8400", # class: 'kc'
101+
Keyword.Declaration: "#FF8400", # class: 'kd'
102+
Keyword.Namespace: "#FF8400", # class: 'kn'
103+
Keyword.Pseudo: "#FF8400", # class: 'kp'
104+
Keyword.Reserved: "#FF8400", # class: 'kr'
105+
Keyword.Type: "#FF8400", # class: 'kt'
106+
107+
Operator: "#E0882F", # class: 'o'
108+
Operator.Word: "#E0882F", # class: 'ow' - like keywords
109+
110+
Punctuation: "#999999", # class: 'p'
111+
112+
# because special names such as Name.Class, Name.Function, etc.
113+
# are not recognized as such later in the parsing, we choose them
114+
# to look the same as ordinary variables.
115+
Name: "#ffffff", # class: 'n'
116+
Name.Attribute: "#ffffff", # class: 'na' - to be revised
117+
Name.Builtin: "#ffffff", # class: 'nb'
118+
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
119+
Name.Class: "#ffffff", # class: 'nc' - to be revised
120+
Name.Constant: "#ffffff", # class: 'no' - to be revised
121+
Name.Decorator: "#888", # class: 'nd' - to be revised
122+
Name.Entity: "#ce5c00", # class: 'ni'
123+
Name.Exception: "#cc0000", # class: 'ne'
124+
Name.Function: "#ffffff", # class: 'nf'
125+
Name.Property: "#ffffff", # class: 'py'
126+
Name.Label: "#f57900", # class: 'nl'
127+
Name.Namespace: "#ffffff", # class: 'nn' - to be revised
128+
Name.Other: "#ffffff", # class: 'nx'
129+
Name.Tag: "#cccccc", # class: 'nt' - like a keyword
130+
Name.Variable: "#ffffff", # class: 'nv' - to be revised
131+
Name.Variable.Class: "#ffffff", # class: 'vc' - to be revised
132+
Name.Variable.Global: "#ffffff", # class: 'vg' - to be revised
133+
Name.Variable.Instance: "#ffffff", # class: 'vi' - to be revised
134+
135+
Number: "#1299DA", # class: 'm'
136+
137+
Literal: "#ffffff", # class: 'l'
138+
Literal.Date: "#ffffff", # class: 'ld'
139+
140+
String: "#56DB3A", # class: 's'
141+
String.Backtick: "#56DB3A", # class: 'sb'
142+
String.Char: "#56DB3A", # class: 'sc'
143+
String.Doc: "italic #B729D9", # class: 'sd' - like a comment
144+
String.Double: "#56DB3A", # class: 's2'
145+
String.Escape: "#56DB3A", # class: 'se'
146+
String.Heredoc: "#56DB3A", # class: 'sh'
147+
String.Interpol: "#56DB3A", # class: 'si'
148+
String.Other: "#56DB3A", # class: 'sx'
149+
String.Regex: "#56DB3A", # class: 'sr'
150+
String.Single: "#56DB3A", # class: 's1'
151+
String.Symbol: "#56DB3A", # class: 'ss'
152+
153+
Generic: "#ffffff", # class: 'g'
154+
Generic.Deleted: "#a40000", # class: 'gd'
155+
Generic.Emph: "italic #ffffff", # class: 'ge'
156+
Generic.Error: "#ef2929", # class: 'gr'
157+
Generic.Heading: "#000080", # class: 'gh'
158+
Generic.Inserted: "#00A000", # class: 'gi'
159+
Generic.Output: "#888", # class: 'go'
160+
Generic.Prompt: "#745334", # class: 'gp'
161+
Generic.Strong: "bold #ffffff", # class: 'gs'
162+
Generic.Subheading: "bold #800080", # class: 'gu'
163+
Generic.Traceback: "bold #a40000", # class: 'gt'
164+
}
165+
166+
def setup(app):
167+
app.set_translator('html', SensioHTMLTranslator)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from pygments.lexer import RegexLexer, bygroups, using
2+
from pygments.token import *
3+
from pygments.lexers.shell import BashLexer, BatchLexer
4+
5+
class TerminalLexer(RegexLexer):
6+
name = 'Terminal'
7+
aliases = ['terminal']
8+
filenames = []
9+
10+
tokens = {
11+
'root': [
12+
('^\$', Generic.Prompt, 'bash-prompt'),
13+
('^[^\n>]+>', Generic.Prompt, 'dos-prompt'),
14+
('^#.+$', Comment.Single),
15+
('^.+$', Generic.Output),
16+
],
17+
'bash-prompt': [
18+
('(.+)$', bygroups(using(BashLexer)), '#pop')
19+
],
20+
'dos-prompt': [
21+
('(.+)$', bygroups(using(BatchLexer)), '#pop')
22+
],
23+
}

0 commit comments

Comments
 (0)