gitbook-plugin-folding-content
This plugin provide a tag to create a folding content in your GitBook.
Just like this:
He wishes for the Cloths of Heaven
by W.B.Yeats
Had I the heavens’ embroidered cloths,
Enwrought with golden and silver light,
The blue and the dim and the dark cloths
of night and light and the half-light,
I would spread the cloths under your feet.
But I, being poor, have only my dreams;
I have spread my dreams under your feet,
Tread softly because you tread on my dreams.
Install
Add it to your book.json
configuration:
Add then run install
:
gitbook install
Usage
{% fold <parmas> %}
<content>
{% endfold%}
<content>
is anything that you want it to be folded,it can be Markdown or HTML.
<params>
can be the following options:
param | type | desc |
---|---|---|
summary | String | Summary of the content |
open | Boolean | Open by default |
style | String | Style of the details tag |
e.g.
- Default
{% fold %}## He wishes for the Cloths of Heaven by W.B.Yeats > Had I the heavens’ embroidered cloths, > Enwrought with golden and silver light, > The blue and the dim and the dark cloths > of night and light and the half-light, > I would spread the cloths under your feet. > But I, being poor, have only my dreams; > I have spread my dreams under your feet, > Tread softly because you tread on my dreams.{% endfold %}
- Set param
{% fold summary="He wishes for the Cloths of Heaven", open=true, style="background: #fafafa;padding: 10px 20px;" %}by W.B.Yeats > Had I the heavens’ embroidered cloths, > Enwrought with golden and silver light, > The blue and the dim and the dark cloths > of night and light and the half-light, > I would spread the cloths under your feet. > But I, being poor, have only my dreams; > I have spread my dreams under your feet, > Tread softly because you tread on my dreams.{% endfold %}
Demo
- Run the following command in shell:
cd demogitbook installgitbook serve --lrport 60032
- And then open
http://localhost:4000
in your browser.