The Leanpub Manual
The Leanpub Manual
Buy on Leanpub
The Leanpub Manual

Table of Contents

Introduction

Welcome to The Leanpub Manual!

Where To Get Help

Markua
To learn how to write in Markua on Leanpub, see The Markua Manual.
Leanpub Flavoured Markdown
To learn how to write in Leanpub Flavoured Markdown, see The Leanpub Flavoured Markdown Manual.
Getting Started
To learn how to get started with the various writing modes, read this manual.
Help Center
We have lots of great documentation and FAQs in our Help Center at http://help.leanpub.com. Basically, whenever we’re asked a good, general question by an author or reader, we post a generalized version of the answer there as well.
The Leanpub Author Forum
Just as every Leanpub book can have a forum, we have a forum for Leanpub authors as well. Join the Leanpub Author Forum and post your question there. Our authors enjoys helping each other out, and we pay attention too. Please ask all general questions there.
Email hello@leanpub.com
If you have a specific problem that you can’t find the answer to in our Help Center and don’t want to post on the forum, email us at hello@leanpub.com and we’ll be happy to help you.

About The Leanpub Manual

This is a short manual. It contains three things:

  1. A description of the various writing modes.
  2. A discussion of Leanpub Flavoured Markdown vs. Markua
  3. Getting Started instructions for each writing mode.

The Getting Started instructions in this many vary based on the writing mode of your book. So, you should only read the Getting Started chapter for the specific writing mode you have chosen.

If you already know which writing mode you want to choose, and if the Leanpub Flavoured Markdown vs. Markua decision doesn’t apply (or you want to save it for later), you can skip to the Getting Started chapter for that writing mode now.

If you want to first learn a bit about the different writing modes, and a bit about the Leanpub Flavoured Markdown vs. Markua decision, read on.

The 7 Writing Modes of Leanpub

There are 7 different writing modes on Leanpub:

  1. Dropbox
  2. GitHub
  3. Bitbucket
  4. Leanpub In-Browser Text Editor
  5. Leanpub Visual Editor
  6. Google Docs
  7. Bring Your Own Book

In the first four writing modes, you write in plain text. This plain text can be formatted in either Leanpub Flavoured Markdown (LFM) or Markua. Both of these are dialects of Markdown, which was created as a way for bloggers to easily write blog posts. (Markdown is easier to write than HTML.)

To be clear, these are the only four writing modes where you write in LFM or Markua:

  1. Dropbox
  2. GitHub
  3. Bitbucket
  4. Leanpub In-Browser Text Editor

In the last three writing modes (Leanpub Visual Editor, Google Docs, and Bring Your Own Book), you don’t write in plain text, so you don’t write in either Leanpub Flavoured Markdown or Markua. Instead, here’s how you write in the last three writing modes:

  • Our Visual Editor is a minimalist visual typewriter where you see the formatting. It’s great for novels, and terrible at everything else.
  • In Google Docs you write in a WYSIWYG mode. (No, you don’t write LFM or Markua in it. You write like how you normally do in Google Docs.)
  • In Bring Your Own Book mode, you just upload PDF, EPUB and MOBI files that you produce however you want, such as using Word, Pages or LaTeX.

So, if you’re using Dropbox, GitHub or Bitbucket, you’ll be able to use Leanpub Flavoured Markdown or Markua. You can change back and forth between them as often as you want. It’s as easy as clicking a checkbox.

Reasons to Use GitHub or Bitbucket

If you’re a programmer and comfortable with Git, we recommend you choose GitHub or Bitbucket over Dropbox. Here are 5 reasons why:

  1. You can run your own version control, which is great for collaborating with co-authors and keeping track of versions for yourself.
  2. You can also choose a Dropbox folder for the generated preview and published versions of your book to be automatically copied into.
  3. You can set up webhooks so that whenever you commit and push, we automatically preview (or, if you live on the edge, automatically publish) your book.
  4. You can use different branches for preview and publish, so that you can have a bugfix branch (say master) and a development branch for the next version of your book.
  5. You can use a different branch for a course, based on the same repository as the book. (Again, courses require that you use Markua, so if you’re writing a book which you think might be a good course, that’s another reason to use it.)

If you’re not a programmer, we recommend using Dropbox mode. Every time you preview or publish, we store a version of your manuscript as a backup, so we recommend you preview and publish often.

Markua vs. Leanpub Flavoured Markdown

On Leanpub, there are two ways to write in plain text:

  1. Markua
  2. Leanpub Flavoured Markdown (LFM)

Leanpub Flavoured Markdown came first; Markua is its replacement. Both LFM and Markua are dialects of Markdown. Markua is newer and better than LFM.

To write in Markua or LFM, you need to be in Dropbox, GitHub or Bitbucket writing mode, or you need to be writing in the Leanpub In-Browser Text Editor.

There are six good reasons to write a book in Markua:

  1. Markua is better than LFM. A lot better. Markua fixes the many mistakes we made with LFM.
  2. Markua is the future of Leanpub.
  3. Markua has more features than LFM.
  4. If you want to create a course on Leanpub, you need to use Markua.
  5. The Leanpub In-Browser Text Editor is better with Markua now, and it’s going to be way better soon. (We’re working on an upgrade to the Leanpub In-Browser Text Editor which will only be available for Markua books.)
  6. The Markua Manual is newer and better than the Leanpub Flavoured Markdown Manual.

There are two good reasons to write a book in LFM:

  1. You already started your book in LFM and you don’t want to convert it yet.
  2. You are writing a translation of a book which is written in LFM.

Switching Writing Modes

If you have an existing Leanpub book and you want to switch writing modes, you go here:

Author > Books > (your book) > Settings > Writing Mode

Again, Google Docs, our Visual Editor and Bring Your Own Book do not support Markua or LFM formatting.

Once you’ve chosen an appropriate writing mode, you then can switch between the Markua and LFM dialects of Markdown here:

Author > Books > (your book) > Settings > Markdown Dialect

Getting Started with Dropbox Writing Mode

You can write a Leanpub book using Dropbox. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the Dropbox writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating a Book in Dropbox Writing Mode

Go to https://leanpub.com/create/book to create a new book in Dropbox.

Next, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, you don’t need to do anything, because writing on your computer in Dropbox is selected by default.

When you scroll down, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

In Dropbox mode, you should use the same email address for Leanpub as you do for your Dropbox account. If you don’t have Dropbox account, you can get one for free here:

Tick the box to prove you’re a person and click the blue button to finish creating your new Dropbox book.

You will now see that you are on the Getting Started page for your book. You will see a progress bar at the top of the page, while our book generators are creating your new book.

If you use bookmarks in your web browser, we recommend you bookmark this page in your web browser in a bookmark folder for your book, but this is not required.

Look at the Author “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Author options.

Setting Up Your Book In Dropbox

When you clicked the button to create your book, Leanpub’s Bookbot created a folder for your book in Dropbox, and sent a Dropbox shared folder invitation to the email address you used when you signed up.

It may take one or two minutes for you to receive the Dropbox shared folder invitation.

To accept the invitation, you can click on the Dropbox icon in the menu bar for your computer (these images are on a Mac; if you are using a PC, it will look different.)

Click “Add to Dropbox.”

Alternatively, you can accept the invitation by logging in to Dropbox. You should see the book invitation near the top of the “Home” screen:

If you click on the invitation, you will be able to click “Add to Dropbox:”

Another way to accept the Dropbox invitation is in your email. Here is what it looks like in Gmail:

If you open the email, you should see a button that takes you to your Dropbox account in your browser, and then lets you accept the invitation:

Within a minute or two, in your Dropbox folder on your computer, you should see the folder for your new book:

Creating a Preview

To create your first preview, using the default content we included in your new book, go back the Getting Started page for your book:

Click on “Getting Started” at the top, and you will see the Author menu. It will look something like this:

Click on “Preview or Publish” under the “Book Info” column, and you will see something like this:

Select “Preview’ in the column to the right, and you will go to the “Preview” page for your book:

Click the “Create Preview” button. You will go to a page like this, where you will see a progress bar at the top:

When the preview process is complete, you will see download links for the preview, in a variety of formats:

Click on the links to see what your book looks like in the various formats.

Writing in Your Book

Open your book folder in Dropbox. You’ll see a folder named manuscript inside it. This is where you write your book.

If you have just created a new book, the manuscript folder will contain four files with the file name extension .txt. There will also be a folder called resources:

Book.txt
chapter1.txt
chapter2.txt
chapter3.txt
resources

Open the file called chapter1.txt by double-clicking on it. You can also open the file in any specific text editing software you prefer.

Next, delete the contents of the file and type:

# Chapter 1

Hello, world!

In your text editor, save this change.

Make a New Preview of Your Book

The next time you create a preview of your book, you will see that Chapter One has changed, and it now says “Hello, world!”

To create a new preview, repeat what you did when you made your first preview, by using the Author menu in Leanpub to go to:

Author > Books > [Your Book Title] > Preview or Publish > Preview

How the List of Files in Book.txt Works

When you create a preview, you may not want our book generators to use all of the files in your manuscript folder. Also, you may want the contents of your book to reflect a different order than the order they are presented in, in your manuscript folder.

So, whenever you create a preview, our friendly bookbots generate your book using only the files that you have listed in the Book.txt file that is in your book’s manuscript folder, and they use those files in the order that you have listed them.

Let’s see how this works.

First, delete a file. In your book’s manuscript folder, select the file named chapter3.txt and delete it.

Now, let’s rename a file. The files listed in Book.txt can have any name you want to give them. (To be clear, the files do not have to include the word “chatper” in the file name.)

In your book’s manuscript folder, select the file chapter2.txt.

Now, change the file name to conclusion.txt by right-clicking on the file and selecting “Rename.” **(Your computer might show a different word than “Rename,” but there should be an option to change any file’s name if you right-click on the file.)

Now that we have changed the files in the manuscript folder, we need to update the list of files in the Book.txt file.

Using your text editor, open the Book.txt file.

In the Book.txt file, you will see this list of files, like this:

chapter1.txt
chapter2.txt
chapter3.txt

First, delete chapter2.txt. Then, delete chapter3.txt.

Next, on the second line, type conclusion.txt.

Now, your list of files in Book.txt will look like this:

chapter1.txt
conclusion.txt

Next, open the file conclusion.txt.

Now, delete everthing in the file, and type this:

# Conclusion

This book is **done** and ready for *the world to see*, hooray!

Finally, save this change your text editor.

Go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

Congratulations! You’ve completed the Getting Started tutorial for writing a book in Leanpub using Dropbox.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with Git and GitHub Writing Mode

You can write a Leanpub book using Git and GitHub. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the GitHub writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating Your Book’s GitHub Repository

The first thing you need to is create a repository for your book on GitHub.

To do this, go to https://github.com and sign in.

Click the green “New” button to the right of the list of Repositories.

This will take you to a page where you can set up a new repository for your Leanpub book.

By default, “Public” will be selected. This means anyone can see your repository. Select “Private” if you don’t want anyone to be able to see your repository.

Next, type a name for your repository.

Click the green “Create repository” button. If you want, you can click the checkbox to initialize the repository with a README. It doesn’t matter, but this will get rid of the warning message later.

This will take you to a “Quick setup” page:

Select the repository information and copy it, or click the little copy-to-clipboard icon button.

Go to the command line on your computer. In this tutorial we’re using a Mac, so we use Terminal.

Go to the folder on your computer where you want to clone your GitHub repository. In this tutorial, that is a folder called repos.

Type git clone and paste in the repository information you copied on GitHub, and hit Enter.

After a moment, you will see a message saying that the repository has been cloned.

Creating a Book in GitHub Writing Mode

Go to https://leanpub.com/create/book to create a book in GitHub writing mode.

First, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

In this case, the URL that was automatically generated was already taken. This will be rare for you, but is a lot more common for us when making tutorials!

If a URL you want is already taken, you can add hyphens or numbers to create a URL that is close to it, but it’s better to use other words so people don’t get confused between your book and someone else’s!

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “Using Git and GitHub.”

Scroll down and you will see a box to enter your GitHub username, followed by a forward slash / and your GitHub repo name.

Enter your GitHub username, followed by a forward slash / and your GitHub repo name.

When you scroll down further, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new GitHub book.

You will now see that you are on the Getting Started page for your book.

If you use bookmarks in your web browser, we recommend you bookmark this page in your web browser in a bookmark folder for your book, but this is not required.

Look at the Book Tools “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Book Tools options.

Adding Leanpub As A Collaborator on Your Book’s GitHub Repository

Go back to the GitHub page for your book’s GitHub repository.

Click on “Settings” near the top right, to go to the “Settings” page for the repository.

Click on “Collaborators” in the menu on the left, to go to the “Collaborators” page for the repository.

Type “leanpub” in the search box to find the leanpub GitHub user.

Select the “leanpub” user and click the “Add collaborator” button.

You will see that Leanpub has been added as a collaborator on the repository.

Adding Default Content to Your GitHub Repository

Next, you need to add some content to your GitHub repository. (Leanpub NEVER commits to your GitHub repository, since we do not want to cause merge conflicts.)

Go back to the Getting Started page for your book.

Scroll down to Step 2 and click the this zip file link, or click the link in this sentence in the tutorial. This will download the default content to your computer.

You will now find the file wherever you store downloads on your computer.

Double-click the folder to unzip it.

Copy the “manuscript” folder. Then, go to the cloned GitHub repository on your computer, and paste the “manuscript” folder into the repository.

Go back to the command line on your computer and change to the GitHub repository for your book.

Type git add . to the content using Git.

Type git commit -m "adding default manuscript folder". You will see messages indicating that the content has been committed.

Type git push to push the commit to the repository on GitHub.

Creating a Preview

To create your first preview, using the default content we included in your new book, go back the Getting Started page for your book:

Click on “Getting Started” at the top, and you will see your the Book Tools menu. It will look something like this:

Click on “Preview or Publish” under the “Book Info” column, and you will see something like this:

Select “Preview’ in the column to the right, and you will go to the “Preview” page for your book:

Click the “Create Preview” button. You will go to a page like this, where you will see a progress bar at the top:

When the preview process is complete, you will see download links for the preview, in a variety of formats:

Click on the links to see what your book looks like in the various formats.

Writing in Your Book

Open your book folder in Github. You’ll see a folder named manuscript inside it. This is where you write your book.

If you have just created a new book, the manuscript folder will contain four files with the file name extension .txt. There will also be a folder called resources:

Book.txt
chapter1.txt
chapter2.txt
chapter3.txt
resources

Open the file called chapter1.txt by double-clicking on it. You can also open the file in any specific text editing software you prefer.

Next, delete the contents of the file and type:

# Chapter 1

Hello, world!

In your text editor, save this change.

Make a New Preview of Your Book

Next, you need to commit your changes and push them to GitHub.

On the command line, type git commit -m "first tutorial steps" and hit the return key.

Next, type ‘git push’ and hit the return key.

The next time you create a preview of your book, you will see that Chapter One has changed, and it now says “Hello, world!”

To create a new preview, repeat what you did when you made your first preview, by using the Author menu in Leanpub to go to:

Author > Books > [Your Book Title] > Preview or Publish > Preview

How the List of Files in Book.txt Works

When you create a preview, you may not want our book generators to use all of the files in your manuscript folder. Also, you may want the contents of your book to reflect a different order than the order they are presented in, in your manuscript folder.

So, whenever you create a preview, our friendly bookbots generate your book using only the files that you have listed in the Book.txt file that is in your book’s manuscript folder, and they use those files in the order that you have listed them.

Let’s see how this works.

First, delete a file. In your book’s manuscript folder, select the file named chapter3.txt and delete it.

Now, let’s rename a file. The files listed in Book.txt can have any name you want to give them. (To be clear, the files do not have to include the word “chatper” in the file name.)

In your book’s manuscript folder, select the file chapter2.txt.

Now, change the file name to conclusion.txt by right-clicking on the file and selecting “Rename.” **(Your computer might show a different word than “Rename,” but there should be an option to change any file’s name if you right-click on the file.)

Now that we have changed the files in the manuscript folder, we need to update the list of files in the Book.txt file.

Using your text editor, open the Book.txt file.

In the Book.txt file, you will see this list of files, like this:

chapter1.txt
chapter2.txt
chapter3.txt

First, delete chapter2.txt. Then, delete chapter3.txt.

Next, on the second line, type conclusion.txt.

Now, your list of files in Book.txt will look like this:

chapter1.txt
conclusion.txt

Next, open the file conclusion.txt.

Now, delete everthing in the file, and type this:

# Conclusion

This book is **done** and ready for *the world to see*, hooray!

Finally, save this change your text editor.

Next, you need to commit your changes and push them to GitHub.

On the command line, type git commit -m "finishing tutorial" and hit the return key.

Next, type ‘git push’ and hit the return key.

Now, go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

Congratulations! You’ve completed the Getting Started tutorial for writing a book in Leanpub using GitHub.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with Git and Bitbucket Writing Mode

You can write a Leanpub book using Git and Bitbucket. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the Bitbucket writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating Your Book’s Bitbucket Repository

The first thing you need to is create a repository for your book on Bitbucket.

To do this, go to https://bitbucket.org and sign in.

Click the + plus sign to the left in the menu at the top of the page.

Under “CREATE”, select “Repository.”

This will take you to a page where you can set up a new repository for your Leanpub book.

By default, “Private” will be selected. Leave this set to “Private” if you don’t want anyone to be able to see your repository.

