Star

MIT License
Copyright © 2020
CONNECT-platform

linkCollapse

The Collapse component allows you to have some collapsible content:

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

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

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

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

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

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

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

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

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

10link> 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:

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

2link>

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

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

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

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

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

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

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

10link> eum fugiat quo voluptas nulla pariatur?

11link>

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

13link> >

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

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

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

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

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

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

20link> > 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

21link> > 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
1link[Home](/)

2link[Overview](/docs/overview)

3link[CLI](/docs/cli)

4link[Theme](/docs/theme)

5link

6link> :Collapse label=Markdown

7link>

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

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

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

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

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

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

14link

15link> :Collapse label=Code Features

16link>

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

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

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

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

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

22link

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

24link

25link> :Collapse label=Configuration

26link>

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

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

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

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

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

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

33link> [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
1link[Home](/)

2link

3link> :Collapse label=Stuff

4link>

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

6link> [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
1link[Home](/)

2link

3link> :Collapse label=Stuff

4link>

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

6link> > :Collapse label=Spec

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

8link> > [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.

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

2link>

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

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

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

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

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

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

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

10link> 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