Merge remote-tracking branch 'upstream/master'
Conflicts: README.md
This commit is contained in:
commit
4763b8d970
67
README.md
67
README.md
@ -191,16 +191,29 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi
|
|||||||
###Disabling clean URLs
|
###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:
|
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
|
"clean_urls": false
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
###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
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
###Timezone
|
###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).
|
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"
|
"timezone": "America/Los_Angeles"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Running Remotely
|
## Running Remotely
|
||||||
|
|
||||||
@ -221,6 +234,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: <a href="http://localhost:8085" target="_blank">http://localhost:8085</a>
|
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: <a href="http://localhost:8085" target="_blank">http://localhost:8085</a>
|
||||||
|
|
||||||
|
## 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 `<rewrite>` under `<system.webServer>`:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<rewrite>
|
||||||
|
<rules>
|
||||||
|
<rule name="Main Rule" stopProcessing="true">
|
||||||
|
<match url=".*" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Rewrite" url="index.php" appendQueryString="false" />
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
</rewrite>
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
||||||
|
```
|
||||||
|
|
||||||
|
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 `<mimeMap>` entry, under `<staticContent>` in `<system.webServer>`:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<staticContent>
|
||||||
|
<mimeMap fileExtension=".less" mimeType="text/css" />
|
||||||
|
</staticContent>
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
## Support
|
||||||
|
|
||||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">GitHub repo</a>.
|
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">GitHub repo</a>.
|
||||||
|
@ -6720,11 +6720,15 @@ code {
|
|||||||
}
|
}
|
||||||
.page-header {
|
.page-header {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0px 0 20px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.page-header h1 {
|
.page-header h1 {
|
||||||
margin-top: 0px;
|
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 {
|
pre {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #82becd;
|
background-color: #82becd;
|
||||||
|
@ -6720,11 +6720,15 @@ code {
|
|||||||
}
|
}
|
||||||
.page-header {
|
.page-header {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0px 0 20px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.page-header h1 {
|
.page-header h1 {
|
||||||
margin-top: 0px;
|
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 {
|
pre {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #8acc37;
|
background-color: #8acc37;
|
||||||
|
@ -6720,11 +6720,15 @@ code {
|
|||||||
}
|
}
|
||||||
.page-header {
|
.page-header {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0px 0 20px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.page-header h1 {
|
.page-header h1 {
|
||||||
margin-top: 0px;
|
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 {
|
pre {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #7795b4;
|
background-color: #7795b4;
|
||||||
|
@ -6720,11 +6720,15 @@ code {
|
|||||||
}
|
}
|
||||||
.page-header {
|
.page-header {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0px 0 20px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
.page-header h1 {
|
.page-header h1 {
|
||||||
margin-top: 0px;
|
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 {
|
pre {
|
||||||
border: none;
|
border: none;
|
||||||
background-color: #ecb5a1;
|
background-color: #ecb5a1;
|
||||||
|
@ -191,9 +191,29 @@ Set custom files and entire folders to ignore within your `/docs` folder. For fi
|
|||||||
###Disabling clean URLs
|
###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:
|
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
|
"clean_urls": false
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
###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
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
###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
|
## Running Remotely
|
||||||
|
|
||||||
@ -214,6 +234,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: <a href="http://localhost:8085" target="_blank">http://localhost:8085</a>
|
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: <a href="http://localhost:8085" target="_blank">http://localhost:8085</a>
|
||||||
|
|
||||||
|
## 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 `<rewrite>` under `<system.webServer>`:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<rewrite>
|
||||||
|
<rules>
|
||||||
|
<rule name="Main Rule" stopProcessing="true">
|
||||||
|
<match url=".*" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Rewrite" url="index.php" appendQueryString="false" />
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
</rewrite>
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
||||||
|
```
|
||||||
|
|
||||||
|
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 `<mimeMap>` entry, under `<staticContent>` in `<system.webServer>`:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<staticContent>
|
||||||
|
<mimeMap fileExtension=".less" mimeType="text/css" />
|
||||||
|
</staticContent>
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
## Support
|
||||||
|
|
||||||
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">GitHub repo</a>.
|
If you need help using Daux.io, or have found a bug, please create an issue on the <a href="https://github.com/justinwalsh/daux.io/issues" target="_blank">GitHub repo</a>.
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"tagline": "The Easiest Way To Document Your Project",
|
"tagline": "The Easiest Way To Document Your Project",
|
||||||
"image": "img/app.png",
|
"image": "img/app.png",
|
||||||
"theme": "navy",
|
"theme": "navy",
|
||||||
|
"date_modified": true,
|
||||||
"repo": "justinwalsh/daux.io",
|
"repo": "justinwalsh/daux.io",
|
||||||
"twitter": ["justin_walsh", "todaymade"],
|
"twitter": ["justin_walsh", "todaymade"],
|
||||||
"google_analytics": "UA-12653604-10",
|
"google_analytics": "UA-12653604-10",
|
||||||
|
22
index.php
22
index.php
@ -70,6 +70,8 @@ $tree = get_tree("docs", $base_url);
|
|||||||
$homepage_url = homepage_url($tree);
|
$homepage_url = homepage_url($tree);
|
||||||
$docs_url = docs_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 a timezone has been set in the config file, override the default PHP timezone for this application.
|
||||||
if(isset($options['timezone']))
|
if(isset($options['timezone']))
|
||||||
{
|
{
|
||||||
@ -183,7 +185,7 @@ if ($homepage && $homepage_url !== '/') {
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span10 offset1">
|
<div class="span10 offset1">
|
||||||
<?php echo load_page($tree); ?>
|
<?php echo $page['html'];?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -265,7 +267,23 @@ if ($homepage && $homepage_url !== '/') {
|
|||||||
<div class="right-column <?php echo ($options['float']?'float-view':''); ?> content-area span9">
|
<div class="right-column <?php echo ($options['float']?'float-view':''); ?> content-area span9">
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
<article>
|
<article>
|
||||||
<?php echo load_page($tree); ?>
|
<?php if($options['date_modified'] && isset($page['modified'])) { ?>
|
||||||
|
<div class="page-header sub-header">
|
||||||
|
<h1><?php echo $page['title'];?></h1>
|
||||||
|
<span style="float: left; font-size: 10px; color: gray;">
|
||||||
|
<?php echo date("l, F j, Y", $page['modified']);?>
|
||||||
|
</span>
|
||||||
|
<span style="float: right; font-size: 10px; color: gray;">
|
||||||
|
<?php echo date ("g:i A", $page['modified']);?>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<?php } else { ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h1><?php echo $page['title'];?></h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
<?php echo $page['html'];?>
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -474,10 +474,13 @@ code {
|
|||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0px 0 20px;
|
padding: 0px;
|
||||||
h1 {
|
h1 {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
sub-heading {
|
||||||
|
padding: 0px, 0px, 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pre {
|
pre {
|
||||||
border: none;
|
border: none;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
ini_set('display_errors', 1);
|
// Enable for debugging
|
||||||
error_reporting(E_ALL);
|
// ini_set('display_errors', 1);
|
||||||
|
// error_reporting(E_ALL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* WARNING: DO NOT EDIT THIS FILE.
|
* WARNING: DO NOT EDIT THIS FILE.
|
||||||
@ -34,6 +35,7 @@ function get_options() {
|
|||||||
'tagline' => false,
|
'tagline' => false,
|
||||||
'image' => false,
|
'image' => false,
|
||||||
'theme' => 'blue',
|
'theme' => 'blue',
|
||||||
|
'date_modified' => true,
|
||||||
'float' => true,
|
'float' => true,
|
||||||
'repo' => false,
|
'repo' => false,
|
||||||
'twitter' => array(),
|
'twitter' => array(),
|
||||||
@ -102,28 +104,29 @@ function docs_url($tree, $branch = false) {
|
|||||||
function load_page($tree) {
|
function load_page($tree) {
|
||||||
$branch = find_branch($tree);
|
$branch = find_branch($tree);
|
||||||
|
|
||||||
|
$page = array();
|
||||||
|
|
||||||
if (isset($branch['type']) && $branch['type'] == 'file') {
|
if (isset($branch['type']) && $branch['type'] == 'file') {
|
||||||
$html = '';
|
$html = '';
|
||||||
if ($branch['name'] !== 'index') {
|
if ($branch['name'] !== 'index') {
|
||||||
$html .= '<div class="page-header">';
|
|
||||||
$html .= '<h1>'. $branch['title'] . '</h1>';
|
|
||||||
|
|
||||||
// Show last modified time for docs. Needs to be cleaned up and use template colours.
|
$page['title'] = $branch['title'];
|
||||||
$modified = filemtime($branch['path']);
|
$page['modified'] = filemtime($branch['path']);
|
||||||
$html .= '<span style="float: left; font-size: 10px; color: gray;">';
|
|
||||||
$html .= date ("l, F j, Y", $modified);
|
|
||||||
$html .= '</span><span style="float: right; font-size: 10px; color: gray;">';
|
|
||||||
$html .= date ("g:i A", $modified);
|
|
||||||
$html .= '</span>';
|
|
||||||
|
|
||||||
$html .= '</div>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$html .= MarkdownExtended(file_get_contents($branch['path']));
|
$html .= MarkdownExtended(file_get_contents($branch['path']));
|
||||||
return $html;
|
|
||||||
|
$page['html'] = $html;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "Oh No. That page dosn't exist";
|
|
||||||
|
$page['title'] = "Oh no";
|
||||||
|
$page['html'] = "<h3>Oh No. That page dosn't exist</h3>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
function find_branch($tree) {
|
function find_branch($tree) {
|
||||||
|
Loading…
Reference in New Issue
Block a user