├── .gitignore ├── README.md ├── book ├── .placeholder ├── bookdown.json └── example.md ├── composer.json └── templates ├── .placeholder ├── assets └── css │ └── style.css ├── head.php ├── main.php ├── navfooter.php └── navheader.php /.gitignore: -------------------------------------------------------------------------------- 1 | /composer.lock 2 | /vendor 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bookdown Project 2 | 3 | This forms a skeleton Bookdown production project, with an eye toward publishing via Github Pages. 4 | 5 | First, clone the repository you want to work in, called `{$REPO}`. This may be a user/organization repository (`organization.github.io`) or a Github project `gh-pages` branch. 6 | 7 | Then use composer to install the Bookdown project as a subdirectory inside `{$REPO}`. We suggest `_bookdown` since Github Pages will not publish underscore-prefixed directories. 8 | 9 | cd {$REPO} 10 | composer create-project -s dev bookdown/project _bookdown 11 | cd _bookdown 12 | 13 | Generate the example project: 14 | 15 | ./vendor/bin/bookdown book/bookdown.json 16 | 17 | This will generate the example HTML files at the root of `{$REPO}`. 18 | 19 | To browse the example HTML, run the built-in PHP server: 20 | 21 | php -S localhost:8080 -t {$REPO} 22 | 23 | Edit the `templates/head.php` file to modify the `
` on all generated files. 24 | 25 | Edit the `book/bookdown.json` file to add your own `book/` content, including both Markdown and other `bookdown.json` files. 26 | 27 | You may wish to add the following lines to `{$REPO}/.gitignore`: 28 | 29 | /_bookdown/vendor 30 | 31 | Then `git add` the `_bookdown/` directory along with the generated files, and push to publish. 32 | -------------------------------------------------------------------------------- /book/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookdown/Bookdown.Project/4a3bb0d6d3f06ac7fa31512cf513b72c1c7b42fd/book/.placeholder -------------------------------------------------------------------------------- /book/bookdown.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "My Book", 3 | "content": [ 4 | "example.md" 5 | ], 6 | "target": "../../", 7 | "template": "../templates/main.php" 8 | } 9 | -------------------------------------------------------------------------------- /book/example.md: -------------------------------------------------------------------------------- 1 | # Example Page 2 | 3 | This is an example page. 4 | 5 | ## Subtitle 6 | 7 | This is a subtitle on the example page. 8 | 9 | ### Sub-Subtitle 10 | 11 | This is a sub-subtitle on the example page. 12 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bookdown/project", 3 | "type": "project", 4 | "description": "A skeleton Bookdown project.", 5 | "keywords": [ 6 | "docbook", 7 | "markdown", 8 | "manual", 9 | "documentation", 10 | "static site" 11 | ], 12 | "homepage": "https://github.com/bookdown/Bookdown.Project", 13 | "license": "MIT", 14 | "authors": [ 15 | { 16 | "name": "Bookdown.Project Contributors", 17 | "homepage": "https://github.com/bookdown/Bookdown.Project/contributors" 18 | } 19 | ], 20 | "require": { 21 | "bookdown/bookdown": "~1.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /templates/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookdown/Bookdown.Project/4a3bb0d6d3f06ac7fa31512cf513b72c1c7b42fd/templates/.placeholder -------------------------------------------------------------------------------- /templates/assets/css/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Lato:300,400,700,900|Inconsolata); 2 | 3 | /* Simple Normalize */ 4 | /**,*/ 5 | /*html,*/ 6 | /*h1,h2,h3,h4,h5,h6 {*/ 7 | /*margin: 0;*/ 8 | /*padding: 0;*/ 9 | /*}*/ 10 | 11 | /* Set global Fonts and Basic Styles */ 12 | 13 | *, html { 14 | font-family: 'Lato', sans-serif; 15 | font-weight: 400; 16 | } 17 | 18 | /* Global Rules */ 19 | 20 | .container { 21 | /*background: #ddd;*/ 22 | } 23 | 24 | .clearfix { 25 | clear: both; 26 | } 27 | 28 | .rtrim { 29 | padding-right: 0px; 30 | } 31 | 32 | .ltrim { 33 | padding-left: 0px; 34 | } 35 | 36 | /* Global Styles */ 37 | 38 | a { 39 | 40 | } 41 | 42 | /* Header Section */ 43 | 44 | header { 45 | border-bottom: 1px solid #ddd; 46 | background: #f8f8f8; 47 | color: white; 48 | font-size: 16px; 49 | font-weight: 300; 50 | } 51 | 52 | header .prev { 53 | text-align: left; 54 | padding-top: 30px; 55 | } 56 | 57 | header .next { 58 | text-align: right; 59 | padding-top: 30px; 60 | } 61 | 62 | header label { 63 | display: block; 64 | color: #ddd; 65 | font-weight: 300; 66 | } 67 | 68 | header a { 69 | /*color: white;*/ 70 | } 71 | 72 | header .current { 73 | text-align: center; 74 | padding: 24px; 75 | } 76 | 77 | header .current h3.title { 78 | padding: 0; 79 | margin: 0; 80 | color: #444; 81 | } 82 | 83 | header .current small.parent { 84 | margin: 10px 0px; 85 | display: block; 86 | font-size: 16px; 87 | color: #888; 88 | font-weight: 300; 89 | } 90 | 91 | /* Content Section */ 92 | 93 | section#content { 94 | margin: 24px 0px; 95 | font-size: 17px; 96 | } 97 | 98 | #content code { 99 | font-family: 'Inconsolata', ; 100 | padding: 3px; 101 | /*border: 1px solid #ddd;*/ 102 | margin: 0px 3px; 103 | background: #444; 104 | color: white; 105 | } 106 | 107 | #content pre code { 108 | border: none; 109 | background: none; 110 | color: 444; 111 | font-size: 17px; 112 | } 113 | 114 | #content h1, 115 | #content h2, 116 | #content h3, 117 | #content h4, 118 | #content h5, 119 | #content h6 { 120 | color: #337ab7; 121 | } 122 | 123 | #content dd { 124 | margin-left: 17px; 125 | } 126 | 127 | #content dl dt { 128 | margin-top: 17px; 129 | } 130 | 131 | #content dd dl dt { 132 | margin-top: 0px; 133 | } 134 | 135 | /* Footer Section */ 136 | 137 | footer #links { 138 | border-top: 1px solid #ddd; 139 | border-bottom: none; 140 | padding: 30px 0px; 141 | } 142 | 143 | footer #links .prev { 144 | text-align: left; 145 | } 146 | 147 | footer #links .parent { 148 | text-align: center; 149 | } 150 | 151 | footer #links .next { 152 | text-align: right; 153 | } 154 | 155 | footer #links label { 156 | display: block; 157 | color: #ddd; 158 | font-weight: 300; 159 | } 160 | 161 | footer #links a { 162 | /*color: white;*/ 163 | } 164 | 165 | footer #copyright { 166 | padding: 50px; 167 | background: #222; 168 | text-align: center; 169 | color: #444; 170 | } 171 | 172 | footer #copyright span a { 173 | color: white; 174 | } 175 | -------------------------------------------------------------------------------- /templates/head.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |