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
@ -1,5 +1,6 @@
|
||||
{
|
||||
"docs_directory": "docs",
|
||||
"themes_directory": "themes",
|
||||
|
||||
"title": "My Project",
|
||||
"tagline": "My Stylish Documentation",
|
||||
|
@ -30,6 +30,9 @@ class Daux
|
||||
/** @var string */
|
||||
private $docs_path;
|
||||
|
||||
/** @var string */
|
||||
private $themes_path;
|
||||
|
||||
/** @var 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)
|
||||
{
|
||||
$this->docs_path = $path;
|
||||
@ -174,7 +189,8 @@ class Daux
|
||||
'mode' => $this->mode,
|
||||
'local_base' => $this->local_base,
|
||||
'docs_path' => $this->docs_path,
|
||||
'templates' => $this->internal_base . DIRECTORY_SEPARATOR . 'templates',
|
||||
'themes_path' => $this->themes_path,
|
||||
'templates' => 'templates'
|
||||
];
|
||||
$this->options->conservativeMerge($default);
|
||||
|
||||
|
@ -30,9 +30,8 @@ class DauxHelper
|
||||
*/
|
||||
public static function getTheme($params, $current_url)
|
||||
{
|
||||
$theme_folder = $params['local_base'] . DIRECTORY_SEPARATOR . 'resources' .
|
||||
DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
||||
$theme_url = $params['base_url'] . "resources/themes/" . $params['html']['theme'] . '/';
|
||||
$theme_folder = $params['themes_path'] . DIRECTORY_SEPARATOR . $params['html']['theme'];
|
||||
$theme_url = $params['base_url'] . $params['themes_directory'] . '/' . $params['html']['theme'] . '/';
|
||||
|
||||
$theme = array();
|
||||
if (is_file($theme_folder . DIRECTORY_SEPARATOR . "config.json")) {
|
||||
@ -50,7 +49,7 @@ class DauxHelper
|
||||
'fonts' => [],
|
||||
'require-jquery' => 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',
|
||||
];
|
||||
|
||||
|
@ -22,6 +22,7 @@ class Server
|
||||
public static function serve()
|
||||
{
|
||||
$daux = new Daux(Daux::LIVE_MODE);
|
||||
$daux->setThemesPath($daux->getParams()['themes_directory']);
|
||||
$daux->setDocumentationPath($daux->getParams()['docs_directory']);
|
||||
$daux->initializeConfiguration();
|
||||
|
||||
|
@ -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";
|
@ -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";
|
@ -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";
|
@ -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";
|
@ -43,12 +43,12 @@
|
||||
<!-- jQuery -->
|
||||
<?php
|
||||
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 -->
|
||||
<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>
|
||||
|
||||
<!-- JS -->
|
||||
@ -56,6 +56,6 @@
|
||||
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>
|
||||
</html>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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"],
|
||||
"js": [],
|
||||
"require-jquery": true,
|
4498
themes/daux-blue/css/theme.css
Fichier normal
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |
19
themes/daux-blue/less/theme.less
Fichier normal
@ -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";
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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"],
|
||||
"js": [],
|
||||
"require-jquery": true,
|
4498
themes/daux-green/css/theme.css
Fichier normal
Avant Largeur: | Hauteur: | Taille: 106 KiB Après Largeur: | Hauteur: | Taille: 106 KiB |
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |
19
themes/daux-green/less/theme.less
Fichier normal
@ -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";
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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"],
|
||||
"js": [],
|
||||
"require-jquery": true,
|
4498
themes/daux-navy/css/theme.css
Fichier normal
Avant Largeur: | Hauteur: | Taille: 106 KiB Après Largeur: | Hauteur: | Taille: 106 KiB |
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |
19
themes/daux-navy/less/theme.less
Fichier normal
@ -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";
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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"],
|
||||
"js": [],
|
||||
"require-jquery": true,
|
4498
themes/daux-red/css/theme.css
Fichier normal
Avant Largeur: | Hauteur: | Taille: 106 KiB Après Largeur: | Hauteur: | Taille: 106 KiB |
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |
19
themes/daux-red/less/theme.less
Fichier normal
@ -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
Fichier normal
@ -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
Fichier normal
Avant Largeur: | Hauteur: | Taille: 106 KiB Après Largeur: | Hauteur: | Taille: 106 KiB |
Avant Largeur: | Hauteur: | Taille: 1.0 KiB Après Largeur: | Hauteur: | Taille: 1.0 KiB |