alex-shpak / hugo-book

Hugo documentation theme as simple as plain book
https://hugo-book-demo.netlify.app
MIT License
3.43k stars 1.17k forks source link

Introduce shortcodes #39

Closed alex-shpak closed 5 years ago

alex-shpak commented 5 years ago

I think to introduce some shortcodes for documentation. If you have some ideas please post here.

What I have now in mind:

jordibares commented 5 years ago

Hi Alex, sounds great.

I would say that tabs, accordions, buttons, notices, margins and a few others would be very handy for a book.

Check the components I have put together, if there is anything you need, let me know. https://www.houdiniguides.com/docs/collaborating/authoring/components

In terms of inspiration, I like a lot this https://edwardtufte.github.io/tufte-css/

I hope this helps

alex-shpak commented 5 years ago

Some shortcodes are coming https://github.com/alex-shpak/hugo-book/tree/feature/shortcodes

shortcodes

alex-shpak commented 5 years ago

Can't make my mind, maybe somebody has opinion.

I came with two syntaxes for columns view. Less verbose, but reserves --- separator in markdown

{{< columns >}}
# Left Content
Lorem markdownum insigne.
---
# Mid Content
Lorem markdownum insigne.
---
# Right Content
Lorem markdownum insigne.
{{< /columns >}}

More verbose but more clear, with child shortcode.

{{< columns >}}

{{< column >}}
# Left Content
Lorem markdownum insigne. 
{{< /column >}}

{{< column >}}
# Mid Content
Lorem markdownum insigne. 
{{< /column >}}

{{< column >}}
# Right Content
Lorem markdownum insigne. 
{{< /column >}}

{{< /columns >}}

I like first one, but afraid of magic.