8
0
daux.io/docs/00_Getting_Started.md

470 Zeilen
14 KiB
Markdown

2013-06-12 00:28:29 +02:00
**Daux.io** is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
2013-06-03 15:32:55 +02:00
2013-06-04 19:26:14 +02:00
## Features
2013-06-03 15:32:55 +02:00
* 100% Mobile Responsive
2013-06-04 20:23:01 +02:00
* Supports GitHub Flavored Markdown
2013-06-12 00:28:29 +02:00
* Auto created homepage/landing page
2013-06-04 20:23:01 +02:00
* Auto Syntax Highlighting
2013-06-03 15:57:20 +02:00
* Auto Generated Navigation
2013-06-12 00:28:29 +02:00
* 4 Built-In Themes or roll your own
* Functional, Flat Design Style
2013-06-04 19:26:14 +02:00
* Shareable/Linkable SEO Friendly URLs
2013-06-04 20:23:01 +02:00
* Built On Bootstrap
* No Build Step
2013-06-04 19:26:14 +02:00
* Git/SVN Friendly
2013-07-22 17:38:04 +02:00
* Supports Google Analytics and Piwik Analytics
2013-06-12 00:28:29 +02:00
* Optional code float layout
* Static Output Generation
2015-07-19 16:36:59 +02:00
* Internal documentation links
* Multiple Output Formats
* Extend Daux.io with Processors
2013-06-04 19:26:14 +02:00
2013-06-04 20:23:01 +02:00
## Demos
2013-06-12 00:28:29 +02:00
This is a list of sites using Daux.io:
2013-06-04 20:23:01 +02:00
2013-06-21 18:36:57 +02:00
* [Daux.io](http://daux.io)
* [Gltn - An open-source word processor webapp](http://felkerdigitalmedia.com/gltn/docs/)
* [Invade & Annex 3 - An Arma 3 Co-operative Mission](http://ia3.ahoyworld.co.uk/)
2013-07-29 03:58:19 +02:00
* [Munee: Standalone PHP 5.3 Asset Optimisation & Manipulation](http://mun.ee)
* [ICADMIN: An admin panel powered by CodeIgniter.](http://istocode.com/shared/ic-admin/)
* [TrackJs](http://docs.trackjs.com) (uses a customized theme)
* [wallabag](http://doc.wallabag.org/index)
2013-06-04 20:23:01 +02:00
2013-06-21 17:49:05 +02:00
Do you use Daux.io? Send me a pull request or open an [issue](https://github.com/justinwalsh/daux.io/issues) and I will add you to the list.
2013-06-04 20:23:01 +02:00
2013-06-04 19:26:14 +02:00
## Download
Download this repository as a zip, and unpack. Copy the files to a web server that can run PHP 5.3 or greater. You can also run the documentation locally using Grunt.js, which is covered at the end of this readme.
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
## Generating a set of static files
These can be uploaded to a static site hosting service such as pages.github.com
Generating a complete set of pages, with navigation
```bash
./generate --destination=[Output Directory Relative Direction]
```
For more options, run
```bash
./generate --help
```
## Formats
Daux.io is extendable and comes by default with two export formats:
- Export to HTML
- Upload to your Atlassian Confluence server
## Feature Matrix
<table>
<tr>
<th>Feature</th><th>HTML</th><th>Confluence</th>
</tr>
<tr>
<td>Landing Pages</td><td></td><td>X</td>
</tr>
<tr>
<td>Index Pages</td><td></td><td></td>
</tr>
<tr>
<td>Internal Links</td><td></td><td></td>
</tr>
<tr>
<td>Code Highlight</td><td></td><td>√ (Using macros)</td>
</tr>
<tr>
<td>Live Mode</td><td></td><td>X</td>
</tr>
<tr>
<td>Ordering Pages</td><td></td><td>X (API Limitation)</td>
</tr>
<tr>
<td>Google / Piwik analytics</td><td></td><td>X</td>
</tr>
</table>
2013-06-04 19:26:14 +02:00
## Folders
2013-06-04 20:23:01 +02:00
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.
2013-06-04 19:26:14 +02:00
2013-06-12 00:28:29 +02:00
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.
2013-06-04 19:26:14 +02:00
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 `global.json` file.
2013-06-04 19:26:14 +02:00
## Files
2013-06-04 20:23:01 +02:00
The generator will look for Markdown files (`*.md` and `*.markdown`) inside the `docs` folder and any of the subfolders within `docs`. Additional extensions can be added by editing `global.json`
2013-06-04 19:26:14 +02:00
You must use underscores instead of spaces. Here are some example file names and what they will be converted to:
2013-06-04 19:26:14 +02:00
2013-06-04 20:23:01 +02:00
**Good:**
2013-06-04 19:26:14 +02:00
2013-06-04 20:23:01 +02:00
* 01_Getting_Started.md = Getting Started
* API_Calls.md = API Calls
* 200_Something_Else-Cool.md = Something Else-Cool
* _5_Ways_to_Be_Happy.md = 5 Ways To Be Happy
2013-06-04 20:23:01 +02:00
**Bad:**
* File Name With Space.md = FAIL
2013-06-04 19:26:14 +02:00
## Sorting
2013-06-04 20:23:01 +02:00
To sort your files and folders in a specific way, you can prefix them with a number and underscore, e.g. `/docs/01_Hello_World.md` and `/docs/05_Features.md` This will list *Hello World* before *Features*, overriding the default alpha-numeric sorting. The numbers will be stripped out of the navigation and urls. For the file `6 Ways to Get Rich`, you can use `/docs/_6_Ways_to_Get_Rich.md`
2013-06-04 19:26:14 +02:00
You might also wish to stick certain links to the bottom of a page. You can do so by appending a '-' to the start of the filename, e.g. a new file `/docs/-Contact_Us.md` will always appear at the bottom of the current list. Weights can also be added to further sort the bottom entries. e.g. `/docs/-01_Coming.md` will appear before `/docs/-02_Soon.md` but both will only appear after all positive or non-weighted files.
2013-06-21 21:09:37 +02:00
## Landing page
2015-07-19 16:36:59 +02:00
If you want to create a beautiful landing page for your project, create a `_index.md` file in the root of the `/docs` folder. This file will then be used to create a landing page. You can also add a tagline and image to this page using the config file like this:
2013-06-21 21:09:37 +02:00
2013-07-29 03:58:19 +02:00
```json
{
"title": "Daux.io",
"tagline": "The Easiest Way To Document Your Project",
"image": "app.png"
2013-07-29 03:58:19 +02:00
}
```
2013-06-21 21:09:37 +02:00
2015-07-19 16:36:59 +02:00
Note: The image can be a local or remote image. By default, the path is relative to the root of the documentation
## Section Index page
2013-06-21 21:09:37 +02:00
2015-07-19 16:36:59 +02:00
By default, a folder will have no index page. if you wish to have one defined all you need to do is add an `index.md` file to the folder. For example, `/docs/01_Examples` has a landing page for that section since there exists a `/docs/01_Examples/index.md` file.
2015-07-19 16:36:59 +02:00
## Internal links
2015-07-19 16:36:59 +02:00
You can create links from a page to an other, the link is then resolved to the real page.
2015-07-19 16:36:59 +02:00
Creating a link to another page is done exactly like a normal markdown link. In the url part, start with `!` and set the absolute path to the file, omitting the numbering and file extension
A link to `01_Examples/05_Code_Highlighting.md` Would be written like this: `[Code Highlight Examples](!Examples/Code_Highlighting)`
The page generation will fail if a link is wrong.
## Configuration
To customize the look and feel of your documentation, you can create a `config.json` file in the of the `/docs` folder. The `config.json` file is a JSON object that you can use to change some of the basic settings of the documentation.
### Title
Change the title bar in the docs
```json
{
2015-07-19 16:36:59 +02:00
"title": "Daux.io"
}
```
2015-07-19 16:36:59 +02:00
### Tagline
Change the tagline bar in the docs
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
```json
{
"tagline": "The Easiest Way To Document Your Project"
}
```
2013-06-04 20:23:01 +02:00
2015-07-19 16:36:59 +02:00
### Author
Change the documentation's author
2013-06-04 19:26:14 +02:00
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"author": "Stéphane Goetz"
2013-07-29 03:58:19 +02:00
}
```
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
### Ignore
Set custom files and entire folders to ignore within your `/docs` folder. For files make sure to include the file extension in the name. For both files and folders, names are case-sensitive.
```json
{
"ignore": {
"files": ["Work_In_Progress.md"],
"folders": ["99_Not_Ready"]
}
}
```
### 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"
}
```
### Multi-language
Enables multi-language support which needs seperate directories for each language in `docs/` folder.
```json
{
"languages": { "en": "English", "de": "German" }
}
```
Directory structure:
```
├── docs/
│ ├── _index.md
│ ├── en
│ │ ├── 00_Getting_Started.md
│ │ ├── 01_Examples
│ │ │ ├── 01_GitHub_Flavored_Markdown.md
│ │ │ ├── 05_Code_Highlighting.md
│ │ ├── 05_More_Examples
│ │ │ ├── Hello_World.md
│ │ │ ├── 05_Code_Highlighting.md
│ ├── de
│ │ ├── 00_Getting_Started.md
│ │ ├── 01_Examples
│ │ │ ├── 01_GitHub_Flavored_Markdown.md
│ │ │ ├── 05_Code_Highlighting.md
│ │ ├── 05_More_Examples
│ │ │ ├── Hello_World.md
│ │ │ ├── 05_Code_Highlighting.md
```
### HTML Export Configuration
#### Themes
2013-06-12 00:28:29 +02:00
We have 4 built-in Bootstrap themes. To use one of the themes, just set the `theme` option to one of the following:
2013-06-04 19:26:14 +02:00
* daux-blue
* daux-green
* daux-navy
* daux-red
2013-06-04 19:26:14 +02:00
2013-07-29 03:58:19 +02:00
```json
2013-06-12 00:28:29 +02:00
{
2015-07-19 16:36:59 +02:00
"html": { "theme": "daux-blue" }
2013-06-12 00:28:29 +02:00
}
```
2015-07-19 16:36:59 +02:00
#### Custom Theme
2015-04-27 23:17:44 +02:00
To use a custom theme, just copy over the theme folder into the `themes` directory and set its value in the `theme` param in config.json
2013-06-04 19:26:14 +02:00
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "theme": "new-theme" }
2013-07-29 03:58:19 +02:00
}
```
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
#### Code Floating
By default your code blocks will be floated to a column on the right side of your content. To disable this feature, set the `float` property to `false`.
2013-06-04 19:26:14 +02:00
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "float": false }
2013-07-29 03:58:19 +02:00
}
```
2015-07-19 16:36:59 +02:00
#### Toggling Code Blocks
Some users might wish to hide the code blocks & view just the documentation. By setting the `toggle_code` property to `true`, you can offer a toggle button on the page.
```json
{
2015-07-19 16:36:59 +02:00
"html": { "toggle_code": true }
}
```
2013-06-04 19:26:14 +02:00
2013-06-12 00:28:29 +02:00
2015-07-19 16:36:59 +02:00
#### GitHub Repo
2013-07-17 18:54:08 +02:00
Add a 'Fork me on GitHub' ribbon.
2013-06-04 19:26:14 +02:00
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "repo": "justinwalsh/daux.io" }
2013-07-29 03:58:19 +02:00
}
```
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
#### Twitter
2013-06-04 19:26:14 +02:00
Include twitter follow buttons in the sidebar.
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "twitter": ["justin_walsh", "todaymade"] }
2013-07-29 03:58:19 +02:00
}
```
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
#### Links
2013-06-04 19:26:14 +02:00
Include custom links in the sidebar.
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": {
"links": {
"GitHub Repo": "https://github.com/justinwalsh/daux.io",
"Help/Support/Bugs": "https://github.com/justinwalsh/daux.io/issues",
"Made by Todaymade": "http://todaymade.com"
}
2013-06-04 19:26:14 +02:00
}
2013-07-29 03:58:19 +02:00
}
```
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
#### Google Analytics
2013-06-21 21:36:50 +02:00
This will embed the google analytics tracking code.
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "google_analytics": "UA-XXXXXXXXX-XX" }
2013-07-29 03:58:19 +02:00
}
```
2013-06-21 21:36:50 +02:00
2015-07-19 16:36:59 +02:00
#### Piwik Analytics
2013-07-22 17:38:04 +02:00
This will embed the piwik tracking code.
2013-07-29 03:58:19 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": { "piwik_analytics": "my-url-for-piwik.com" }
2013-07-29 03:58:19 +02:00
}
```
2013-07-22 17:38:04 +02:00
2013-10-22 22:50:46 +02:00
You can Also give a specific Piwik ID as well.
```json
{
2015-07-19 16:36:59 +02:00
"html": { "piwik_analytics_id": "43" }
2013-10-22 22:50:46 +02:00
}
```
2015-07-19 16:36:59 +02:00
#### Breadcrumb titles
Daux.io provides the option to present page titles as breadcrumb navigation. You can *optionally* specify the separator used for breadcrumbs.
2014-05-31 07:43:07 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"html": {
"breadcrumbs": true,
"breadcrumb_separator" : " > "
2015-07-19 16:36:59 +02:00
}
2014-05-31 07:43:07 +02:00
}
```
2015-07-19 16:36:59 +02:00
#### Date Modified
2013-07-29 20:54:45 +02:00
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
{
2015-07-19 16:36:59 +02:00
"html": { "date_modified": false }
}
2013-07-29 20:54:45 +02:00
```
2015-07-19 16:36:59 +02:00
### Confluence Upload Configuration
#### Configuring the connection
The connection requires three parameters `base_url`, `user` and `pass`. While `user` and `pass` don't really need an explanation, for `base_url` you need to set the path to the server without `rest/api`, this will be added automatically.
2013-07-29 20:58:04 +02:00
```json
{
2015-07-19 16:36:59 +02:00
"confluence": {
"base_url": "http://my_confluence_server.com/,
"user" : "my_username",
"pass" : "my_password",
}
2013-07-29 20:58:04 +02:00
}
```
2015-07-19 16:36:59 +02:00
#### Where to upload
Now that the connection is defined, you need to tell it where you want your documentation to be uploaded.
For that you need a `space_id` (name that appears at the beginning of the urls) and an `ancestor_id`; the id of the page that will be the parent of the documentation's homepage.
You can obtain the `ancestor_id` id by editing the page you want to define as a parent: the ID is at the end of the URL
```json
{
2015-07-19 16:36:59 +02:00
"confluence": {
"space_id": "my_space",
"ancestor_id": 50370632
}
}
```
2015-07-19 16:36:59 +02:00
#### Prefix
Because confluence can't have two pages with the same name in a space, I recommend you define a prefix for your pages.
```json
{
"confluence": { "prefix": "[DAUX]" }
}
```
2015-07-19 16:36:59 +02:00
## Live mode
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
Keep in mind, this mode can be used for production, but it is not recommended.
2015-07-19 16:36:59 +02:00
The whole directory must be scanned on each request. This might not make a big impact on small documentations but can be a bottleneck on bigger ones.
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
### Running Locally
2013-06-04 20:23:01 +02:00
2015-07-19 16:36:59 +02:00
There are several ways to run the docs locally. You can use something like <a href="http://www.mamp.info/en/index.html" target="_blank">MAMP</a> or <a href="http://www.wampserver.com/en/" target="_blank">WAMP</a>.
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
The easiest is to use PHP 5.4's built-in server.
2013-06-04 19:26:14 +02:00
2015-07-19 16:36:59 +02:00
For that i've included a short command, run `./serve` 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>
2015-07-19 16:36:59 +02:00
### Running Remotely
2015-07-19 16:36:59 +02:00
Copy the files from the repo to a web server that can run PHP 5.3 or greater.
There is an included `.htaccess` for Apache web server.
### Clean URLs configuration
Daux provides native support for Clean URLs provided the webserver has its URL Rewrite module enabled. To enable the same, set the toggle in the `config.json` file in the `/docs` folder.
```json
{
"live": {
"clean_urls": true
}
}
```
2015-07-19 16:36:59 +02:00
### Running on IIS
2013-07-30 15:56:16 +02:00
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.
2015-07-19 16:36:59 +02:00
#### Clean URLs
2013-07-30 15:56:16 +02:00
The `web.config` needs an entry for `<rewrite>` under `<system.webServer>`:
```xml
<configuration>
2013-07-30 15:56:16 +02:00
<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/).
2013-06-04 20:23:01 +02:00
## Support
2013-06-04 19:26:14 +02:00
2013-07-17 18:54:08 +02:00
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>.