Next, type a name for your repository.

Click the blue “Create repository” button.

This will take you to a “Get started quickly” page:

Select the repository information and copy it.

Go to the command line on your computer. In this tutorial we’re using a Mac, so we use Terminal.

Go to the folder on your computer where you want to clone your Bitbucket repository. In this tutorial, that is a folder called repos.

Paste in the repository information you copied on Bitbucket, and hit Enter.

You may see a message asking if you are sure you want to connect. If you are sure, type “yes” and hit return.

After a moment, you will see a message saying that the repository has been cloned.

Creating a Book in Bitbucket Writing Mode

Go to https://leanpub.com/create/book to create a book in Bitbucket writing mode.

First, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “Using Git and Bitbucket.”

Scroll down and you will see a box to enter your Bitbucket username, followed by a forward slash / and your Bitbucket repo name.

Enter your Bitbucket username, followed by a forward slash / and your Bitbucket repo name.

When you scroll down further, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new Bitbucket book.

You will now see that you are on the Getting Started page for your book.

If you use bookmarks in your web browser, we recommend you bookmark this page in your web browser in a bookmark folder for your book, but this is not required.

Look at the Author “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Author options.

Adding Leanpub As A Collaborator on Your Book’s Bitbucket Repository

Go back to the Bitbucket page for your book’s Bitbucket repository.

Click on “Settings” in the menu to the left, to go to the “Settings” page for the repository.

Click on “User and group access” in the menu on the left, to go to the “Collaborators” page for the repository.

Type “Leanpub” in the search box.

Select the “Leanpub” option and click the “Add” button.

You will see that Leanpub has been added as a collaborator on the repository.

Adding Default Content to Your Bitbucket Repository

Next, you need to add some content to your Bitbucket repository. (Leanpub NEVER commits to your Bitbucket repository, since we do not want to cause merge conflicts.)

Go back to the Getting Started page for your book.

Scroll down to Step 2 and click the this zip file link, or click the link in this sentence in the tutorial. This will download the default content to your computer.

You will now find the file wherever you store downloads on your computer.

Double-click the folder to unzip it.

Copy the “manuscript” folder. Then, go to the cloned Bitbucket repository on your computer, and paste the “manuscript” folder into the repository.

Go back to the command line on your computer and change to the Bitbucket repository for your book.

Type git add . to the content using Git.

Type git commit -m "adding default manuscript folder". You will see messages indicating that the content has been committed.

Type git push origin master to push the commit to the repository on Bitbucket.

Creating a Preview

To create your first preview, using the default content we included in your new book, go back the Getting Started page for your book:

Click on “Getting Started” at the top, and you will see your the Author menu. It will look something like this:

Click on “Preview or Publish” under the “Book Info” column, and you will see something like this:

Select “Preview’ in the column to the right, and you will go to the “Preview” page for your book:

Click the “Create Preview” button. You will go to a page like this, where you will see a progress bar at the top:

When the preview process is complete, you will see download links for the preview, in a variety of formats:

Click on the links to see what your book looks like in the various formats.

Writing in Your Book

Open your book folder in Bitbucket. You’ll see a folder named manuscript inside it. This is where you write your book.

If you have just created a new book, the manuscript folder will contain four files with the file name extension .txt. There will also be a folder called resources:

Book.txt
chapter1.txt
chapter2.txt
chapter3.txt
resources

Open the file called chapter1.txt by double-clicking on it. You can also open the file in any specific text editing software you prefer.

Next, delete the contents of the file and type:

# Chapter 1

Hello, world!

In your text editor, save this change.

Make a New Preview of Your Book

Next, you need to commit your changes and push them to Bitbucket.

On the command line, type git commit -m "first tutorial steps" and hit the return key.

Next, type ‘git push’ and hit the return key.

The next time you create a preview of your book, you will see that Chapter One has changed, and it now says “Hello, world!”

To create a new preview, repeat what you did when you made your first preview, by using the Author menu in Leanpub to go to:

Author > Books > [Your Book Title] > Preview or Publish > Preview

How the List of Files in Book.txt Works

When you create a preview, you may not want our book generators to use all of the files in your manuscript folder. Also, you may want the contents of your book to reflect a different order than the order they are presented in, in your manuscript folder.

So, whenever you create a preview, our friendly bookbots generate your book using only the files that you have listed in the Book.txt file that is in your book’s manuscript folder, and they use those files in the order that you have listed them.

Let’s see how this works.

First, delete a file. In your book’s manuscript folder, select the file named chapter3.txt and delete it.

