From 6b041596fb5844dbd9cb843872db35a7ba5422eb Mon Sep 17 00:00:00 2001 From: Paul Stanton Date: Thu, 22 Aug 2013 10:01:59 +0100 Subject: [PATCH 1/4] Allow docs path to be configured in config.json This helps when integrating daux.io within a larger project using Bower where we want to keep our docs outside of the daux.io directory and want to keep our filepath changes isolated to the config file rather than modifying index.php. --- docs/config.json | 1 + index.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/config.json b/docs/config.json index 3dbd75c..c4da54e 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1,6 +1,7 @@ { "title": "DAUX.IO", "tagline": "The Easiest Way To Document Your Project", + "docs_path": "docs", "image": "img/app.png", "theme": "navy", "date_modified": true, diff --git a/index.php b/index.php index d556bc0..0857fce 100644 --- a/index.php +++ b/index.php @@ -66,7 +66,7 @@ software, even if advised of the possibility of such damage. require_once('libs/functions.php'); $options = get_options(); -$tree = get_tree("docs", $base_url); +$tree = get_tree($options['docs_path'], $base_url); $homepage_url = homepage_url($tree); $docs_url = docs_url($tree); From fd86353ab3d9113d2d8b40125844ee5cfe7277af Mon Sep 17 00:00:00 2001 From: Paul Stanton Date: Thu, 22 Aug 2013 22:26:07 +0100 Subject: [PATCH 2/4] Document the ability to supply a custom docs path --- README.md | 15 ++++++++++++++- docs/00_Getting_Started.md | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7830cd..61a6b7a 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,12 @@ Download this repository as a zip, and unpack. Copy the files to a web server th ## Folders -The generator will look for folders in the `/docs` folder. Add your folders inside the `/docs` folder. This project contains some example folders and files to get you started. +By default, the generator will look for folders in the `/docs` folder. Add your folders inside the `/docs` folder. This project contains some example folders and files to get you started. You can nest folders any number of levels to get the exact structure you want. The folder structure will be converted to the nested navigation. +If you'd prefer to keep your docs somewhere else (like outside of the daux.io root directory) you can specify your docs path in the `config.json` file. + ## Files The generator will look for Markdown `*.md` files inside the `/docs` folder and any of the subfolders within /docs. @@ -82,6 +84,17 @@ Change the title bar in the docs } ``` +###Docs Path: +If you'd prefer to keep your docs outside of the Daux.io directory, you can provide the filepath. + +Note: Your `config.json` file will need to remain in `/daux.io/docs`. + +```json +{ + "docs_path": "../../my_docs" +} +``` + ###Themes: We have 4 built-in Bootstrap themes. To use one of the themes, just set the `theme` option to one of the following: diff --git a/docs/00_Getting_Started.md b/docs/00_Getting_Started.md index e7830cd..d250122 100644 --- a/docs/00_Getting_Started.md +++ b/docs/00_Getting_Started.md @@ -31,10 +31,12 @@ Download this repository as a zip, and unpack. Copy the files to a web server th ## Folders -The generator will look for folders in the `/docs` folder. Add your folders inside the `/docs` folder. This project contains some example folders and files to get you started. +By default, the generator will look for folders in the `/docs` folder. Add your folders inside the `/docs` folder. This project contains some example folders and files to get you started. You can nest folders any number of levels to get the exact structure you want. The folder structure will be converted to the nested navigation. +If you'd prefer to keep your docs somewhere else (like outside of the daux.io root directory) you can specify your docs path in the `config.json` file. + ## Files The generator will look for Markdown `*.md` files inside the `/docs` folder and any of the subfolders within /docs. @@ -82,6 +84,17 @@ Change the title bar in the docs } ``` +###Docs Path: +If you'd prefer to keep your docs outside of the Daux.io directory, you can provide the filepath. + +Note: Your `config.json` file will need to remain in `/daux.io/docs`. + +```json +{ + "docs_path": "../../my_docs" +} +``` + ###Themes: We have 4 built-in Bootstrap themes. To use one of the themes, just set the `theme` option to one of the following: From 65137c02b24aee3af89a3e3324fe9962af212771 Mon Sep 17 00:00:00 2001 From: telchina Date: Tue, 10 Sep 2013 11:15:46 +0800 Subject: [PATCH 3/4] fixed issue of chinese document name --- libs/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/functions.php b/libs/functions.php index 4fd6849..545e61d 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -158,7 +158,7 @@ function url_path() { } function url_params() { - $url = get_uri(); + $url = rawurldecode(get_uri()); $params = explode('/', trim($url, '/')); return $params; } From c5f112323a2247bdb53f7468b6ec51ad884ec71b Mon Sep 17 00:00:00 2001 From: "R.M" Date: Thu, 3 Oct 2013 19:30:27 +0400 Subject: [PATCH 4/4] Support for cyrillic URLs --- libs/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/functions.php b/libs/functions.php index dea441e..69e25a0 100644 --- a/libs/functions.php +++ b/libs/functions.php @@ -132,6 +132,10 @@ function load_page($tree) { function find_branch($tree) { $path = url_params(); foreach($path as $peice) { + + // Support for cyrillic URLs + $peice = urldecode($peice); + // Check for homepage if (empty($peice)) { $peice = 'index';