#422, add support for column ratios in shortcode

This commit is contained in:
Alex Shpak 2024-10-04 13:36:14 +02:00
parent 925dbd3b9f
commit 9cc0b0225d
12 changed files with 108 additions and 186 deletions

View File

@ -71,7 +71,7 @@
> div { > div {
margin: $padding-16 0; margin: $padding-16 0;
min-width: $body-min-width / 2; min-width: $body-min-width * 0.66;
padding: 0 $padding-16; padding: 0 $padding-16;
} }
} }

View File

@ -1,79 +0,0 @@
---
title: ভূমিকা
type: docs
---
# বাংলা ভাষায় শুরু করুন
{{% columns %}}
## অস্ট্রিস চিপসে ফুর্তিভা
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
<--->
## সুইস কোটা ভোটে
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 %}}
## টেম্পোরার নিশি
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
sequens!
var panel = ram_design;
if (backup + system) {
file.readPoint = network_native;
sidebar_engine_device(cell_tftp_raster,
dual_login_paper.adf_vci.application_reader_design(
graphicsNvramCdma, lpi_footer_snmp, integer_model));
}
public_keyboard_docking += error.controller_gibibyte_plug.ip(4,
asciiPetaflops, software(supercomputer_compatible_status + 4));
dynamic_disk.indexModeLaptop = bufferTftpReality;
var export_vlog_sequence = trinitron_flowchart + supercomputer_cluster_rj(
-1, toolbar_powerpoint_query, -2 / multiprocessing_impression);
## Locis suis novi cum suoque decidit eadem
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
macies domoque caelestia cadit tantummodo scelus procul, corde!
1. Dolentem capi parte rostro alvum habentem pudor
2. Fulgentia sanguine paret
3. E punior consurgit lentus
4. Vox hasta eras micantes
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
at ademptae, mira.
direct *= font(inputScareware(sliHome), crossplatform.byte(
ppl_encryption.excel_e_rte(integratedModelModifier), timeVirtual,
floating_speakers.media_printer(us, yahoo, primaryPhp)));
friendly_metal_flatbed(cd, isoPrimaryStorage(reader), dmaMirrored);
if (parse_flash_cron.metalGif(1, adServiceDevice, utility)) {
adf -= operation_cdma_samba;
imapGif.switch += torrent;
} else {
pmu.disk_captcha = digital_ppp_pci + recursionTransistor(5, dram);
ajax_service += grayscalePythonLock;
google_scroll_capacity = ftp + engine_dslam_sidebar / tape - 1;
}
drive_rw = zipTftp;
var suffix = software_router_extension.dimm_ddr(-5,
kernel_digital_minisite);
Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam
tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis
innumeris miraturus amplectique collo sustinet quemque! Litora ante turba?

View File

@ -2,9 +2,10 @@
Columns help organize shorter pieces of content horizontally for readability. Columns help organize shorter pieces of content horizontally for readability.
## Example
```html ```html
{{%/* columns */%}} <!-- begin columns block --> {{%/* columns [ratio="1:1"] [class="..."] */%}} <!-- begin columns block -->
# Left Content # Left Content
Lorem markdownum insigne... Lorem markdownum insigne...
@ -20,10 +21,8 @@ Lorem markdownum insigne...
{{%/* /columns */%}} {{%/* /columns */%}}
``` ```
## Example
{{% columns %}} {{% 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.
@ -31,15 +30,51 @@ Miseratus fonte Ditis conubia.
<---> <--->
## 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!
<---> <--->
## 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.
{{% /columns %}} {{% /columns %}}
## Settings size ratio for columns
```html
{{%/* columns ratio="1:2" */%}} <!-- begin columns block -->
## x1 Column
Lorem markdownum insigne...
<---> <!-- magic separator, between columns -->
## x2 Column
Lorem markdownum insigne...
{{%/* /columns */%}}
```
{{% columns ratio="1:2" %}}
### x1 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
<--->
### x2 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter!
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{% /columns %}}

View File

@ -9,16 +9,16 @@ KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX
{{% columns %}} {{% columns %}}
```latex ```latex
{{</* katex display=true class="optional" >}} {{</* katex display=true [class="..."] >}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex */>}} {{< /katex */>}}
``` ```
<---> <--->
{{< katex display=true class="optional" >}} {{<katex display=true>}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex >}} {{</katex>}}
{{% /columns %}} {{% /columns %}}

View File

