mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit fceb5c4c874d9f7618181aeb705f87e4056d1625
parent c7d3974184bc3d48a53a5223ab7ef3e8a1cc4e26
Author: markseu <mark2011@mayberg.se>
Date:   Sat, 25 May 2019 00:09:06 +0200

Updated Markdown extension and themes

Diffstat:
Msystem/extensions/markdown.php | 32+++++++++++++++++++-------------
Msystem/extensions/stockholm.php | 2+-
Msystem/resources/stockholm.css | 54+++++++++++++++++++++++++++++++++++++++---------------
3 files changed, 59 insertions(+), 29 deletions(-)

diff --git a/system/extensions/markdown.php b/system/extensions/markdown.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowMarkdown { - const VERSION = "0.8.5"; + const VERSION = "0.8.6"; const TYPE = "feature"; public $yellow; //access to API @@ -3900,28 +3900,34 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser { // Handle notice blocks public function doNoticeBlocks($text) { - return preg_replace_callback("/((?>^[ ]*!.+\n(.+\n)*\n*)+)/m", array($this, "_doNoticeBlocks_callback"), $text); + return preg_replace_callback("/((?>^[ ]*!{1,6}.*\n)+)/m", array($this, "_doNoticeBlocks_callback"), $text); } // Handle notice blocks over multiple lines public function _doNoticeBlocks_callback($matches) { - $output = $class = $text = ""; + $output = $openerLength = $attr = $text = ""; foreach (preg_split("/\n/", $matches[1]) as $line) { - if (preg_match("/^[ ]*(!{1,6})([\w\-]*)[ ]?(.*)$/", $line, $matches)) { - $classNew = empty($matches[2]) ? "notice-".strlen($matches[1]) : $matches[2]; - if ($classNew!=$class) { - if (!empty($class) && !empty($text)) { - $line = "<div class=\"$class\">\n".$this->runBlockGamut($text)."\n</div>"; + if (preg_match("/^[ ]*(!{1,6})[ ]?(.*)$/", $line, $matches)) { + $openerLengthNew = strlen($matches[1]); + if ($openerLengthNew!=$openerLength) { + if (!empty($text)) { + $line = "<div$attr>\n".$this->runBlockGamut($text)."\n</div>"; $output .= "\n".$this->hashBlock($line)."\n\n"; } - $class = $classNew; - $text = ""; + $openerLength = $openerLengthNew; + $attr = " class=\"notice$openerLength\""; + $text = $matches[2]."\n"; + if (preg_match("/^[ ]*".$this->id_class_attr_catch_re."[ ]*$/", $text, $matches)) { + $attr = $this->doExtraAttributes("div", $dummy =& $matches[1]); + $text = ""; + } + } else { + $text .= $matches[2]."\n"; } } - $text .= $matches[3]."\n"; } - if (!empty($class) && !empty($text)) { - $line = "<div class=\"$class\">\n".$this->runBlockGamut($text)."\n</div>"; + if (!empty($text)) { + $line = "<div$attr>\n".$this->runBlockGamut($text)."\n</div>"; $output .= "\n".$this->hashBlock($line)."\n\n"; } return $output; diff --git a/system/extensions/stockholm.php b/system/extensions/stockholm.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowStockholm { - const VERSION = "0.8.3"; + const VERSION = "0.8.4"; const TYPE = "theme"; public $yellow; //access to API diff --git a/system/resources/stockholm.css b/system/resources/stockholm.css @@ -101,18 +101,6 @@ a:hover { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; } -.content blockquote { - margin-left: 0; - padding-left: 1em; - border-left: 0.5em solid #0a0; -} -.content blockquote blockquote { - margin-left: -1.5em; - border-left: 0.5em solid #fb0; -} -.content blockquote blockquote blockquote { - border-color: #d00; -} .content code, .content pre { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; @@ -139,6 +127,35 @@ a:hover { background-color: #f7f7f7; border-radius: 3px; } +.content blockquote { + margin-left: 0; + padding-left: 1em; + border-left: 1px solid #ddd; +} +.content .notice1 { + margin: 1em 0; + padding: 10px 1em; + background-color: #fffbf0; + color: #e90; + border-left: 10px solid #fb0; +} +.content .notice2 { + margin: 1em 0; + padding: 10px 1em; + background-color: #fdf0f0; + color: #c00; + border-left: 10px solid #d00; +} +.content .notice3, +.content .notice4, +.content .notice5, +.content .notice6 { + margin: 1em 0; + padding: 10px 1em; + background-color: #f0f8fe; + color: #07d; + border-left: 10px solid #08e; +} .content .flexible { position: relative; padding-top: 0; @@ -438,9 +455,6 @@ a:hover { /* Misc */ -.layout-default .content img.screenshot { - margin: 0 -0.5em; -} .layout-language .content div.language { font-size: 1.2em; text-align: left; @@ -455,6 +469,11 @@ a:hover { margin-top: -5px; margin-right: 1.5em; } +.content .main .wikipages ul, +.content .main .wikitags ul, +.content .main .wikilinks ul { + columns: 3; +} .hljs-meta, .hljs-keyword, .hljs-literal { @@ -533,6 +552,11 @@ a:hover { .with-sidebar .sidebar { display: none; } + .content .main .wikipages ul, + .content .main .wikitags ul, + .content .main .wikilinks ul { + columns: 1; + } } @media print { .page {