Now, let’s rename a file. The files listed in Book.txt can have any name you want to give them. (To be clear, the files do not have to include the word “chatper” in the file name.)

In your book’s manuscript folder, select the file chapter2.txt.

Now, change the file name to conclusion.txt by right-clicking on the file and selecting “Rename.” **(Your computer might show a different word than “Rename,” but there should be an option to change any file’s name if you right-click on the file.)

Now that we have changed the files in the manuscript folder, we need to update the list of files in the Book.txt file.

Using your text editor, open the Book.txt file.

In the Book.txt file, you will see this list of files, like this:

chapter1.txt
chapter2.txt
chapter3.txt

First, delete chapter2.txt. Then, delete chapter3.txt.

Next, on the second line, type conclusion.txt.

Now, your list of files in Book.txt will look like this:

chapter1.txt
conclusion.txt

Next, open the file conclusion.txt.

Now, delete everthing in the file, and type this:

# Conclusion

This book is **done** and ready for *the world to see*, hooray!

Finally, save this change your text editor.

Next, you need to commit your changes and push them to Bitbucket.

On the command line, type git commit -m "finishing tutorial" and hit the return key.

Next, type ‘git push’ and hit the return key.

Now, go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

Congratulations! You’ve completed the Getting Started tutorial for writing a book in Leanpub using Bitbucket.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with In-Browser Plain Text Editor Writing Mode

You can write a Leanpub book using the In-Browser Plain Text Editor writing mode. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the In-Browser Plain Text Editor writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating a Book in In-Browser Plain Text Editor Writing Mode

Go to https://leanpub.com/create/book to create a book in In-Browser Plain Text Editor.

Next, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “In your browser on Leanpub”:

Scroll down and you will see the “How do you want to write?” options. Select “In our Plain Text Editor”:

When you scroll down, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new In-Browser Plain Text Editor book.

You will now see that you are on the Getting Started page for your book.

If you use bookmarks in your web browser, we recommend you bookmark this page in your web browser in a bookmark folder for your book, but this is not required.

Look at the Author “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Author options.

Creating a Preview

Click on “Getting Started” at the top, and you will see your the Author menu. It will look something like this:

Click on “Preview or Publish” under the “Book Info” column, and you will see something like this:

Select “Preview’ in the column to the right, and you will go to the “Preview” page for your book:

Click the “Create Preview” button. You will go to a page like this, where you will see a progress bar at the top:

When the preview process is complete, you will see download links for the preview, in a variety of formats:

Click on the links to see what your book looks like in the various formats.

Where You Write Your Book

To see where you write your book, click on “Download Preview” in the menu at the top of the page:

To go to the “Write” page for your book, on “Write” at the bottom of the second column from the right:

Select “chapter1.txt” in the menu at the left to see some of the default content we provide when you create a new book.

This is where you write your book, by creating chapters in the menu to the left, clicking on them, and then writing in the browser.

Writing in Your Book

In this step of the tutorial we will show you how to write in your book and how to add and delete chapters.

When you are in the Write tab, you will see a menu of files at the top left.

You will see that we have provided three default chapters:

chapter1.txt
chapter2.txt
chapter3.txt

First, let’s delete a chapter. Hover your mouse over chapter3.txt and click on the black X that you will see. This will delete the chapter. (It may take a moment for the page to update.)

Next, let’s create a new chapter.

In the menu on the left, click on the + sign in the circle.

Then, in the box that says “Type a filename..”, type:

Conclusion

Finally, click on the blue “Create” button.

The menu at the top left will now show this list of files:

chapter1.txt
chapter2.txt
Conclusion

Now, you will see a blinking cursor in the Write tab. Type the following:

# Conclusion


This book is **done** and ready for *the world to see*, hooray!

Go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

Congratulations! You’ve completed the Getting Started tutorial for writing a book in Leanpub using our In-Browser Plain Text Editor.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with Visual Editor Writing Mode

You can write a Leanpub book using the Visual Editor writing mode. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the Visual Editor writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book; you’ll be shown how to get to that page at the end of these instructions.

Creating a Book in Visual Editor Writing Mode

Go to https://leanpub.com/create/book to create a book in Visual Editor.

Next, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “In your browser on Leanpub.”

If you scroll down, you will see that the “In our Visual Editor” option is selected by default.

When you scroll down, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new Visual Editor book.

You will now be taken directly to the Visual Editor, where you will see some default content.

You type directly into the Visual Editor here, to write your book.