@ -14,7 +14,7 @@ create a `mermaid.json` file in your `assets` folder!
{{% columns %}} {{% columns %}}
```tpl ```tpl
{{</* mermaid class="optional" >}} {{</* mermaid [class="..."] >}}
stateDiagram-v2 stateDiagram-v2
State1: The state with a note State1: The state with a note
note right of State1 note right of State1
@ -28,7 +28,7 @@ stateDiagram-v2
<---> <--->
{{< mermaid class="optional" >}} {{<mermaid>}}
stateDiagram-v2 stateDiagram-v2
State1: The state with a note State1: The state with a note
note right of State1 note right of State1
@ -37,6 +37,6 @@ stateDiagram-v2
end note end note
State1 --> State2 State1 --> State2
note left of State2 : This is the note to the left. note left of State2 : This is the note to the left.
{{< /mermaid >}} {{</mermaid>}}
{{% /columns %}} {{% /columns %}}

View File

@ -0,0 +1,41 @@
---
title: Introduction
type: docs
---
# Example of RTL page
{{% 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
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
sequens!
var panel = ram_design;
if (backup + system) {
file.readPoint = network_native;
sidebar_engine_device(cell_tftp_raster,
dual_login_paper.adf_vci.application_reader_design(
graphicsNvramCdma, lpi_footer_snmp, integer_model));
}
## Locis suis novi cum suoque decidit eadem
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab?

View File

@ -1,79 +0,0 @@
---
title: Введение
type: docs
---
# Стартовая страница на русском языке
{{% 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
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
sequens!
var panel = ram_design;
if (backup + system) {
file.readPoint = network_native;
sidebar_engine_device(cell_tftp_raster,
dual_login_paper.adf_vci.application_reader_design(
graphicsNvramCdma, lpi_footer_snmp, integer_model));
}
public_keyboard_docking += error.controller_gibibyte_plug.ip(4,
asciiPetaflops, software(supercomputer_compatible_status + 4));
dynamic_disk.indexModeLaptop = bufferTftpReality;
var export_vlog_sequence = trinitron_flowchart + supercomputer_cluster_rj(
-1, toolbar_powerpoint_query, -2 / multiprocessing_impression);
## Locis suis novi cum suoque decidit eadem
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
macies domoque caelestia cadit tantummodo scelus procul, corde!
1. Dolentem capi parte rostro alvum habentem pudor
2. Fulgentia sanguine paret
3. E punior consurgit lentus
4. Vox hasta eras micantes
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
at ademptae, mira.
direct *= font(inputScareware(sliHome), crossplatform.byte(
ppl_encryption.excel_e_rte(integratedModelModifier), timeVirtual,
floating_speakers.media_printer(us, yahoo, primaryPhp)));
friendly_metal_flatbed(cd, isoPrimaryStorage(reader), dmaMirrored);
if (parse_flash_cron.metalGif(1, adServiceDevice, utility)) {
adf -= operation_cdma_samba;
imapGif.switch += torrent;
} else {
pmu.disk_captcha = digital_ppp_pci + recursionTransistor(5, dram);
ajax_service += grayscalePythonLock;
google_scroll_capacity = ftp + engine_dslam_sidebar / tape - 1;
}
drive_rw = zipTftp;
var suffix = software_router_extension.dimm_ddr(-5,
kernel_digital_minisite);
Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam
tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis
innumeris miraturus amplectique collo sustinet quemque! Litora ante turba?

View File

@ -26,14 +26,15 @@ enableGitInfo = true
contentDir = 'content.en' contentDir = 'content.en'
weight = 1 weight = 1
[languages.ru]
languageName = 'Russian'
contentDir = 'content.ru'
weight = 2
[languages.zh] [languages.zh]
languageName = 'Chinese' languageName = 'Chinese'
contentDir = 'content.zh' contentDir = 'content.zh'
weight = 2
[languages.he]
languageName = 'Hebrew'
contentDir = 'content.he'
languageDirection = 'rtl'
weight = 3 weight = 3
[menu] [menu]

View File

@ -25,13 +25,14 @@ languages:
languageName: English languageName: English
contentDir: content.en contentDir: content.en
weight: 1 weight: 1
ru:
languageName: Russian
contentDir: content.ru
weight: 2
zh: zh:
languageName: Chinese languageName: Chinese
contentDir: content.zh contentDir: content.zh
weight: 2
he:
languageName: Hebrew
contentDir: content.he
languageDirection: rtl
weight: 3 weight: 3
menu: menu:

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"Target":"book.min.f019955684d0f5b49c2f421c16bd7274f6ec699bc5a7c19809cbd22ac70e826e.css","MediaType":"text/css","Data":{"Integrity":"sha256-8BmVVoTQ9bScL0IcFr1ydPbsaZvFp8GYCcvSKscOgm4="}} {"Target":"book.min.3b63b9ecb24b01f1be0df5c6f361b3a2004ab96665227385e0196f67e7607b29.css","MediaType":"text/css","Data":{"Integrity":"sha256-O2O57LJLAfG+DfXG82GzogBKuWZlInOF4BlvZ+dgeyk="}}

View File

@ -1,7 +1,9 @@
<div class="book-columns flex flex-wrap"> {{- $ratio := (split (.Get "ratio") ":") -}}
{{ range split .InnerDeindent "<--->" }} <div class="book-columns flex flex-wrap{{ with .Get "class" }} {{ . }}{{ end }}">
<div class="flex-even markdown-inner"> {{ range $index, $content := split .InnerDeindent "<--->" }}
{{ . | safeHTML }} {{- $grow := default 1 (index $ratio $index) -}}
<div class="flex-even markdown-inner" style="flex-grow: {{ $grow }};">
{{ $content | safeHTML }}
</div> </div>
{{ end }} {{ end }}
</div> </div>