From 1127cc600e440dc8dd7c5d61901abbfcbaad00d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Goetz?= Date: Thu, 5 May 2016 23:43:37 +0200 Subject: [PATCH] Improve readability of the theme, fixes #363 --- .gitignore | 2 +- docs/01_Features/Auto_Syntax_Highlight.md | 20 +- docs/01_Features/Landing_page.md | 10 +- docs/01_Features/Live_mode.md | 14 +- docs/01_Features/Search.md | 4 +- docs/01_Features/Table_of_contents.md | 4 +- docs/05_Configuration/Confluence_upload.md | 16 +- docs/05_Configuration/Html_export.md | 36 +-- docs/05_Configuration/_index.md | 20 +- .../10_For_Developers/Creating_a_Processor.md | 40 +-- docs/10_For_Developers/Creating_a_Theme.md | 4 +- gulpfile.js | 43 ++- package.json | 31 +- templates/home.php | 2 +- templates/layout/05_page.php | 2 +- themes/common/less/_typography.less | 187 +++++++++++ themes/daux/css/theme-blue.min.css | 2 +- themes/daux/css/theme-green.min.css | 2 +- themes/daux/css/theme-navy.min.css | 2 +- themes/daux/css/theme-red.min.css | 2 +- .../{components.less => _components.less} | 208 ++---------- .../daux/less/{mixins.less => _mixins.less} | 0 .../less/{structure.less => _structure.less} | 172 +++------- themes/daux/less/_typography.less | 161 ++++++++++ themes/daux/less/highlight.less | 135 -------- themes/daux/less/theme-base.less | 9 +- themes/daux/less/theme-blue.less | 25 +- themes/daux/less/theme-green.less | 25 +- themes/daux/less/theme-navy.less | 25 +- themes/daux/less/theme-red.less | 25 +- themes/daux/less/theme.less | 6 +- .../less/{ => vendor}/bootstrap/alerts.less | 0 .../less/{ => vendor}/bootstrap/badges.less | 0 .../{ => vendor}/bootstrap/bootstrap.less | 0 .../{ => vendor}/bootstrap/breadcrumbs.less | 0 .../{ => vendor}/bootstrap/button-groups.less | 0 .../less/{ => vendor}/bootstrap/buttons.less | 0 .../less/{ => vendor}/bootstrap/carousel.less | 0 .../less/{ => vendor}/bootstrap/close.less | 0 .../less/{ => vendor}/bootstrap/code.less | 0 .../bootstrap/component-animations.less | 0 .../{ => vendor}/bootstrap/dropdowns.less | 0 .../less/{ => vendor}/bootstrap/forms.less | 0 .../{ => vendor}/bootstrap/glyphicons.less | 0 .../less/{ => vendor}/bootstrap/grid.less | 0 .../{ => vendor}/bootstrap/input-groups.less | 0 .../{ => vendor}/bootstrap/jumbotron.less | 0 .../less/{ => vendor}/bootstrap/labels.less | 0 .../{ => vendor}/bootstrap/list-group.less | 0 .../less/{ => vendor}/bootstrap/media.less | 0 .../less/{ => vendor}/bootstrap/mixins.less | 0 .../{ => vendor}/bootstrap/mixins/alerts.less | 0 .../bootstrap/mixins/background-variant.less | 0 .../bootstrap/mixins/border-radius.less | 0 .../bootstrap/mixins/buttons.less | 0 .../bootstrap/mixins/center-block.less | 0 .../bootstrap/mixins/clearfix.less | 0 .../{ => vendor}/bootstrap/mixins/forms.less | 0 .../bootstrap/mixins/gradients.less | 0 .../bootstrap/mixins/grid-framework.less | 0 .../{ => vendor}/bootstrap/mixins/grid.less | 0 .../bootstrap/mixins/hide-text.less | 0 .../{ => vendor}/bootstrap/mixins/image.less | 0 .../{ => vendor}/bootstrap/mixins/labels.less | 0 .../bootstrap/mixins/list-group.less | 0 .../bootstrap/mixins/nav-divider.less | 0 .../bootstrap/mixins/nav-vertical-align.less | 0 .../bootstrap/mixins/opacity.less | 0 .../bootstrap/mixins/pagination.less | 0 .../{ => vendor}/bootstrap/mixins/panels.less | 0 .../bootstrap/mixins/progress-bar.less | 0 .../bootstrap/mixins/reset-filter.less | 0 .../bootstrap/mixins/reset-text.less | 0 .../{ => vendor}/bootstrap/mixins/resize.less | 0 .../mixins/responsive-visibility.less | 0 .../{ => vendor}/bootstrap/mixins/size.less | 0 .../bootstrap/mixins/tab-focus.less | 0 .../bootstrap/mixins/table-row.less | 0 .../bootstrap/mixins/text-emphasis.less | 0 .../bootstrap/mixins/text-overflow.less | 0 .../bootstrap/mixins/vendor-prefixes.less | 0 .../less/{ => vendor}/bootstrap/modals.less | 0 .../less/{ => vendor}/bootstrap/navbar.less | 0 .../less/{ => vendor}/bootstrap/navs.less | 0 .../{ => vendor}/bootstrap/normalize.less | 0 .../less/{ => vendor}/bootstrap/pager.less | 0 .../{ => vendor}/bootstrap/pagination.less | 0 .../less/{ => vendor}/bootstrap/panels.less | 0 .../less/{ => vendor}/bootstrap/popovers.less | 0 .../less/{ => vendor}/bootstrap/print.less | 0 .../{ => vendor}/bootstrap/progress-bars.less | 0 .../bootstrap/responsive-embed.less | 0 .../bootstrap/responsive-utilities.less | 0 .../{ => vendor}/bootstrap/scaffolding.less | 0 .../less/{ => vendor}/bootstrap/tables.less | 0 .../less/{ => vendor}/bootstrap/theme.less | 0 .../{ => vendor}/bootstrap/thumbnails.less | 0 .../less/{ => vendor}/bootstrap/tooltip.less | 0 .../less/{ => vendor}/bootstrap/type.less | 0 .../{ => vendor}/bootstrap/utilities.less | 0 .../{ => vendor}/bootstrap/variables.less | 0 .../less/{ => vendor}/bootstrap/wells.less | 0 themes/daux/less/vendor/highlight.less | 64 ++++ themes/daux_singlepage/css/main.min.css | 2 +- .../daux_singlepage/less/book/markdown.less | 303 ------------------ themes/daux_singlepage/less/fonts.less | 99 +++--- themes/daux_singlepage/less/main.less | 25 +- themes/daux_singlepage/less/print.less | 19 +- themes/daux_singlepage/less/typography.less | 6 + themes/daux_singlepage/less/variables.less | 4 +- .../bootstrap/normalize.less | 0 .../bootstrap/scaffolding.less | 0 .../{vendors => vendor}/bootstrap/type.less | 0 .../bootstrap/variables.less | 0 .../less/{ => vendor}/highlight.less | 0 115 files changed, 765 insertions(+), 991 deletions(-) create mode 100644 themes/common/less/_typography.less rename themes/daux/less/{components.less => _components.less} (50%) rename themes/daux/less/{mixins.less => _mixins.less} (100%) rename themes/daux/less/{structure.less => _structure.less} (54%) create mode 100644 themes/daux/less/_typography.less delete mode 100644 themes/daux/less/highlight.less rename themes/daux/less/{ => vendor}/bootstrap/alerts.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/badges.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/bootstrap.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/breadcrumbs.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/button-groups.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/buttons.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/carousel.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/close.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/code.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/component-animations.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/dropdowns.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/forms.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/glyphicons.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/grid.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/input-groups.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/jumbotron.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/labels.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/list-group.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/media.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/alerts.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/background-variant.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/border-radius.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/buttons.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/center-block.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/clearfix.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/forms.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/gradients.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/grid-framework.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/grid.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/hide-text.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/image.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/labels.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/list-group.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/nav-divider.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/nav-vertical-align.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/opacity.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/pagination.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/panels.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/progress-bar.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/reset-filter.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/reset-text.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/resize.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/responsive-visibility.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/size.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/tab-focus.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/table-row.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/text-emphasis.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/text-overflow.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/mixins/vendor-prefixes.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/modals.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/navbar.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/navs.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/normalize.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/pager.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/pagination.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/panels.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/popovers.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/print.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/progress-bars.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/responsive-embed.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/responsive-utilities.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/scaffolding.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/tables.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/theme.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/thumbnails.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/tooltip.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/type.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/utilities.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/variables.less (100%) rename themes/daux/less/{ => vendor}/bootstrap/wells.less (100%) create mode 100644 themes/daux/less/vendor/highlight.less delete mode 100755 themes/daux_singlepage/less/book/markdown.less create mode 100755 themes/daux_singlepage/less/typography.less rename themes/daux_singlepage/less/{vendors => vendor}/bootstrap/normalize.less (100%) mode change 100755 => 100644 rename themes/daux_singlepage/less/{vendors => vendor}/bootstrap/scaffolding.less (100%) mode change 100755 => 100644 rename themes/daux_singlepage/less/{vendors => vendor}/bootstrap/type.less (100%) mode change 100755 => 100644 rename themes/daux_singlepage/less/{vendors => vendor}/bootstrap/variables.less (100%) mode change 100755 => 100644 rename themes/daux_singlepage/less/{ => vendor}/highlight.less (100%) mode change 100755 => 100644 diff --git a/.gitignore b/.gitignore index 329fbcd..01a12a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ node_modules /sftp-config.json static -vendor +/vendor diff --git a/docs/01_Features/Auto_Syntax_Highlight.md b/docs/01_Features/Auto_Syntax_Highlight.md index d014849..030df79 100644 --- a/docs/01_Features/Auto_Syntax_Highlight.md +++ b/docs/01_Features/Auto_Syntax_Highlight.md @@ -4,18 +4,18 @@ Here is a quick example : **HTML (with inline css and javascript)** - - Title + + Title - + - + - -

