Merge branch 'dev_template_refactor' of https://github.com/holodyn/daux.io into holodyn-dev_template_refactor

# By David Hunt
# Via David Hunt
* 'dev_template_refactor' of https://github.com/holodyn/daux.io:
  Updated libs to use /templates and /themes/{theme}/templates Renamed /themes/core to /themes/daux Updated /themes/{theme}/less/theme.less to allow for bootstrap overrides Added /themes/daux/less/theme.less to allow daux to function as theme - used daux-navy colors Moved fonts from themes variants into /themes/daux/fonts
  Refactored /templates and /resources into a single /themes folder.

# Conflicts:
#	libs/Daux.php
This commit is contained in:
Stéphane Goetz 2015-08-09 21:29:23 +02:00
commit cee589fbad
132 changed files with 22622 additions and 103 deletions

View File

@ -1,5 +1,6 @@
{ {
"docs_directory": "docs", "docs_directory": "docs",
"themes_directory": "themes",
"title": "My Project", "title": "My Project",
"tagline": "My Stylish Documentation", "tagline": "My Stylish Documentation",

View File

@ -30,6 +30,9 @@ class Daux
/** @var string */ /** @var string */
private $docs_path; private $docs_path;
/** @var string */
private $themes_path;
/** @var Processor */ /** @var Processor */
protected $processor; protected $processor;
@ -90,6 +93,18 @@ class Daux
} }
} }
public function setThemesPath($path)
{
$this->themes_path = $path;
if (!is_dir($this->themes_path) &&
!is_dir($this->themes_path = $this->local_base . DIRECTORY_SEPARATOR . $this->themes_path)
) {
throw new Exception('The Themes directory does not exist. Check the path again : ' . $this->themes_path);
}
$this->options['themes_path'] = $this->themes_path;
$this->options['templates'] = 'templates';
}
public function setDocumentationPath($path) public function setDocumentationPath($path)
{ {
$this->docs_path = $path; $this->docs_path = $path;
@ -174,7 +189,8 @@ class Daux
'mode' => $this->mode, 'mode' => $this->mode,
'local_base' => $this->local_base, 'local_base' => $this->local_base,
'docs_path' => $this->docs_path, 'docs_path' => $this->docs_path,
'templates' => $this->internal_base . DIRECTORY_SEPARATOR . 'templates', 'themes_path' => $this->themes_path,
'templates' => 'templates'
]; ];
$this->options->conservativeMerge($default); $this->options->conservativeMerge($default);

View File

@ -30,9 +30,8 @@ class DauxHelper
*/ */
public static function getTheme($params, $current_url) public static function getTheme($params, $current_url)
{ {
$theme_folder = $params['local_base'] . DIRECTORY_SEPARATOR . 'resources' . $theme_folder = $params['themes_path'] . DIRECTORY_SEPARATOR . $params['html']['theme'];
DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $params['html']['theme']; $theme_url = $params['base_url'] . $params['themes_directory'] . '/' . $params['html']['theme'] . '/';
$theme_url = $params['base_url'] . "resources/themes/" . $params['html']['theme'] . '/';
$theme = array(); $theme = array();
if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) { if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) {
@ -50,7 +49,7 @@ class DauxHelper
'fonts' => [], 'fonts' => [],
'require-jquery' => false, 'require-jquery' => false,
'bootstrap-js' => false, 'bootstrap-js' => false,
'favicon' => '<base_url>resources/img/favicon.png', 'favicon' => '<base_url>themes/daux/img/favicon.png',
'templates' => $theme_folder . DIRECTORY_SEPARATOR . 'templates', 'templates' => $theme_folder . DIRECTORY_SEPARATOR . 'templates',
]; ];

View File

@ -22,6 +22,7 @@ class Server
public static function serve() public static function serve()
{ {
$daux = new Daux(Daux::LIVE_MODE); $daux = new Daux(Daux::LIVE_MODE);
$daux->setThemesPath($daux->getParams()['themes_directory']);
$daux->setDocumentationPath($daux->getParams()['docs_directory']); $daux->setDocumentationPath($daux->getParams()['docs_directory']);
$daux->initializeConfiguration(); $daux->initializeConfiguration();

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
//Daux.io Blue
@sidebar-background: #f7f7f7;
@sidebar-hover: #c5c5cb;
@lines: #e7e7e9;
@dark: #3f4657;
@light: #82becd;
@text: #2d2d2d;
@syntax-string: #022e99;
@syntax-comment: #84989b;
@syntax-number: #2f9b92;
@syntax-label: #840d7a;
@import "../../_common/less/daux-base.less";

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
//Daux.io Green
@sidebar-background: #f5f5f6;
@sidebar-hover: #a0d55d;
@lines: #e7e7e9;
@dark: #000000;
@light: #8acc37;
@text: #2d2d2d;
@syntax-string: #e0ff00;
@syntax-comment: #c4e598;
@syntax-number: #097c4e;
@syntax-label: #022e99;
@import "../../_common/less/daux-base.less";

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
//Daux.io Navy
@sidebar-hover: #c5c5cb;
@lines: #e7e7e9;
@sidebar-background: #f5f5f6;
@dark: #13132a;
@light: #7795b4;
@text: #2d2d2d;
@syntax-string: #000000;
@syntax-comment: #505050;
@syntax-number: #09559b;
@syntax-label: #001775;
@import "../../_common/less/daux-base.less";

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
//Daux.io Red
@sidebar-hover: #eeeeee;
@lines: #eeeeee;
@sidebar-background: #f7f7f7;
@dark: #c64641; //#df4f49;
@light: #ecb5a1;
@text: #2d2d2d;
@syntax-string: #557aa2;
@syntax-comment: #ecdfd0;
@syntax-number: #9b2f7d;
@syntax-label: #a31621;
@import "../../_common/less/daux-base.less";

View File

@ -43,12 +43,12 @@
<!-- jQuery --> <!-- jQuery -->
<?php <?php
if ($params['theme']['require-jquery']) { if ($params['theme']['require-jquery']) {
echo '<script src="' . $base_url . 'resources/js/jquery-1.11.3.min.js' . '"></script>'; echo '<script src="' . $base_url . 'themes/daux/js/jquery-1.11.3.min.js' . '"></script>';
} }
?> ?>
<!-- hightlight.js --> <!-- hightlight.js -->
<script src="<?= $base_url; ?>resources/js/highlight.min.js"></script> <script src="<?= $base_url; ?>themes/daux/js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script> <script>hljs.initHighlightingOnLoad();</script>
<!-- JS --> <!-- JS -->
@ -56,6 +56,6 @@
echo '<script src="' . $js . '"></script>'; echo '<script src="' . $js . '"></script>';
} ?> } ?>
<script src="<?= $base_url; ?>resources/js/daux.js"></script> <script src="<?= $base_url; ?>themes/daux/js/daux.js"></script>
</body> </body>
</html> </html>

