Star

MIT License
Copyright © 2020
CONNECT-platform

linkCollapse

The Collapse component allows you to have some collapsible content:

1> :Collapse label=Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC

2> <!--> The whitespace is important -->

3> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,

4> eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam

5> voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem

6> sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non

7> numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis

8> nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel

9> eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem

10> eum fugiat quo voluptas nulla pariatur?

written by Cicero in 45 BCchevron_right

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

You can also have nested collapses within each other:

1> :Collapse label=Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC

2>

3> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,

4> eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam

5> voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem

6> sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non

7> numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis

8> nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel

9> eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem

10> eum fugiat quo voluptas nulla pariatur?

11>

12> > :Collapse label=1914 translation by H. Rackham

13> >

14> > But I **MUST** explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you

15> > a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder

16> > of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do

17> > not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves

18> > or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil

19> > and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise,

20> > except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that

21> > has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?

written by Cicero in 45 BCchevron_right

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

1914 translation by H. Rackhamchevron_right

But I MUST explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?

The Collapse component is specifically designed to be used in the table of contents markdown, when you have long list of entries and want to categorize them nicely. For example, this is the actual code of the ToC of the docs you are reading right now:

docs/md/_toc.md
1[Home](/)

2[Overview](/docs/overview)

3[CLI](/docs/cli)

4[Theme](/docs/theme)

5

6> :Collapse label=Markdown

7>

8> [Markdown Overview](/docs/markdown/overview)

9> [Buttons](/docs/markdown/buttons)

10> [Tabs](/docs/markdown/tabs)

11> [Collapse](/docs/markdown/collapse)

12> [ToC Navigation](/docs/markdown/toc-nav)

13> [Custom Components](/docs/markdown/custom-components)

14

15> :Collapse label=Code Features

16>

17> [Code Features Overview](/docs/code/overview)

18> [Highlights](/docs/code/highlights)

19> [Hints](/docs/code/hints)

20> [References](/docs/code/refs)

21> [Top-Bar](/docs/code/wmbar)

22

23[Images & Assets](/docs/assets)

24

25> :Collapse label=Configuration

26>

27> [Config Overview](/docs/config/overview)

28> [Entry Files](/docs/config/entry)

29> [Output Files](/docs/config/output)

30> [Page Config](/docs/config/page)

31> [Bundle Config](/docs/config/bundle)

32> [Markdown Config](/docs/config/markdown)

33> [Miscellaneous](/docs/config/misc)


linkTable of Contents

The main intention behind the Collapse component was to allow organization of links in table of contents (the side-bar):

docs/_toc.md
1[Home](/)

2

3> :Collapse label=Stuff

4>

5> [Overview](/some-folder/overview)

6> [Spec](/some-folder/spec)

As mentioned above, Collapse can be used in a nested manner, so you can have your desired level of depth in your ToC:

docs/_toc.md
1[Home](/)

2

3> :Collapse label=Stuff

4>

5> [Overview](/some-folder/overview)

6> > :Collapse label=Spec

7> > [Spec Overview](/some-folder/spec/overview)

8> > [Spec of This](/some-folder/spec/this)


linkDefault State

You can set the default state of a Collapse by setting its default property. Its values can either be open or close.

1> :Collapse label=Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC, default=open

2>

3> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,

4> eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam

5> voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem

6> sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non

7> numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis

8> nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel

9> eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem

10> eum fugiat quo voluptas nulla pariatur?

Section 1.10.32 of "de Finibus Bonorum et Malorum"chevron_right

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?

CollapseTable of ContentsDefault State

Home Overview CLI Theme

Markdownchevron_right
Code Featureschevron_right

Images & Assets

Configurationchevron_right
Customizationchevron_right