Title

- - + +

Title

+ + [See the full list of supported languages in Daux.io](!Examples/Code_Highlighting) diff --git a/docs/01_Features/Landing_page.md b/docs/01_Features/Landing_page.md index 78933d6..ba37806 100644 --- a/docs/01_Features/Landing_page.md +++ b/docs/01_Features/Landing_page.md @@ -2,9 +2,9 @@ If you want to create a beautiful landing page for your project, create a `_inde ```json { - "title": "Daux.io", - "tagline": "The Easiest Way To Document Your Project", - "image": "app.png" + "title": "Daux.io", + "tagline": "The Easiest Way To Document Your Project", + "image": "app.png" } ``` @@ -14,8 +14,8 @@ To disable the automatic landing page, you can set `auto_landing` to false in th ```json { - "html": { - "auto_landing": false + "html": { + "auto_landing": false } } ``` diff --git a/docs/01_Features/Live_mode.md b/docs/01_Features/Live_mode.md index 3c7805e..493dc15 100644 --- a/docs/01_Features/Live_mode.md +++ b/docs/01_Features/Live_mode.md @@ -2,7 +2,7 @@ Keep in mind, this mode can be used for production, but it is not recommended. 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. -### Running Locally +## Running Locally There are several ways to run the docs locally. You can use something like MAMP or WAMP. @@ -11,9 +11,9 @@ The easiest is to use PHP 5.4's built-in server. 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: http://localhost:8085 -### Running Remotely +## Running Remotely -#### Clean URLs configuration +### 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. @@ -26,13 +26,13 @@ To enable the same, set the toggle in the `config.json` file in the `/docs` fold } ``` -#### Apache +### Apache 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. -#### Nginx +### Nginx Daux.io works perfectly fine on Nginx too, just drop this configuration in your `nginx.conf` @@ -66,14 +66,14 @@ server { } ``` -### IIS +## 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 +### Clean URLs The `web.config` needs an entry for `` under ``: diff --git a/docs/01_Features/Search.md b/docs/01_Features/Search.md index 5fb99e3..27428af 100644 --- a/docs/01_Features/Search.md +++ b/docs/01_Features/Search.md @@ -6,8 +6,8 @@ To enable the generated search, you can set `search` to true in the `html` secti ```json { - "html": { - "search": true + "html": { + "search": true } } ``` diff --git a/docs/01_Features/Table_of_contents.md b/docs/01_Features/Table_of_contents.md index 3136058..4a80a07 100644 --- a/docs/01_Features/Table_of_contents.md +++ b/docs/01_Features/Table_of_contents.md @@ -18,8 +18,8 @@ You can enable this feature in your configuration ```json { - "html": { - "auto_toc": true + "html": { + "auto_toc": true } } ``` diff --git a/docs/05_Configuration/Confluence_upload.md b/docs/05_Configuration/Confluence_upload.md index f474113..dd36c16 100644 --- a/docs/05_Configuration/Confluence_upload.md +++ b/docs/05_Configuration/Confluence_upload.md @@ -4,9 +4,9 @@ The connection requires three parameters `base_url`, `user` and `pass`. While `u ```json { "confluence": { - "base_url": "http://my_confluence_server.com/, - "user" : "my_username", - "pass" : "my_password", + "base_url": "http://my_confluence_server.com/", + "user" : "my_username", + "pass" : "my_password", } } ``` @@ -36,7 +36,7 @@ Because confluence can't have two pages with the same name in a space, I recomme ```json { - "confluence": { "prefix": "[DAUX]" } + "confluence": { "prefix": "[DAUX]" } } ``` @@ -45,7 +45,7 @@ To make the upload quicker, we try to determine if a page changed or not, first ```json { - "confluence": { "update_threshold": 1 } + "confluence": { "update_threshold": 1 } } ``` @@ -63,7 +63,7 @@ By default, it will inform you that some pages aren't needed anymore and you can ```json { - "confluence": { "delete": true } + "confluence": { "delete": true } } ``` @@ -79,7 +79,9 @@ You can add a text in a "information" macro on top of the document by setting th ```json { - "confluence": { "header": "These pages are updated automatically, your changes will be overriden." } + "confluence": { + "header": "These pages are updated automatically, your changes will be overriden." + } } ``` diff --git a/docs/05_Configuration/Html_export.md b/docs/05_Configuration/Html_export.md index 275416e..f76db59 100644 --- a/docs/05_Configuration/Html_export.md +++ b/docs/05_Configuration/Html_export.md @@ -17,7 +17,7 @@ To use a custom theme, just copy over the theme folder into the `themes` directo ```json { - "html": { "theme": "new-theme" } + "html": { "theme": "new-theme" } } ``` @@ -26,7 +26,7 @@ By default your code blocks will be floated to a column on the right side of you ```json { - "html": { "float": false } + "html": { "float": false } } ``` @@ -35,7 +35,7 @@ Some users might wish to hide the code blocks & view just the documentation. By ```json { - "html": { "toggle_code": true } + "html": { "toggle_code": true } } ``` @@ -45,7 +45,7 @@ Add a 'Fork me on GitHub' ribbon. ```json { - "html": { "repo": "justinwalsh/daux.io" } + "html": { "repo": "justinwalsh/daux.io" } } ``` @@ -54,7 +54,7 @@ Include twitter follow buttons in the sidebar. ```json { - "html": { "twitter": ["justin_walsh", "todaymade"] } + "html": { "twitter": ["justin_walsh", "todaymade"] } } ``` @@ -63,13 +63,13 @@ Include custom links in the sidebar. ```json { - "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" - } - } + "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" + } + } } ``` @@ -78,7 +78,7 @@ This will embed the google analytics tracking code. ```json { - "html": { "google_analytics": "UA-XXXXXXXXX-XX" } + "html": { "google_analytics": "UA-XXXXXXXXX-XX" } } ``` @@ -87,7 +87,7 @@ This will embed the piwik tracking code. ```json { - "html": { "piwik_analytics": "my-url-for-piwik.com" } + "html": { "piwik_analytics": "my-url-for-piwik.com" } } ``` @@ -95,7 +95,7 @@ You can Also give a specific Piwik ID as well. ```json { - "html": { "piwik_analytics_id": "43" } + "html": { "piwik_analytics_id": "43" } } ``` @@ -105,8 +105,8 @@ Daux.io provides the option to present page titles as breadcrumb navigation. You ```json { "html": { - "breadcrumbs": true, - "breadcrumb_separator" : " > " + "breadcrumbs": true, + "breadcrumb_separator" : " > " } } ``` @@ -116,6 +116,6 @@ By default, daux.io will display the last modified time as reported by the syste ```json { - "html": { "date_modified": false } + "html": { "date_modified": false } } ``` diff --git a/docs/05_Configuration/_index.md b/docs/05_Configuration/_index.md index b0df0ad..8b37523 100644 --- a/docs/05_Configuration/_index.md +++ b/docs/05_Configuration/_index.md @@ -5,7 +5,7 @@ Change the title bar in the docs ```json { - "title": "Daux.io" + "title": "Daux.io" } ``` @@ -14,7 +14,7 @@ Change the tagline bar in the docs ```json { - "tagline": "The Easiest Way To Document Your Project" + "tagline": "The Easiest Way To Document Your Project" } ``` @@ -23,7 +23,7 @@ Change the documentation's author ```json { - "author": "Stéphane Goetz" + "author": "Stéphane Goetz" } ``` @@ -31,12 +31,12 @@ Change the documentation's author 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"] - } - } + { + "ignore": { + "files": ["Work_In_Progress.md"], + "folders": ["99_Not_Ready"] + } + } ``` ### Timezone @@ -85,7 +85,7 @@ be read by the integrated web server. And you set the other formats (like conflu ```json { - "format": "html" + "format": "html" } ``` diff --git a/docs/10_For_Developers/Creating_a_Processor.md b/docs/10_For_Developers/Creating_a_Processor.md index 19ed4b6..409bb16 100644 --- a/docs/10_For_Developers/Creating_a_Processor.md +++ b/docs/10_For_Developers/Creating_a_Processor.md @@ -15,11 +15,11 @@ By default, we created a `daux/Processor.php` file to get you started. For the example we're just going to dump the tree and exit. ```php - public function manipulateTree(Root $root) - { - print_r($root->dump()); - exit; - } +public function manipulateTree(Root $root) +{ + print_r($root->dump()); + exit; +} ``` also, add this at the beginning of the file: @@ -43,21 +43,21 @@ By default, Daux.io parses your directory to find pages. but, for a reason or an This can be done with: ```php - public function manipulateTree(Root $root) - { - } +public function manipulateTree(Root $root) +{ +} ``` Two helpers from the class `Todaymade\Daux\Tree\Builder` will greatly help you doing that: ```php - $new = Builder::getOrCreateDir($root, 'New Pages'); +$new = Builder::getOrCreateDir($root, 'New Pages'); - $page = Builder::getOrCreatePage($new, 'index'); - $page->setContent('The index page for the new folder'); +$page = Builder::getOrCreatePage($new, 'index'); +$page->setContent('The index page for the new folder'); - $page = Builder::getOrCreatePage($new, 'A New Hope'); - $page->setContent('A long time ago in a galaxy far away'); +$page = Builder::getOrCreatePage($new, 'A New Hope'); +$page->setContent('A long time ago in a galaxy far away'); ``` Both methods `getOrCreateDir` and `getOrCreatePage` take two parameters : `parent` and `title` @@ -73,9 +73,9 @@ If the extension is not mapped to a Generator, it will simply create the file as You can extend the Markdown Parser in any way wou want with this method. ```php - public function extendCommonMarkEnvironment(Environment $environment) - { - } +public function extendCommonMarkEnvironment(Environment $environment) +{ +} ``` See the details on [CommonMark's website](http://commonmark.thephpleague.com/customization/overview/). @@ -87,9 +87,9 @@ You can add new generators to Daux.io and use them right away, they must impleme you have to implement `\Todaymade\Daux\Format\Base\LiveGenerator`. ```php - public function addGenerators() - { - return ['custom_generator' => '\Todaymade\Daux\Extension\MyNewGenerator']; - } +public function addGenerators() +{ + return ['custom_generator' => '\Todaymade\Daux\Extension\MyNewGenerator']; +} ``` diff --git a/docs/10_For_Developers/Creating_a_Theme.md b/docs/10_For_Developers/Creating_a_Theme.md index d560403..69c0bad 100644 --- a/docs/10_For_Developers/Creating_a_Theme.md +++ b/docs/10_For_Developers/Creating_a_Theme.md @@ -63,8 +63,8 @@ Change the `theme` option inside `html` ```json { - "html": { - "theme": "{theme}-{variant}" + "html": { + "theme": "{theme}-{variant}" } } ``` diff --git a/gulpfile.js b/gulpfile.js index 89401c8..6e8e15a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,7 +4,8 @@ var gulp = require('gulp'), less = require('gulp-less'), rename = require('gulp-rename'), plumber = require('gulp-plumber'), - postcss = require('gulp-postcss'); + postcss = require('gulp-postcss'), + sourcemaps = require('gulp-sourcemaps'); var resources = { daux:{source: "themes/daux/less/theme.less", dest: "themes/daux/css/"}, @@ -140,6 +141,7 @@ function createTask(source, dest) { }; return gulp.src(source) + //.pipe(sourcemaps.init()) .pipe(plumber()) .pipe(less()) .pipe(postcss([ @@ -147,11 +149,45 @@ function createTask(source, dest) { require('cssnano')(nano_options) ])) .pipe(rename({suffix: '.min'})) + //.pipe(sourcemaps.write()) .pipe(gulp.dest(dest)); } } +function createLinter() { + var gulpStylelint = require('gulp-stylelint'); + + var rules = { + "indentation": 4, + "selector-list-comma-newline-after": "always-multi-line", + "selector-no-id": true, + + // Autoprefixer + "at-rule-no-vendor-prefix": true, + "media-feature-name-no-vendor-prefix": true, + "property-no-vendor-prefix": true, + "selector-no-vendor-prefix": true, + "value-no-vendor-prefix": true + }; + + return gulp + .src(['themes/**/less/**/*.less', '!themes/**/vendor/**/*.less']) + .pipe(gulpStylelint({ + failAfterError: true, + config: { + extends: "stylelint-config-standard", + rules: rules + }, + syntax: "less", + reporters: [ + {formatter: 'string', console: true} + ], + debug: true + })); +} + + var style_tasks = []; for (var style in resources) { @@ -159,13 +195,16 @@ for (var style in resources) { style_tasks.push('style_' + style); } +gulp.task('lint-css', createLinter); +style_tasks.push('lint-css'); + gulp.task("styles", style_tasks); gulp.task('watch', function() { // Watch .less files - gulp.watch('themes/daux/less/**/*.less', ['styles']); + gulp.watch('themes/**/less/**/*.less', ['styles']); }); diff --git a/package.json b/package.json index 125764e..f2301f1 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,19 @@ { - "name": "daux.io", - "version": "0.1.1", - "private": true, - "devDependencies": { - "grunt": "^0.4.1", - "grunt-php": "^1.0.0", - "cssnano": "^3.5.2", - "gulp": "^3.9.1", - "gulp-connect-php": "^0.0.7", - "gulp-less": "^3.0.3", - "gulp-plumber": "^1.1.0", - "gulp-postcss": "^6.1.0", - "gulp-rename": "^1.2.2" - } + "name": "daux.io", + "version": "0.1.1", + "private": true, + "devDependencies": { + "cssnano": "^3.5.2", + "grunt": "^0.4.1", + "grunt-php": "^1.0.0", + "gulp": "^3.9.1", + "gulp-connect-php": "^0.0.7", + "gulp-less": "^3.0.3", + "gulp-plumber": "^1.1.0", + "gulp-postcss": "^6.1.0", + "gulp-rename": "^1.2.2", + "gulp-sourcemaps": "^2.0.0-alpha", + "gulp-stylelint": "^2.0.2", + "stylelint-config-standard": "^6.0.0" + } } diff --git a/templates/home.php b/templates/home.php index b4dda1d..9fc1daf 100755 --- a/templates/home.php +++ b/templates/home.php @@ -5,7 +5,7 @@ - Fork me on GitHub + Fork me on GitHub
diff --git a/templates/layout/05_page.php b/templates/layout/05_page.php index 1bd8752..cc905a3 100755 --- a/templates/layout/05_page.php +++ b/templates/layout/05_page.php @@ -1,7 +1,7 @@ layout('theme::layout/00_layout') ?> - Fork me on GitHub + Fork me on GitHub