From 5b445e6c0152294df5bf7a1effd9556c0730399f Mon Sep 17 00:00:00 2001 From: Ash Clarke Date: Mon, 29 Jul 2013 16:26:55 +0100 Subject: [PATCH 1/9] Update README.md Added configuration for IIS servers. --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/README.md b/README.md index 42208c2..f2d1dfc 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,51 @@ The Grunt.js task uses the built in web server in PHP 5.4 to host the docs on yo This project contains a package.json file, so once you have the requirements installed, you can simply run a `npm install` and then `grunt` in the projects folder to start the local web server. By default the server will run at: http://localhost:8085 +## Running on IIS + +If you have set up a local or remote IIS web site, you may need a `web.config` with: + +* A rewrite configuration, for handling clean urls. +* A mime type handler for less files, if using a custom theme. + +### Clean URLs + +The `web.config` needs an entry for `` under ``: + +```xml + + + + + + + + + + + + + + + + +``` + +*Note*: To have clean URLs with IIS6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/). + +### Less Mime Type + +The `web.config` needs a new `` entry, under `` in ``: + +```xml + + + +``` + +*Note*: Only add the mime map entry if you are using a custom theme and receive 404s for `.less` files. + If you have a global mime map entry for less files set, you will receive an internal server (500) error for having duplicate mime map entries. + ## Support If you need help using Daux.io, or have found a bug, please create an issue on the GitHub repo. From d8d8fecc617957618bf5429f8508a0cdece05ad5 Mon Sep 17 00:00:00 2001 From: Ash Clarke Date: Mon, 29 Jul 2013 16:31:00 +0100 Subject: [PATCH 2/9] Update README.md Tweaks. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f2d1dfc..751fa7c 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ The `web.config` needs an entry for `` under ``: ``` -*Note*: To have clean URLs with IIS6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/). +To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/). ### Less Mime Type @@ -256,8 +256,9 @@ The `web.config` needs a new `` entry, under `` in ` ``` -*Note*: Only add the mime map entry if you are using a custom theme and receive 404s for `.less` files. - If you have a global mime map entry for less files set, you will receive an internal server (500) error for having duplicate mime map entries. +You will only need the mime map entry if you are using a custom theme and receive 404s for `.less` files. + +If you have a global mime map entry for `.less` files set for the server, you will receive an internal server (500) error for having duplicate mime map entries. ## Support From be90aa14c92931061bc955ea350118171e9acadd Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 10:47:41 -0700 Subject: [PATCH 3/9] Revert "CSS padding tweaks for modified time" This reverts commit 9f34b05cd6204454276018f171a8e439ca04900a. --- css/daux-blue.css | 2 +- css/daux-green.css | 2 +- css/daux-navy.css | 2 +- css/daux-red.css | 2 +- less/import/daux-base.less | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/css/daux-blue.css b/css/daux-blue.css index a74fdd8..9d3fadd 100644 --- a/css/daux-blue.css +++ b/css/daux-blue.css @@ -6720,7 +6720,7 @@ code { } .page-header { margin: 10px 0px; - padding: 0px 0 20px; + padding: 0px; } .page-header h1 { margin-top: 0px; diff --git a/css/daux-green.css b/css/daux-green.css index 1f846e4..5b557a2 100644 --- a/css/daux-green.css +++ b/css/daux-green.css @@ -6720,7 +6720,7 @@ code { } .page-header { margin: 10px 0px; - padding: 0px 0 20px; + padding: 0px; } .page-header h1 { margin-top: 0px; diff --git a/css/daux-navy.css b/css/daux-navy.css index 77287f9..90a7466 100644 --- a/css/daux-navy.css +++ b/css/daux-navy.css @@ -6720,7 +6720,7 @@ code { } .page-header { margin: 10px 0px; - padding: 0px 0 20px; + padding: 0px; } .page-header h1 { margin-top: 0px; diff --git a/css/daux-red.css b/css/daux-red.css index 7017f8a..9187ad0 100644 --- a/css/daux-red.css +++ b/css/daux-red.css @@ -6720,7 +6720,7 @@ code { } .page-header { margin: 10px 0px; - padding: 0px 0 20px; + padding: 0px; } .page-header h1 { margin-top: 0px; diff --git a/less/import/daux-base.less b/less/import/daux-base.less index ca4a8ff..6d2faa6 100644 --- a/less/import/daux-base.less +++ b/less/import/daux-base.less @@ -474,7 +474,7 @@ code { .page-header { margin: 10px 0px; - padding: 0px 0 20px; + padding: 0px; h1 { margin-top: 0px; } From c2059e4df80c00a342bf8b8f0ca0756daf70ba25 Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 11:49:58 -0700 Subject: [PATCH 4/9] Added option to disable date_modified. Also began moving html/styling out of the functions/php logic. --- css/daux-blue.css | 4 ++++ css/daux-green.css | 4 ++++ css/daux-navy.css | 4 ++++ css/daux-red.css | 4 ++++ docs/config.json | 1 + index.php | 39 ++++++++++++++++++++++++++++++++++++-- less/import/daux-base.less | 3 +++ libs/functions.php | 28 ++++++++++++++------------- 8 files changed, 72 insertions(+), 15 deletions(-) diff --git a/css/daux-blue.css b/css/daux-blue.css index 9d3fadd..3b4f6fb 100644 --- a/css/daux-blue.css +++ b/css/daux-blue.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #82becd; diff --git a/css/daux-green.css b/css/daux-green.css index 5b557a2..2f61116 100644 --- a/css/daux-green.css +++ b/css/daux-green.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #8acc37; diff --git a/css/daux-navy.css b/css/daux-navy.css index 90a7466..c95a02a 100644 --- a/css/daux-navy.css +++ b/css/daux-navy.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #7795b4; diff --git a/css/daux-red.css b/css/daux-red.css index 9187ad0..6049831 100644 --- a/css/daux-red.css +++ b/css/daux-red.css @@ -6725,6 +6725,10 @@ code { .page-header h1 { margin-top: 0px; } +/* To be applied to the same element as page-header for sites that have sub-heading content such as Last modified time */ +.page-header .sub-heading { + padding: 0px, 0px, 20px; +} pre { border: none; background-color: #ecb5a1; diff --git a/docs/config.json b/docs/config.json index c133ecf..3dbd75c 100644 --- a/docs/config.json +++ b/docs/config.json @@ -3,6 +3,7 @@ "tagline": "The Easiest Way To Document Your Project", "image": "img/app.png", "theme": "navy", + "date_modified": true, "repo": "justinwalsh/daux.io", "twitter": ["justin_walsh", "todaymade"], "google_analytics": "UA-12653604-10", diff --git a/index.php b/index.php index 41d0c75..f9d660d 100644 --- a/index.php +++ b/index.php @@ -70,6 +70,8 @@ $tree = get_tree("docs", $base_url); $homepage_url = homepage_url($tree); $docs_url = docs_url($tree); +$page = load_page($tree); + // If a timezone has been set in the config file, override the default PHP timezone for this application. if(isset($options['timezone'])) { @@ -183,7 +185,24 @@ if ($homepage && $homepage_url !== '/') {
- + + + + + + + +
@@ -265,7 +284,23 @@ if ($homepage && $homepage_url !== '/') {
- + + + + + + +
diff --git a/less/import/daux-base.less b/less/import/daux-base.less index 6d2faa6..58e9555 100644 --- a/less/import/daux-base.less +++ b/less/import/daux-base.less @@ -478,6 +478,9 @@ code { h1 { margin-top: 0px; } + sub-heading { + padding: 0px, 0px, 20px; + } } pre { border: none; diff --git a/libs/functions.php b/libs/functions.php index f2856a1..a036322 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -34,6 +34,7 @@ function get_options() { 'tagline' => false, 'image' => false, 'theme' => 'blue', + 'date_modified' => true, 'float' => true, 'repo' => false, 'twitter' => array(), @@ -101,28 +102,29 @@ function docs_url($tree, $branch = false) { function load_page($tree) { $branch = find_branch($tree); + $page = array(); + if (isset($branch['type']) && $branch['type'] == 'file') { $html = ''; if ($branch['name'] !== 'index') { - $html .= ''; + $page['title'] = $branch['title']; + $page['modified'] = filemtime($branch['path']); } $html .= MarkdownExtended(file_get_contents($branch['path'])); - return $html; + + $page['html'] = $html; + } else { - return "Oh No. That page dosn't exist"; + + $page['title'] = "Oh no"; + $page['html'] = "

Oh No. That page dosn't exist

"; + } + + + return $page; } function find_branch($tree) { From 8c04e845045006394de45504a06774190ab3b561 Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 11:54:45 -0700 Subject: [PATCH 5/9] Documentation updates --- README.md | 8 ++++++++ docs/00_Getting_Started.md | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index d4963cf..41b9d4f 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,14 @@ If your server does not have a default timezone set in php.ini, it may return er "timezone": "America/Los_Angeles" } +###Date Modified +By default, daux.io will display the last modified time as reported by the system underneath the title for each document. To disable this, change the option in your config.json to false. + +```json +{ + "date_modified": false +} +``` ## Running Remotely diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index 3cd1f32..77574f0 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -167,6 +167,15 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi } } +###Date Modified +By default, daux.io will display the last modified time as reported by the system underneath the title for each document. To disable this, change the option in your config.json to false. + +```json +{ + "date_modified": false +} +``` + ## Running Remotely Copy the files from the repo to a web server that can run PHP 5.3 or greater. From b5668554a4459161fdd5be5d42b9bd56b62eac11 Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 11:58:04 -0700 Subject: [PATCH 6/9] Documentation updates --- README.md | 16 +++++++++------- docs/00_Getting_Started.md | 9 +++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 41b9d4f..6c04067 100644 --- a/README.md +++ b/README.md @@ -167,13 +167,6 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi } } -###Timezone -If your server does not have a default timezone set in php.ini, it may return errors when it tries to generate the last modified date/time for docs. To fix these errors, specify a timezone in your config file. Valid options are available in the [PHP Manual](http://php.net/manual/en/timezones.php). - - { - "timezone": "America/Los_Angeles" - } - ###Date Modified By default, daux.io will display the last modified time as reported by the system underneath the title for each document. To disable this, change the option in your config.json to false. @@ -183,6 +176,15 @@ By default, daux.io will display the last modified time as reported by the syste } ``` +###Timezone +If your server does not have a default timezone set in php.ini, it may return errors when it tries to generate the last modified date/time for docs. To fix these errors, specify a timezone in your config file. Valid options are available in the [PHP Manual](http://php.net/manual/en/timezones.php). + +```json +{ + "timezone": "America/Los_Angeles" +} +``` + ## Running Remotely Copy the files from the repo to a web server that can run PHP 5.3 or greater. diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index 77574f0..6c04067 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -176,6 +176,15 @@ By default, daux.io will display the last modified time as reported by the syste } ``` +###Timezone +If your server does not have a default timezone set in php.ini, it may return errors when it tries to generate the last modified date/time for docs. To fix these errors, specify a timezone in your config file. Valid options are available in the [PHP Manual](http://php.net/manual/en/timezones.php). + +```json +{ + "timezone": "America/Los_Angeles" +} +``` + ## Running Remotely Copy the files from the repo to a web server that can run PHP 5.3 or greater. From 0052d0306ac2fb7311a31a507e143b02ac0fb46d Mon Sep 17 00:00:00 2001 From: kisselev Date: Mon, 29 Jul 2013 12:06:40 -0700 Subject: [PATCH 7/9] Fix syntax highlighitng in documentation --- README.md | 6 ++++-- docs/00_Getting_Started.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ffbe208..5ecf69d 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,11 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi ###Disabling clean URLs By default, Daux.io will create clean url's that do not include index.php. On servers running Apache, uploading the included .htaccess file should be enough for them to work properly. On servers that are not running Apache or that do not allow custom .htaccess files, you may need to disable clean_urls: - { +```json +{ "clean_urls": false - } +} +``` ## Running Remotely diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index ffbe208..5ecf69d 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -170,9 +170,11 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi ###Disabling clean URLs By default, Daux.io will create clean url's that do not include index.php. On servers running Apache, uploading the included .htaccess file should be enough for them to work properly. On servers that are not running Apache or that do not allow custom .htaccess files, you may need to disable clean_urls: - { +```json +{ "clean_urls": false - } +} +``` ## Running Remotely From 026b76c59eb9a41ee1ff2f30d20fcc3635592c36 Mon Sep 17 00:00:00 2001 From: Justin Walsh Date: Tue, 30 Jul 2013 08:56:16 -0500 Subject: [PATCH 8/9] Copy readme over --- docs/00_Getting_Started.md | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index 12b058e..cef11a3 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -216,6 +216,52 @@ The Grunt.js task uses the built in web server in PHP 5.4 to host the docs on yo This project contains a package.json file, so once you have the requirements installed, you can simply run a `npm install` and then `grunt` in the projects folder to start the local web server. By default the server will run at: http://localhost:8085 +## Running on IIS + +If you have set up a local or remote IIS web site, you may need a `web.config` with: + +* A rewrite configuration, for handling clean urls. +* A mime type handler for less files, if using a custom theme. + +### Clean URLs + +The `web.config` needs an entry for `` under ``: + +```xml + + + + + + + + + + + + + + + + +``` + +To use clean URLs on IIS 6, you will need to use a custom URL rewrite module, such as [URL Rewriter](http://urlrewriter.net/). + +### Less Mime Type + +The `web.config` needs a new `` entry, under `` in ``: + +```xml + + + +``` + +You will only need the mime map entry if you are using a custom theme and receive 404s for `.less` files. + +If you have a global mime map entry for `.less` files set for the server, you will receive an internal server (500) error for having duplicate mime map entries. + ## Support If you need help using Daux.io, or have found a bug, please create an issue on the GitHub repo. From 5ff6a25883d7f4a9941ccca38195cca51411bc32 Mon Sep 17 00:00:00 2001 From: Justin Walsh Date: Tue, 30 Jul 2013 09:11:07 -0500 Subject: [PATCH 9/9] Removing title and date --- index.php | 19 +------------------ libs/functions.php | 5 +++-- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/index.php b/index.php index f9d660d..ee5dba2 100644 --- a/index.php +++ b/index.php @@ -184,24 +184,7 @@ if ($homepage && $homepage_url !== '/') {
-
- - - - - - - +
diff --git a/libs/functions.php b/libs/functions.php index cc34f44..fca70bd 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -1,6 +1,7 @@