Creating a Preview

Click on “Write” at the top, and you will see your Book Tools menu. It will look something like this:

Click on “Preview or Publish” in the menu, and you will see something like this:

Select “Preview’ in the column to the right, and you will go to the “Preview” page for your book:

Click the “Create Preview” button. You will go to a page like this, where you will see a progress bar at the top:

When the preview process is complete, you will see download links for the preview, in a variety of formats:

Click on the links to see what your book looks like in the various formats.

Writing in Your Book

To write in our Visual Editor, click on the “Write” item in the Author menu for your book here:

Author > Books > [Your Book Title] > Write

When you go to the Visual Editor, you will find some default content, and you will see that the cursor is blinking. Type this:

Hello, world!

Go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

In the next step of this tutorial, we will show you how you can change the sections that are included in your book.

Go back to the Visual Editor.

Click the word “Menu” you will see at the top left.

If this is a new book, you will see that we have provided three default chapters:

Chapter 1
Chapter 2
Chapter 3

First, let’s delete a section. Hover your mouse over Chapter 3. Then, click on the red X that you will see. This will delete the chapter. (You may need to refresh your web page, or leave it and come back, to see the change.)

The next time you create a preview, you will see that this chapter is no longer included in your book.

Next, let’s change the name of a chapter.

In the menu on the left, click on Chapter 2. Then, at the top of the Visual Editor, select the words Chapter 2 and type:

Conclusion

This book is done and ready for the world to see, hooray!

The menu at the top left will now show this list of files:

Chapter 1
Chapter 2
Conclusion
```

Go back to the preview page for your book at:

Author > Books > [Your Book Title] > Preview or Publish > Preview

The next time you create a preview, it will reflect the changes you have made.

Congratulations! You’ve completed the Getting Started tutorial for writing a book in Leanpub using the Leanpub Visual Editor.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with Google Docs Writing Mode

You can write a Leanpub book using Google Docs. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the Google Docs writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating a Book in Google Docs Writing Mode

Go to https://leanpub.com/create/book to create a book in Google Docs.

Next, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “In Google Docs.”

When you scroll down, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new Google Docs book.

You will now see that you are on the Getting Started page for your book.

Look at the Book Tools “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Book Tools options.

Setting Up Your Book In Google Docs

You will need to add the Leanpub Add-on to your Google Drive, if you have not done so already.

To install the Leanpub Add-on, log in to your Google account in your browser and follow this link.

You will be taken to a page that looks like this:

Click the button at the top right (in the screenshot above it says “Free”).

You will then be asked to grant Leanpub access to your account:

Go back to the Getting Started page for your book and look for the blue button that says “Setup Google Drive”:

Before you click the button, please make sure that in your browser, you are signed in to your Google account.

To do this, open a new tab in the same browser, and go to Google. Click on the avatar at the top right and you will see what account you are signed in to:

Once you’ve confirmed you’re signed in to the correct Google account, in the same browser, go back to the Getting Started page for your book, click the blue button that says “Setup Google Drive.” It will take a moment for Leanpub to do its magic:

When the process is complete, you will go back to the top of the page. Scroll down to Step 4 and click the link that says “Click here.”

This will take you to the folder Leanpub has set up for your book in your Google Drive.

You will see something like this if you are viewing files as a list:

If you are not in list mode, you will see something like this:

What you are seeing is the three default chapters Leanpub has included in your book. You should read all of these chapters, because they explain in detail all of the features you can use in Google Docs when you are creating a Leanpub book.

(To be clear, not all of the features you will find in Google Docs will work in a Leanpub book. You should make your book look like what you see in these default chapters.)

Starting the Leanpub Add-on

Next, double-click on Chapter One to see the document:

Click on the “Add-ons” item in the menu for the document:

Select “Leanpub” and then “Start.”

You will then see the Leanpub sidebar appear to the right.

You may be asked to sign in to Leanpub the first time you do those. To sign into Leanpub in the sidebar, you need to use your Leanpub account email address and your Leanpub account password.

You will then see your book in the Leanpub sidebar.

Creating a Preview

Click the “Preview” link for your book in the sidebar. You will see something this:

Click the “Start Preview” button. You will see a progress bar at the bottom of the sidebar:

The progress bar will turn green when the process is complete:

You will then see links to download the different ebook versions of your book that have been created:

Click the PDF link to download the PDF preview you have created and open it on your device.

Writing in Your Book

In this section, you’ll learn how to write in your book, and how to change the order of chapters.

In the Chapter One document you have open in Google Docs, type “Hello World!” somewhere.

The next time you create a preview of your book, you will see that Chapter One has changed, and it now says “Hello, world!” where you typed that in your Chapter One document.

To create a new preview, click the “Start Preview” button in the Leanpub Add-on sidebar again.

Now let’s create a new chapter. Click on the + New button at the top left.

Select Google Docs and then confirm your selection by clicking on Create and Share.

Click in the box that says Untitled Document at the top and type `Conclusion’.

