Add support for table in markdown
Update default theme for more semantic bone
This commit is contained in:
parent
3745cf1f03
commit
1902674a8b
3 changed files with 139 additions and 59 deletions
|
@ -6,6 +6,7 @@ use League\CommonMark\Environment\Environment;
|
||||||
use League\CommonMark\Extension\Autolink\AutolinkExtension;
|
use League\CommonMark\Extension\Autolink\AutolinkExtension;
|
||||||
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
|
||||||
use League\CommonMark\Extension\TaskList\TaskListExtension;
|
use League\CommonMark\Extension\TaskList\TaskListExtension;
|
||||||
|
use League\CommonMark\Extension\Table\TableExtension;
|
||||||
use League\CommonMark\MarkdownConverter;
|
use League\CommonMark\MarkdownConverter;
|
||||||
use Utils\Utils;
|
use Utils\Utils;
|
||||||
|
|
||||||
|
@ -396,6 +397,7 @@ class FileAndDir {
|
||||||
$environment->addExtension(new CommonMarkCoreExtension());
|
$environment->addExtension(new CommonMarkCoreExtension());
|
||||||
$environment->addExtension(new TaskListExtension());
|
$environment->addExtension(new TaskListExtension());
|
||||||
$environment->addExtension(new AutolinkExtension());
|
$environment->addExtension(new AutolinkExtension());
|
||||||
|
$environment->addExtension(new TableExtension());
|
||||||
$converter = new MarkdownConverter($environment);
|
$converter = new MarkdownConverter($environment);
|
||||||
return $converter->convert($content)->getContent();
|
return $converter->convert($content)->getContent();
|
||||||
} else {
|
} else {
|
||||||
|
@ -452,6 +454,7 @@ class FileAndDir {
|
||||||
$environment->addExtension(new CommonMarkCoreExtension());
|
$environment->addExtension(new CommonMarkCoreExtension());
|
||||||
$environment->addExtension(new TaskListExtension());
|
$environment->addExtension(new TaskListExtension());
|
||||||
$environment->addExtension(new AutolinkExtension());
|
$environment->addExtension(new AutolinkExtension());
|
||||||
|
$environment->addExtension(new TableExtension());
|
||||||
$converter = new MarkdownConverter($environment);
|
$converter = new MarkdownConverter($environment);
|
||||||
|
|
||||||
if (!empty($exifData)) {
|
if (!empty($exifData)) {
|
||||||
|
|
|
@ -1,7 +1,100 @@
|
||||||
* {
|
/* RESET CSS BY Piccalil.li */
|
||||||
|
/* https://piccalil.li/blog/a-more-modern-css-reset/ */
|
||||||
|
/* License https://creativecommons.org/licenses/by/3.0/ */
|
||||||
|
|
||||||
|
|
||||||
|
/* Box sizing rules */
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Prevent font size inflation */
|
||||||
|
html {
|
||||||
|
-moz-text-size-adjust: none;
|
||||||
|
-webkit-text-size-adjust: none;
|
||||||
|
text-size-adjust: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove default margin in favour of better control in authored CSS */
|
||||||
|
body,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
p,
|
||||||
|
figure,
|
||||||
|
blockquote,
|
||||||
|
dl,
|
||||||
|
dd {
|
||||||
|
margin-block-end: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
|
||||||
|
ul[role='list'],
|
||||||
|
ol[role='list'] {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set core body defaults */
|
||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set shorter line heights on headings and interactive elements */
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
label {
|
||||||
|
line-height: 1.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Balance text wrapping on headings */
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
text-wrap: balance;
|
||||||
|
margin: calc(var(--default-space)*2) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make images easier to work with */
|
||||||
|
/*img,
|
||||||
|
picture {
|
||||||
|
max-width: 100%;
|
||||||
|
display: block;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/* Inherit fonts for inputs and buttons */
|
||||||
|
input,
|
||||||
|
button,
|
||||||
|
textarea,
|
||||||
|
select {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure textareas without a rows attribute are not tiny */
|
||||||
|
textarea:not([rows]) {
|
||||||
|
min-height: 10em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Anything that has been anchored to should have extra scroll margin */
|
||||||
|
:target {
|
||||||
|
scroll-margin-block: 5ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
@ -105,6 +198,11 @@ a:not(.card-content):hover {
|
||||||
text-decoration-thickness: var(--default-space);
|
text-decoration-thickness: var(--default-space);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
.gslide-description p {
|
||||||
|
margin: calc(var(--default-space) /1.5) 0;
|
||||||
|
}
|
||||||
|
|
||||||
#logo-border-color {
|
#logo-border-color {
|
||||||
fill: var(--primary) !important;
|
fill: var(--primary) !important;
|
||||||
stroke: none !important;
|
stroke: none !important;
|
||||||
|
@ -121,16 +219,6 @@ a:not(.card-content):hover {
|
||||||
stroke: #000 !important;
|
stroke: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
aside {
|
|
||||||
color: var(--light-text-color);
|
|
||||||
background-color: var(--light-background-color);
|
|
||||||
padding: calc(var(--default-space) * 2);
|
|
||||||
border: 1px solid var(--background-color-darken);
|
|
||||||
border-radius: calc(var(--default-space) * 1.2);
|
|
||||||
margin: 0 0 calc(var(--default-space) *5) 0;
|
|
||||||
box-shadow: var(--box-shadow-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
main,
|
main,
|
||||||
.message {
|
.message {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
@ -152,28 +240,8 @@ img {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body>nav {
|
article,
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
aside {
|
|
||||||
padding-bottom: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
aside a {
|
|
||||||
color: var(--primary);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
aside * {
|
|
||||||
margin: .2em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
section {
|
section {
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-around;
|
|
||||||
gap: var(--default-space);
|
|
||||||
color: var(--light-text-color);
|
color: var(--light-text-color);
|
||||||
background-color: var(--light-background-color);
|
background-color: var(--light-background-color);
|
||||||
padding: calc(var(--default-space) * 2);
|
padding: calc(var(--default-space) * 2);
|
||||||
|
@ -183,7 +251,14 @@ section {
|
||||||
box-shadow: var(--box-shadow-light);
|
box-shadow: var(--box-shadow-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
article {
|
section {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-around;
|
||||||
|
gap: var(--default-space);
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
background-color: var(--light-background-color);
|
background-color: var(--light-background-color);
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(1, 1fr);
|
grid-template-columns: repeat(1, 1fr);
|
||||||
|
@ -194,15 +269,15 @@ article {
|
||||||
width: min-content;
|
width: min-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
article a {
|
figure a {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-footer {
|
figcaption {
|
||||||
color: var(--header-text-color);
|
color: var(--header-text-color);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: .3em .6em;
|
padding: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
@ -81,38 +81,40 @@ use App\FileAndDir;
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
|
||||||
<section>
|
|
||||||
<?php if ($breadcrumb_navigation): ?>
|
<?php if ($breadcrumb_navigation): ?>
|
||||||
|
<article>
|
||||||
<nav aria-label="breadcrumb" class="breadcrumb">
|
<nav aria-label="breadcrumb" class="breadcrumb">
|
||||||
<?= $breadcrumb_navigation; ?>
|
<?= $breadcrumb_navigation; ?>
|
||||||
</nav>
|
</nav>
|
||||||
|
</article>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($folderNote): ?>
|
<?php if ($folderNote): ?>
|
||||||
<aside>
|
<article>
|
||||||
<?= $folderNote; ?>
|
<?= $folderNote; ?>
|
||||||
</aside>
|
</article>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!empty($messages)) : ?>
|
<?php if (!empty($messages)) : ?>
|
||||||
<div id="message" class="message">
|
<article id="message" class="message">
|
||||||
<?= $messages; ?>
|
<?= $messages; ?>
|
||||||
</div>
|
</article>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</section>
|
|
||||||
|
|
||||||
|
<main>
|
||||||
<section>
|
<section>
|
||||||
<?php foreach ($listDir as $value) : ?>
|
<?php foreach ($listDir as $value) : ?>
|
||||||
<?php foreach ($value as $entry) : ?>
|
<?php foreach ($value as $entry) : ?>
|
||||||
<article>
|
<figure>
|
||||||
<a href="<?= $entry['link']; ?>" class="<?= FileAndDir::addToLightBox($entry['type']); ?> card-content" data-gallery="gallery" data-glightbox="<?= $entry['dataAttr']; ?>">
|
<a href="<?= $entry['link']; ?>" class="<?= FileAndDir::addToLightBox($entry['type']); ?> card-content" data-gallery="gallery" data-glightbox="<?= $entry['dataAttr']; ?>">
|
||||||
<img src="<?= $entry['thumb']; ?>" loading="lazy" alt="" width="<?= $config['thumbSize']; ?>" height="<?= $config['thumbSize']; ?>">
|
<img src="<?= $entry['thumb']; ?>" loading="lazy" alt="" width="<?= $config['thumbSize']; ?>" height="<?= $config['thumbSize']; ?>">
|
||||||
</a>
|
</a>
|
||||||
<p class="card-footer">
|
<figcaption>
|
||||||
<?= $entry['name']; ?>
|
<?= $entry['name']; ?>
|
||||||
</p>
|
</figcaption>
|
||||||
<?= $entry['imgCaption']; ?>
|
<?= $entry['imgCaption']; ?>
|
||||||
</article>
|
</figure>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue