Skip to content

Show Varnish configuration in tabs #131

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
Nov 14, 2014
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ before_script:
- composer update --dev --prefer-source
# Install Sphinx
- sudo apt-get install python-sphinx
- sudo pip install -r doc/requirements.txt

script:
- phpunit --coverage-clover=coverage.clover
Expand Down
98 changes: 98 additions & 0 deletions doc/_static/tabs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
div.configuration-block {
position: relative;
}

div.configuration-block ul.simple {
margin-left: 38px;
}

div.configuration-block ul.simple li {
list-style: none;
float: left;
margin-left: 0;
margin-right: 1em;
padding: .2em .5em .5em .5em;
height: 38px;
background-color: #c9c9c9;
}

div.configuration-block ul.simple li.selected {
background-color: #343131;
border-bottom: none;
}

div.configuration-block ul.simple li.selected a {
color: white;
}

div.highlight-varnish3, div.highlight-varnish4 {
border: none !important;
}

div.configuration-block em {
font-style: normal;
}

div.configuration-block div {
border-top: none;
position: absolute;
left: 0;
width: 100%;
max-width: 100%;
overflow: auto;
}

div.configuration-block div div {
position: static;
}

div.highlight {
background-color: #343131 !important;
}

div.highlight pre {
border: none;
color: white;
}

div.highlight pre span.n,
div.highlight pre span.na,
div.highlight pre span.nb,
div.highlight pre span.nc,
div.highlight pre span.nf,
div.highlight pre span.nx {
color: white;
}

div.highlight pre span.nv {
color: #6ab0de
}

div.highlight pre span.k, div.highlight pre span.o {
color: #ff8400;
}

div.highlight pre span.mi,
div.highlight pre span.s,
div.highlight pre span.s1,
div.highlight pre span.s2,
div.highlight pre span.sr {
color: #56db3a;
}

div.highlight pre span.hll {
background-color: #848484;
}

div.highlight pre span.p {
color: #b3b3b3;
}

table.highlighttable td {
padding: 0;
}

table.highlighttable td div.linenodiv {
text-align: right;
width: 38px;
}
1 change: 1 addition & 0 deletions doc/_static/tabs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 20 additions & 11 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@
import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
from pygments.lexers.compiled import CLexer

lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['varnish3'] = CLexer()
lexers['varnish4'] = CLexer()

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

primary_domain = 'php'
highlight_language = 'php'

# 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('.'))

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# 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.coverage', 'sphinx.ext.extlinks']
extensions = ['sphinx.ext.coverage', 'sphinx.ext.extlinks', 'sensio.sphinx.configurationblock']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -86,10 +91,6 @@

# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'

# 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
# documentation.
Expand Down Expand Up @@ -117,7 +118,11 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_static_path = ['_static']

def setup(app):
app.add_javascript('tabs.js')
app.add_stylesheet('tabs.css')

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -244,3 +249,7 @@

extlinks = {'source': ('https://github.com/FriendsOfSymfony/FOSHttpCache/blob/master/%s', '') }

config_block = {
'varnish3': 'Varnish 3',
'varnish4': 'Varnish 4'
}
28 changes: 25 additions & 3 deletions doc/testing-the-library.rst → doc/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Contributing
============

Testing the Library
===================
-------------------

This chapter describes how to run the tests that are included with this library.

Expand All @@ -13,7 +16,7 @@ First clone the repository, install the vendors, then run the tests:
$ phpunit

Unit Tests
----------
~~~~~~~~~~

To run the unit tests separately:

Expand All @@ -22,7 +25,7 @@ To run the unit tests separately:
$ phpunit tests/Unit

Functional Tests
----------------
~~~~~~~~~~~~~~~~

The library also includes functional tests against a Varnish instance. The
functional test suite by default uses PHP’s built-in web server. If you have
Expand All @@ -43,5 +46,24 @@ To run the functional tests:

For more information about testing, see :doc:`/testing-your-application`.

Building the Documentation
--------------------------

First `install Sphinx`_, then download the requirements:

.. code-block:: bash

$ pip install -r doc/requirements.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also need to install sphinx itself. It is not handled by the requirements


To build the docs:

.. code-block:: bash

$ cd doc
$ make html

.. _HHVM: http://www.hhvm.com/
.. _HHVM FastCGI server: https://github.com/facebook/hhvm/wiki/fastcgi
.. _install Sphinx: http://sphinx-doc.org/latest/install.html


2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Contents:
user-context

testing-your-application
testing-the-library
contributing
2 changes: 2 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git+https://github.com/fabpot/sphinx-php.git
sphinx-rtd-theme==0.1.6
Loading