In the document menu, click on “Normal text” and then select “Title”.

In the document, type the word Conclusion and then hit the return key.

Now, type This book is **done** and ready for *the world to see*, hooray!.

Once again, in the menu at the top of the document in Google Docs, click “Add Ons -> Leanpub -> Start” to access the sidebar.

To change the order of the chapters in your book, you can click and drag the chapters in the Leanpub Add-on sidebar. Click on Chapter One and move it below Chapter Two.

Finally, click the “Start Preivew” button to generate a new preview to see the effect of your changes.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!

Getting Started with Bring Your Own Book Writing Mode

You can write a Leanpub book using the Bring Your Own Book writing mode. In this chapter we’ll show you how to create a book and generate your first preview.

Once you have successfully generated your first preview, you’ll know everything you know to get started writing in the Bring Your Own Book writing mode.

You’ll find more information and detailed instructions on the “Getting Started” page for your book, which you’ll go to automatically when you create your book.

Creating a Book in Bring Your Own Book Writing Mode

Go to https://leanpub.com/create/book to create a book in Bring Your Own Book.

Next, type a title for your book into the “TITLE” box. You can change your title later.

Click in the “BOOK URL” box. Leanpub will automatically suggest a URL for your book’s web page on Leanpub. You can change this URL at any time.

Scroll down and you will see “MAIN LANGUAGE USED IN YOUR BOOK.” You can select a language from the drop-down. Like the other settings, you can change this at any time.

Scroll down and you will see the “BOOK THEME” options. “Business” will be selected by default. The Book Theme is just a set of standard formatting options conventional for books on these subjects. You are not required to choose any particular option. You can change your Book Theme at any time.

For this tutorial, we selected the “Fiction” Book Theme.

In the section below, you will be presented with various Writing Mode options. For this tutorial, select “Bring your own book.”

When you scroll down, you will see the subscription plan options. By default, “Free” will be selected. If you have a paid Leanpub account already, you will see that plan selected automatically.

Select a plan.

Scroll down and, if you are not signed in to a Leanpub account, you will see an option to enter information to create a new account. You will also see an option to sign in, if you already have a Leanpub account.

To create a new account, fill in the relevant information.

Tick the box to prove you’re a person and click the blue button to finish creating your new Bring Your Own Book book.

You will now see that you are on the Getting Started page for your book.

If you use bookmarks in your web browser, we recommend you bookmark this page in your web browser in a bookmark folder for your book, but this is not required.

Look at the Book Tools “breadcrumb” menu at the top of the screen. This is how you will navigate to the web pages you will be using in Leanpub to work on your book and see all the features we provide, like uploading a book cover, or setting a price for your book.

When you are finished this tutorial, we recommend you explore the various Book Tools options.

Uploading Your Book In Bring Your Own Book

Click on “Getting Started” at the top, and you will see your the Book Tools menu. It will look something like this:

Click on “Preview or Publish” in the menu, and you will see something like this:

Select “Upload” in the column to the right:

On your computer, find the book file or files you would like to upload. (The file does not have to named “book.pdf”; you can use any file name you prefer.)

Drag the file onto the top box that under “Upload Your Book Files.” You will see a progress bar as the file uploads:

When the file is uploaded, you will see a check mark:

That’s it, you’re done uploading your file! After you have added information about your book to Leanpub, then all you have to do is click the Publish button.

Publishing Your Book

To do this, click on “Upload” in the menu at the top:

Select “Publish Your Book” at the top right, to go to the Publish page for your book.

Scroll down and you will see the blue “Publish Book” button.

Next Steps

Next, we recommend you explore the Overview page for your book:

Author > Books > [Your Book Title] > Book Info > Overview

On the Overview page, you can see all the pages you need to get your book set up on Leanpub, like “Upload Book Cover” and the “Book Details” page, where you can explain what your book is about to potential readers.

If you have any questions or can’t find anything, please search our Help Center for authors here: http://help.leanpub.com/author-help.

Happy writing!