Skip to content

Commit

Permalink
Introduced a separate layout for the homepage and switched the extens…
Browse files Browse the repository at this point in the history
…ions to rst.
  • Loading branch information
jakzal committed May 22, 2013
1 parent b8bba4d commit 52a9470
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 90 deletions.
5 changes: 5 additions & 0 deletions _static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ body > header, body > section, body > footer {
}
body > header {
margin-top:20px;
padding:20px 60px 20px 60px;
}
body > header > nav {
float: left;
Expand Down Expand Up @@ -458,6 +459,10 @@ strong {
color:#000 !important;
}

.main-menu li.right {
float:right;
}


body > section.main h1, body > section.main h2, body > section.intro h1 {
font-style: italic;
Expand Down
45 changes: 45 additions & 0 deletions _templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% extends "!layout.html" %}

{%- block doctype -%}<!DOCTYPE html>{%- endblock -%}

{% set css_files = css_files + ['_static/scrolls.css', '_static/pygments.css', '_static/main.css', 'http://fonts.googleapis.com/css?family=Lobster', '_static/print.css'] %}

{%- block header %}
<header>
<ul class="main-menu">
<li{% if pagename == 'index' %} class="active"{% endif %}><a href="/">main</a></li>
<li{% if pagename != 'index' %} class="active"{% endif %}><a href="{{ pathto('docs/introduction') }}">phpspec manual</a></li>
<li class="right"><a href="http://github.com/phpspec/prophecy">prophecy repo</a></li>
<li class="right"><a href="http://github.com/phpspec/phpspec">phpspec repo</a></li>
</ul>
</header>
{% endblock %}

{% block content %}{% endblock %}

{% block footer %}
<footer>
<dl>
<dt>Resources</dt>
<dd><a href="http://behat.org">Behat</a></dd>
</dl>
<dl>
<dt>GitHub</dt>
<dd><a href="https://github.com/phpspec/phpspec">phpspec</a></dd>
</dl>

<div class="clear"></div>
</footer>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34229660-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
{% endblock %}
32 changes: 32 additions & 0 deletions _templates/basehome.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "base.html" %}

{% block htmltitle %}
<title>phpspec</title>
{% endblock %}

{% block content %}
<section class="intro">
<a id="logo" href="/">phpspec</a>

<div class="intro">
<h1>
A <span>php</span> toolset to drive emergent<br/>
design by <span>specification</span>.
</h1>
</div>

<div class="preview">
<a href="http://github.com/phpspec/phpspec" class="docs repo">
phpspec<br>repository
</a>
<a href="{{ pathto('docs/introduction') }}" class="docs manual">
phpspec<br>manual
</a>
<div style="clear:both"></div>
</div>
</section>

<section class="documentation">
{% block body %}{% endblock %}
</section>
{% endblock %}
14 changes: 14 additions & 0 deletions _templates/basepage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base.html" %}

{% block content %}
<section class="docs" id="manual">
<nav class="toc">
<h3>Chapters</h3>
{{ toc }}
</nav>

<section class="documentation">
{% block body %}{% endblock %}
</section>
</section>
{% endblock %}
92 changes: 5 additions & 87 deletions _templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,87 +1,5 @@
{% extends "!layout.html" %}

{%- block doctype -%}
<!DOCTYPE html>
{%- endblock -%}

{% set css_files = css_files + ['_static/scrolls.css', '_static/pygments.css', '_static/main.css', 'http://fonts.googleapis.com/css?family=Lobster', '_static/print.css'] %}

{% block extrahead %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34229660-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
{% endblock %}

{% block content %}
<section class="intro">
<a id="logo" href="http://phpspec.net">phpspec</a>

<div class="intro">
<h1>
A <span>php</span> toolset to drive emergent<br/>
design by <span>specification</span>.
</h1>
</div>

<div class="preview">
<a href="http://github.com/phpspec/phpspec" class="docs repo">
phpspec<br>repository
</a>
<a href="#manual" class="docs manual">
phpspec<br>manual
</a>
<div style="clear:both"></div>
</div>
</section>

<section class="docs" id="manual">

<nav class="toc">
<h3>Chapters</h3>
{{ toc }}
</nav>

<section class="documentation">
{% block body %}{% endblock %}
</section>

{#% if pagename != 'index' %}
<footer>
<nav>
{%- if prev %}
&laquo; <a href="{{ prev.link|e }}">{{ prev.title }}</a> |
{%- endif %}
{{ title }}
{%- if next %}
| <a href="{{ next.link|e }}">{{ next.title }}</a> &raquo;
{%- endif %}
</nav>
</footer>
{% endif %#}

</section>

<footer>
<dl>
<dt>Resources</dt>
<dd><a href="http://behat.org">Behat</a></dd>
</dl>
<dl>
<dt>GitHub</dt>
<dd><a href="https://github.com/phpspec/phpspec">phpspec</a></dd>
</dl>

<div class="clear"></div>
</footer>
{% endblock %}

{% block footer %}{% endblock %}
{% if pagename == 'index' %}
{% extends "basehome.html" %}
{% else %}
{% extends "basepage.html" %}
{% endif %}
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.txt'
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions index.txt → docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Then download ``composer.phar`` and run ``install`` command:
.. code-block:: bash
$ curl http://getcomposer.org/installer | php
$ php composer.phar install --dev

This comment has been minimized.

Copy link
@whatthejeff

whatthejeff May 23, 2013

Member

I think the current release of composer still requires install --dev to install dev dependencies.

$ php composer.phar install
Everything will be installed inside ``vendor`` folder and executable will
be linked into ``bin`` folder.
Expand Down Expand Up @@ -395,4 +395,4 @@ Other useful resources for learning/using **phpspec**:
.. toctree::
:maxdepth: 1
cookbook/matchers
../cookbook/matchers
31 changes: 31 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Getting started with **phpspec**
================================

Create a ``composer.json`` file:

.. code-block:: js
{
"require-dev": {
"phpspec/phpspec": "2.0.*@dev"
},
"config": {
"bin-dir": "bin"
},
"autoload": {"psr-0": {"": "src"}}
}
Install **phpspec** with composer:

.. code-block:: bash
curl http://getcomposer.org/installer | php
php composer.phar install
Start writing specs:

.. code-block:: bash
bin/phpspec desc Acme/Calculator
Learn more from :doc:`the documentation <docs/introduction>`.

0 comments on commit 52a9470

Please sign in to comment.