#39, Finish columns shortcode, clean scss

This commit is contained in:
Alex Shpak 2019-05-23 16:30:26 +02:00
parent c80bd79dcd
commit 5437521798
16 changed files with 141 additions and 73 deletions

View file

@ -8,12 +8,12 @@ $block-border-radius: 0.15rem;
h1, h2, h3, h4, h5 { h1, h2, h3, h4, h5 {
font-weight: 400; font-weight: 400;
line-height: 1.25; line-height: 1.25;
}
// remove padding at the beginning of page // remove padding at the beginning of page
&> :first-child { > :first-child {
margin-top: 0; margin-top: 0;
line-height: 1em; line-height: 1;
}
} }
b, optgroup, strong { b, optgroup, strong {
@ -72,4 +72,10 @@ $block-border-radius: 0.15rem;
background: $gray-100; background: $gray-100;
} }
} }
hr {
height: $padding-1;
border: none;
background: $gray-200;
}
} }

View file

@ -1,10 +1,10 @@
@import "variables"; @import "variables";
.markdown-inner { .markdown-inner {
:first-child { > :first-child {
margin-top: 0; margin-top: 0;
} }
:last-child { > :last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
@ -50,3 +50,9 @@
display: block; display: block;
} }
} }
.book-columns > {
div + div {
margin-left: $padding-16 * 2;
}
}

View file

@ -34,14 +34,6 @@
margin: 0 auto; margin: 0 auto;
} }
.mr-auto {
margin-right: auto;
}
.hide {
display: none;
}
@mixin fixed { @mixin fixed {
position: fixed; position: fixed;
top: 0; top: 0;

View file

@ -149,21 +149,9 @@ ul.pagination {
} }
} }
.book-git-footer {
display: flex;
margin-top: $padding-16;
font-size: $font-size-14;
align-items: baseline;
img {
width: $font-size-14;
vertical-align: bottom;
}
}
.book-footer { .book-footer {
display: flex; display: flex;
margin-top: $padding-16; padding-top: $padding-16;
font-size: $font-size-14; font-size: $font-size-14;
align-items: baseline; align-items: baseline;

View file

@ -5,6 +5,23 @@ type: docs
# Acerbo datus maxime # Acerbo datus maxime
{{< columns >}}
## Astris ipse furtiva
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
<--->
## Suis quot vota
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
nunc! Fragosis suae dextra geruntur functus vulgata.
{{< /columns >}}
## Tempora nisi nunc ## Tempora nisi nunc
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei, Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
@ -26,8 +43,8 @@ sequens!
## Locis suis novi cum suoque decidit eadem ## Locis suis novi cum suoque decidit eadem
Idmoniae ripis, at aves, ali missa adest, ut *et autem*, et ab? Venit spes Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab? Venit spes
versus finis sermonibus patefecit murum nec est sine oculis. *Ille* inmota versus finis sermonibus patefecit murum nec est sine oculis. _Ille_ inmota
macies domoque caelestia cadit tantummodo scelus procul, corde! macies domoque caelestia cadit tantummodo scelus procul, corde!
1. Dolentem capi parte rostro alvum habentem pudor 1. Dolentem capi parte rostro alvum habentem pudor
@ -35,22 +52,9 @@ macies domoque caelestia cadit tantummodo scelus procul, corde!
3. E punior consurgit lentus 3. E punior consurgit lentus
4. Vox hasta eras micantes 4. Vox hasta eras micantes
## Suis quot
Ea *furtique* risere fratres edidit terrae magis. Colla tam mihi tenebat:
miseram excita suadent es pecudes iam. Concilio *quam* velatus posset ait quod
nunc!
## Astris ipse furtiva vota collumque et habe
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
modo arsit? Utinam rapta fiducia valuere litora *adicit cursu*, ad facies:
fragosis suae dextra geruntur functus vulgata.
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis ## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te *nati* Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
at ademptae, mira. at ademptae, mira.

View file

@ -80,30 +80,77 @@ Miseratus fonte Ditis conubia.
# Multi-Column shortcode # Multi-Column shortcode
```tpl ```html
{{</* column */>}} <!-- begin columns block --> {{</* columns */>}} <!-- begin columns block -->
# Left Content # Left Content
... Lorem markdownum insigne...
{{</* column /*/>}} <!-- columns separator -->
<---> <!-- magic sparator, between columns -->
# Mid Content
Lorem markdownum insigne...
<---> <!-- magic sparator, between columns -->
# Right Content # Right Content
... Lorem markdownum insigne...
{{</* /column */>}} <!-- end columns block --> {{</* /columns */>}}
``` ```
{{< column >}} {{< columns >}}
# Left Content ## Left Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia. Miseratus fonte Ditis conubia.
{{< column />}}
# Mid Content <--->
## Mid Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! stringit, frustra Saturnius uteroque inter!
{{< column />}}
# Right Content <--->
## Right Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes. protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia. Miseratus fonte Ditis conubia.
{{< /column >}} {{< /columns >}}
# Mermaid Chart Shortcode
{{< columns >}}
```tpl
{{</* mermaid */>}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{</* /mermaid */>}}
```
<--->
{{< mermaid >}}
sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end
{{< /mermaid >}}
{{< /columns >}}

View file

@ -1 +1 @@
{"Target":"book.min.c104bb061e603114d8caae951ee4fd5f4c3c731846b3f5b64e26b55524416940.css","MediaType":"text/css","Data":{"Integrity":"sha256-wQS7Bh5gMRTYyq6VHuT9X0w8cxhGs/W2Tia1VSRBaUA="}} {"Target":"book.min.2640646abff8284daffab17a8c1639ff1b0093a41830c30e7e8f654e2324dd9f.css","MediaType":"text/css","Data":{"Integrity":"sha256-JkBkar/4KE2v+rF6jBY5/xsAk6QYMMMOfo9lTiMk3Z8="}}

View file

@ -1,5 +1,5 @@
{{ if or .GitInfo .Site.Params.BookEditPath }} {{ if or .GitInfo .Site.Params.BookEditPath }}
<div class="align-center book-git-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}"> <div class="book-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}">
{{ with .GitInfo }} {{ with .GitInfo }}
<div> <div>
{{ $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) }} {{ $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) }}