View File

@ -1,6 +1,6 @@
{ {
"favicon": "<theme_url>img/favicon-blue.png", "favicon": "<theme_url>img/favicon-blue.png",
"css": ["<theme_url>css/theme.min.css"], "css": ["<theme_url>css/theme.css"],
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
"js": [], "js": [],
"require-jquery": true, "require-jquery": true,

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,19 @@
//Daux.io Blue
@sidebar-background: #f7f7f7;
@sidebar-hover: #c5c5cb;
@lines: #e7e7e9;
@dark: #3f4657;
@light: #82becd;
@text: #2d2d2d;
@syntax-string: #022e99;
@syntax-comment: #84989b;
@syntax-number: #2f9b92;
@syntax-label: #840d7a;
// Bootstrap
@import "../../daux/less/bootstrap/bootstrap.less";
@icon-font-path: "../../daux/fonts/";
// Daux.io Base
@import "../../daux/less/theme-base.less";

View File

@ -1,6 +1,6 @@
{ {
"favicon": "<theme_url>img/favicon-green.png", "favicon": "<theme_url>img/favicon-green.png",
"css": ["<theme_url>css/theme.min.css"], "css": ["<theme_url>css/theme.css"],
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
"js": [], "js": [],
"require-jquery": true, "require-jquery": true,

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,19 @@
//Daux.io Green
@sidebar-background: #f5f5f6;
@sidebar-hover: #a0d55d;
@lines: #e7e7e9;
@dark: #000000;
@light: #8acc37;
@text: #2d2d2d;
@syntax-string: #e0ff00;
@syntax-comment: #c4e598;
@syntax-number: #097c4e;
@syntax-label: #022e99;
// Bootstrap
@import "../../daux/less/bootstrap/bootstrap.less";
@icon-font-path: "../../daux/fonts/";
// Daux.io Base
@import "../../daux/less/theme-base.less";

View File

@ -1,6 +1,6 @@
{ {
"favicon": "<theme_url>img/favicon-navy.png", "favicon": "<theme_url>img/favicon-navy.png",
"css": ["<theme_url>css/theme.min.css"], "css": ["<theme_url>css/theme.css"],
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
"js": [], "js": [],
"require-jquery": true, "require-jquery": true,

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,19 @@
//Daux.io Navy
@sidebar-hover: #c5c5cb;
@lines: #e7e7e9;
@sidebar-background: #f5f5f6;
@dark: #13132a;
@light: #7795b4;
@text: #2d2d2d;
@syntax-string: #000000;
@syntax-comment: #505050;
@syntax-number: #09559b;
@syntax-label: #001775;
// Bootstrap
@import "../../daux/less/bootstrap/bootstrap.less";
@icon-font-path: "../../daux/fonts/";
// Daux.io Base
@import "../../daux/less/theme-base.less";

View File

@ -1,6 +1,6 @@
{ {
"favicon": "<theme_url>img/favicon-red.png", "favicon": "<theme_url>img/favicon-red.png",
"css": ["<theme_url>css/theme.min.css"], "css": ["<theme_url>css/theme.css"],
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
"js": [], "js": [],
"require-jquery": true, "require-jquery": true,

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,19 @@
// Daux.io Red
@sidebar-hover: #eeeeee;
@lines: #eeeeee;
@sidebar-background: #f7f7f7;
@dark: #c64641; //#df4f49;
@light: #ecb5a1;
@text: #2d2d2d;
@syntax-string: #557aa2;
@syntax-comment: #ecdfd0;
@syntax-number: #9b2f7d;
@syntax-label: #a31621;
// Bootstrap
@import "../../daux/less/bootstrap/bootstrap.less";
@icon-font-path: "../../daux/fonts/";
// Daux.io Base
@import "../../daux/less/theme-base.less";

8
themes/daux/config.json Normal file
View File

@ -0,0 +1,8 @@
{
"favicon": "<theme_url>img/favicon.png",
"css": ["<theme_url>css/theme.css"],
"fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"],
"js": [],
"require-jquery": true,
"bootstrap-js": false
}

4498
themes/daux/css/theme.css Normal file

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More