Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed Mar 3, 2015
2 parents 521af63 + 410464a commit 420e678
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 26 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

We are happy to review any contributions you want to make. When contributing, please:

- Fork from, and compare pull requests against, the `develop` branch.

- Adhere to the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).

- Include tests. We strive for 100% test coverage at all times.

- Describe any backwards-compatiblity breaking changes. As the project is still unstable, BC breaks are not as critical, but they are important to note.

The time between submitting a contribution and its review one may be extensive; do not be discouraged if there is not immediate feedback. Thanks!
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Bookdown is especially well-suited for publishing project documentation to GitHu

Read more about it at <http://bookdown.github.io>.

## Tests

Bookdown has 100% test coverage. To run the tests, install [PHPUnit](http://phpunit.de), then issue `phpunit` at the repository root.

## Todo

(In no particular order.)
Expand All @@ -24,7 +28,7 @@ Read more about it at <http://bookdown.github.io>.

- `"authors"`: name, note, email, and website of book authors

- `"authors"`: name, note, email, and website of book editors
- `"editors"`: name, note, email, and website of book editors

- `"copyright"`: year and holder

Expand All @@ -46,7 +50,7 @@ Read more about it at <http://bookdown.github.io>.

- A command to take a PHPDocumentor structure.xml file and convert it to a Bookdown origin structure (Markdown files + bookdown.json files)

- A process to rewrite links on generated pages (this is for books collected from multiple different sources)
- A process to rewrite links on generated pages (this is for books collected from multiple different sources, and for changing origin `*.md` links to target `*.html` links)

- A process to copying images and other resources from the origin to the target directory

Expand Down
46 changes: 46 additions & 0 deletions templates/head.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
<head>
<title><?php echo $this->page->getTitle(); ?></title>
<style>
nav table {
width: 100%;
}

nav.navheader td.curr,
nav.navheader th.curr {
text-align: center;
}

nav.navheader td.prev,
nav.navheader th.prev {
width: 30%;
text-align: left;
}

nav.navheader td.parent,
nav.navheader th.parent {
width: 40%;
text-align: center;
}

nav.navheader td.next,
nav.navheader th.next {
text-align: right;
width: 30%;
}

nav.navfooter td.prev,
nav.navfooter th.prev {
width: 30%;
text-align: left;
}

nav.navfooter td.parent,
nav.navfooter th.parent {
width: 40%;
text-align: center;
}

nav.navfooter td.next,
nav.navfooter th.next {
text-align: right;
width: 30%;
}
</style>
</head>
14 changes: 7 additions & 7 deletions templates/navfooter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
?>

<nav class="navfooter">
<table width="100%">
<table>
<tr>
<td width="40%" align="left"><?php if ($prev) {
<td class="prev"><?php if ($prev) {
echo $this->anchorRaw($prev->getHref(), 'Prev');
} ?></td>
<td width="20%" align="center"><?php if ($parent) {
<td class="parent"><?php if ($parent) {
echo $this->anchorRaw($parent->getHref(), 'Up');
} ?></td>
<td width="40%" align="right"><?php if ($next) {
<td class="next"><?php if ($next) {
echo $this->anchorRaw($next->getHref(), 'Next');
} ?></td>
</tr>
<tr>
<td width="40%" align="left" valign="top"><?php if ($prev) {
<td class="prev"><?php if ($prev) {
echo $prev->getNumberAndTitle();
} ?></td>
<td width="20%" align="center" valign="top"><?php if ($parent) {
<td class="parent"><?php if ($parent) {
echo $parent->getNumberAndTitle();
} ?></td>
<td width="40%" align="right" valign="top"><?php if ($next) {
<td class="next"><?php if ($next) {
echo $next->getNumberAndTitle();
} ?></td>
</tr>
Expand Down
10 changes: 5 additions & 5 deletions templates/navheader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@
?>

<nav class="navheader">
<table width="100%">
<table>
<tr>
<th colspan="3" align="center"><?php
<th colspan="3" class="curr"><?php
echo $this->page->getNumberAndTitle();
?></th>
</tr>
<tr>
<td width="20%" align="left"><?php if ($prev) {
<td class="prev"><?php if ($prev) {
echo $this->anchorRaw($prev->getHref(), $prev->getTitle());
} ?></td>
<td width="60%" align="center"><?php if ($parent) {
<td class="parent" align="center"><?php if ($parent) {
echo $parent->getNumberAndTitle();
} ?></th>
<td width="20%" align="right"><?php if ($next) {
<td class="next" align="right"><?php if ($next) {
echo $this->anchorRaw($next->getHref(), $next->getTitle());
} ?></td>
</tr>
Expand Down
70 changes: 58 additions & 12 deletions tests/Process/RenderingProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,64 @@ public function testRendering()
$expect = '<html>
<head>
<title>Chapter</title>
<style>
nav table {
width: 100%;
}
nav.navheader td.curr,
nav.navheader th.curr {
text-align: center;
}
nav.navheader td.prev,
nav.navheader th.prev {
width: 30%;
text-align: left;
}
nav.navheader td.parent,
nav.navheader th.parent {
width: 40%;
text-align: center;
}
nav.navheader td.next,
nav.navheader th.next {
text-align: right;
width: 30%;
}
nav.navfooter td.prev,
nav.navfooter th.prev {
width: 30%;
text-align: left;
}
nav.navfooter td.parent,
nav.navfooter th.parent {
width: 40%;
text-align: center;
}
nav.navfooter td.next,
nav.navfooter th.next {
text-align: right;
width: 30%;
}
</style>
</head>
<body>
<nav class="navheader">
<table width="100%">
<table>
<tr>
<th colspan="3" align="center">1. Chapter</th>
<th colspan="3" class="curr">1. Chapter</th>
</tr>
<tr>
<td width="20%" align="left"><a href="/">Example Book</a></td>
<td width="60%" align="center">Example Book</th>
<td width="20%" align="right"><a href="/chapter/section.html">Title</a></td>
<td class="prev"><a href="/">Example Book</a></td>
<td class="parent" align="center">Example Book</th>
<td class="next" align="right"><a href="/chapter/section.html">Title</a></td>
</tr>
</table>
</nav>
Expand All @@ -88,16 +134,16 @@ public function testRendering()
</dl>
<nav class="navfooter">
<table width="100%">
<table>
<tr>
<td width="40%" align="left"><a href="/">Prev</a></td>
<td width="20%" align="center"><a href="/">Up</a></td>
<td width="40%" align="right"><a href="/chapter/section.html">Next</a></td>
<td class="prev"><a href="/">Prev</a></td>
<td class="parent"><a href="/">Up</a></td>
<td class="next"><a href="/chapter/section.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Example Book</td>
<td width="20%" align="center" valign="top">Example Book</td>
<td width="40%" align="right" valign="top">1.1. Title</td>
<td class="prev">Example Book</td>
<td class="parent">Example Book</td>
<td class="next">1.1. Title</td>
</tr>
</table>
</nav>
Expand Down

0 comments on commit 420e678

Please sign in to comment.