View file

@ -37,4 +37,4 @@
menu.scrollTop = localStorage.getItem('menu.scrollTop') menu.scrollTop = localStorage.getItem('menu.scrollTop')
})() })()
</script> </script>
{{ end }} {{ end }}

View file

@ -1,10 +0,0 @@
{{ if .Inner }}
<div class="flex">
<div class="flex-even">
{{ .Inner | markdownify }}
</div>
</div>
{{ else }}
</div> <!-- close current column -->
<div class="flex-even"> <!-- open new column -->
{{ end }}

View file

@ -0,0 +1,7 @@
<div class="book-columns flex">
{{ range split .Inner "<--->" }}
<div class="flex-even">
{{ . | markdownify }}
</div>
{{ end }}
</div>

View file

@ -6,7 +6,7 @@
</div> </div>
<input type="checkbox" style="display: none" /> <input type="checkbox" style="display: none" />
<div class="book-expand-content markdown-inner"> <div class="book-expand-content markdown-inner">
{{- .Inner | markdownify -}} {{ .Inner | markdownify }}
</div> </div>
</label> </label>
</div> </div>

View file

@ -0,0 +1,9 @@
{{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time -->
<script src="{{ "mermaid.min.js" | absURL }}"></script>
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}
<p class="mermaid flex align-center">
{{ .Inner }}
</p>

View file

@ -8,5 +8,5 @@
{{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
{{ else }} {{ else }}
{{- errorf "%q: tab shortcode must be inside tabs shortcode" .Page.Path -}} {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
{{ end}} {{ end}}

19
static/mermaid.min.js vendored Normal file

File diff suppressed because one or more lines are too long