Skip to main content
All CollectionsAuthor HelpMarkdown and Markua
I want the description page for a Part included my sample book, but when I include a Part in the sample book, all the chapters in the Part show up in the sample book! How can I fix that?
I want the description page for a Part included my sample book, but when I include a Part in the sample book, all the chapters in the Part show up in the sample book! How can I fix that?

Keywords: part, sample, cascade: false, exclude

Leanpub Support avatar
Written by Leanpub Support
Updated over a week ago
I want the description page for a Part included my sample book, but when I include a Part in the sample book, all the chapters in the Part show up in the sample book! How can I fix that?

In Markua, you can create a part like this:


{class: part}
# Part One

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

# Chapter One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

## Section One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

# Chapter Two

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

To include this whole part in your sample book, you would add {sample: true} to the part header like this:
โ€‹


{class: part, sample: true}
# Part One

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

# Chapter One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

## Section One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

# Chapter Two

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

However, if you just want to include in the sample book the paragraph directly under the Part One header, but not anything under Chapter One, Section One, or Chapter Two, you would add cascade: false to the part header like this:
โ€‹


{class: part, sample: true, cascade: false}
# Part One

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

# Chapter One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

## Section One

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

# Chapter Two

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

With these settings, the Lorem ipsum paragraph would be in the sample, but none of the Ut enim ad paragraphs would be in the sample.

For more information about book samples, see this section in the Markua Spec: Conditional Inclusion Attributes on Headings.


If you have any feedback or questions about this article, please email the Leanpub team about it at hello@leanpub.com!

If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!

Are you interested in self-publishing, and creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes: http://help.leanpub.com/en/articles/3088382-quick-walkthroughs-for-getting-started-on-a-leanpub-book

Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!

To learn about amazing new books and authors, subscribe to our YouTube channel here: https://www.youtube.com/leanpub.

You can also follow Leanpub in lots of other places!

Did this answer your question?