Skip to main content
All CollectionsAuthor Help
Getting Started Creating an Online Course in Leanpub's Git and GitHub Writing Mode
Getting Started Creating an Online Course in Leanpub's Git and GitHub Writing Mode

Keywords: course, create, how, getting started, GitHub, writing mode, walkthrough

Leanpub Support avatar
Written by Leanpub Support
Updated over a year ago
Getting Started Creating an Online Course in Leanpub's Git and GitHub Writing Mode

You can create a Leanpub online course easily using our GitHub writing mode!

In this article we'll show you how to create a repo in GitHub, create a course on Leanpub, write your course in plain text, create previews, and finally, we'll show you how to publish a course and sell it to learners on Leanpub.

That may sound like a lot, and although this walkthrough is rather comprehensive, it's really pretty easy to create a course! Once you've successfully gone through this walkthrough, you'll know everything you need to know to get started writing a course in our GitHub writing mode!

(Already familiar with GitHub? You may prefer this TL;DR tutorial.)

Creating Your Course'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 course:

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:

Scroll down and click the green "Create repository" button:

This will take you to a "Quick setup" page:

Click on the clipboard icon at the top right to copy the information you'll need to your clipboard:

Go to the command line on your computer. In this tutorial we're using a Mac, and we go to the command line by opening an application called "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", which we get to by typing "cd repos" and hitting return:

You will now see that you are in the correct folder:

Next, type "git clone" and a space, and and paste in the repository information you copied on GitHub:

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

Next, go into the new folder by typing cd and your repo name. In this example, we're going to type cd Demo-Course-2021 and hit return, which will change your location to the folder for your course:

Alright, now that we've got our repository set up on GitHub and cloned on our computer, it's time to create a new course on Leanpub!


Creating a Course in GitHub Writing Mode

Go to https://leanpub.com/create/course to create a book in our Git and GitHub writing mode:

First, type a title for your course into the "TITLE" box. You can change your title later:

Click in the "COURSE URL" box. Leanpub will automatically suggest a URL for your course's web page on Leanpub. You can change this URL at any time:

Scroll down and you will see "MAIN LANGUAGE USED IN YOUR COURSE." 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 "Using Git and GitHub":

Next, enter your GitHub username, followed by a forward slash / and your GitHub repo name, and the names of the branches you want to use on your repo when you preview and publish your book ("main" is entered by default):

Next, scroll down, and you will see the subscription plan options. By default, "Standard" will be selected, if you are setting up your first book in Leanpub.

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:

If you selected a paid subscription, scroll down you'll see a form for entering your payment information:

Finally, tick the box if you wish to accept our Terms of Service and Privacy Policy, and click the blue button to finish creating your new course:

If this is the first Leanpub course you have created, you will see a page that is asking you to verify your email address (unless you're a book author, and you have already verified your email address that way):

If you check your email, you should see a message from Leanpub with the subject line:

[Leanpub] Thanks for trying Leanpub! Please verify your email address...

The contents of the email will say:

In the email, click the link that says: "Click here to verify your email address."

Getting Started

You will now be taken to the Getting Started page for your course:

On this page, you will see lots of helpful information that we recommend you read at some point!

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.

(To learn more about navigating around Leanpub as an author, please read this article when you have finished this Getting Started walkthrough. We'll link to the article again at the end of this walkthrough, but just wanted you to let you know about it now.)

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

In order for Leanpub's course generators to be able to use the content you will be creating, you need to add Leanpub as a collaborator on your GitHub repository.

To do this, go back to the GitHub page for your course's GitHub repository:

Click on "Settings" near the top right, to go to the "Settings" page for the repository:

Click on "Manage Access" at the top of the menu on the left:

This will take you to the page where you can add collaborators:

Scroll down until you see the green "Invite a collaborator" button:

Click the button and you will see a box where you can add a collaborator:

Type "leanpub" in the search box and select the "Leanpub" option:

Finally, click the green "Add leanpub to this repository" 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 does not write to your GitHub repository.)

Next, click here to download the zip file with default content. 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 that you will see. Then, go to the cloned GitHub repository on your computer, and paste the "manuscript" folder into the repository:

Now that you have added content to the folder on your computer, you need to push it to the repository on GitHub.

To do this, go back to the command line on your computer, making sure you are still in the folder for your book:

To add to the content using Git, type git add . and then hit return:

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

Finally, to push the commit to the repository on GitHub, type git push and hit return:

All right, we've now learned how to add content to a folder on a computer, and push the change to the course repository on GitHub! That means Leanpub's course generators can now use the content to create a course, since we added Leanpub as a collaborator on the repository earlier.

Creating a Preview

Next, let’s create a Preview of your course from the default chapter content. (A “Preview” is a private version of your course you can create at any time, to see what your course looks like.)

To do this, click on the "Versions" link you’ll see in the horizontal menu at the top of the page on Leanpub:

This will take you to the Preview page for your course:

Now, click the blue “Create Preview” button at the bottom of the page:

You will now see a progress bar at the top of the page. This shows the steps carried out by Leanpub’s course generators, every time you create a new Preview:

When the process is complete, and you’ll see the links for your course material:

A Note About the Download Links

These downloadable files contain the contents of your course, but people can't actually use them to take the course. After you publish the course, learners will have the opportunity to download these files e.g. to search the contents, or to read offline.

How Courses Look

To view a preview of the online course, scroll down until you see the link to "View the latest preview of your course":

Click the link, and in a new browser tab, you will see a preview of the online course you've just created, using the default content we provided when you created the course:

Now, let's walk through some of the various elements of the course. Hopefully they're more or less explanatory, but this is a walkthrough after all, so here we go!

First, at the top left is the title of the course:

Underneath the title, you will see the number of "Quizzes Completed" and a progress bar (which is currently empty, naturally enough):

A course can submitted for completion after a learner has completed all the quizzes. Submitting a course to be completed, and graded, is called an "Attempt". Courses can also be set to allow for more than one "Attempt", if a learner doesn't like their grade and wants to try again.

Next, there is a course menu, that highlights the section of the course the learner is in. Currently we're in the "Lessons" section, that has the main course content that the learner learns from:

In the menu underneath, you will see the first section or "Lesson" is where we are in the course right now:

The contents of the section or "Lesson" are displayed in the main area on the right:

Now, try clicking the little hamburger menu at the top left:

This will put the course in a focus mode, where the menu on the left disappears:

If you click the little icon at the top left again, then you will go back to the normal viewing mode:

OK, that's probably enough of an introduction to how courses are read for now! This is Leanpub after all, and we're eager to get you started writing your course.

To get back to working on your course, close the browser tab that opened when you clicked the link to view the course, and go back to the Preview page for your course:

Writing In Your Course

OK, now let’s do some writing!

To write in your course, on your computer, go to the manuscript folder for your course:

Double-click on the chapter1.txt file:

This will open the chapter1.txt file on your computer, in your default text editor app for .txt files. In this example, the text editor is an app called Emacs:

Note the "Introduction" text:

This should be familiar from before, when we looked at the preview of the course:

That preview was generated from the text in this file on the repository on GitHub. Any change you write in this file on your computer, and then commit and push to GitHub, will be reflected in the course when you preview or publish a new version, using Leanpub's course generators.

If you're familiar with Markdown, you'll recognize what we're doing here. We know it can seem a bit daunting at first, but when it comes to writing a course (or a book), it actually only takes a few minutes to learn most of what you're going to need to know!

Specifically, Leanpub uses a markup syntax called Markua, which was invented by Leanpub founder Peter Armstrong, to basically be "Markdown for Books and Courses".

First, let’s type something in the document. Under the first paragraph, type Hello World! and save the change:

If you committed and pushed these changes the course repository on GitHub, and you went back to your course on Leanpub now and created a new preview, you would see this:

Next, let’s add a new document. How you do this will depend on your text editor app.

Here's our course folder with a new document added, called new-chapter.txt:

To get Leanpub's course generators to use the new file when you next create a preview, you will need to add the file's full name (including the .txt at the end) to the list of files in the Book.txt file in your manuscript folder:

That's what Book.txt is there for: it's just a list of file names for our course generators to see. Leanpub works this way so you can work on draft chapters in a book or course without including them in the preview; just don't list them in Book.txt, and the draft files won't show up in the preview. (People also often keep notes and other materials in their manuscript folder that they don't want to appear in their books or courses.)

Double-click on Book.txt to open the file in your text editor:

On a new line, type the filename new-chapter.txt and save the change:

The next time you create a preview of your course, our course generators will include the content you add to the file new-chapter.txt.

Please note that these file names are only visible to course authors. These names are not added to the actual course itself, and are only for your convenience.

Of course, you can remove file names from this list and also delete documents from the manuscript folder.

Let's go ahead and delete the chapter1.txt file name from the list in Book.txt and save the change:

Next, go back to your manuscript folder:

Now, delete chapter1.txt:

A Note About Manuscript Versions

If you're worried about losing work, please note that every time you preview or publish a new version of your course, we create a downloadable version of the course manuscript for you.

To see where you can download the manuscript for a previously previewed or published version of your course, click the "Versions" option here:

Here's an example of what this page looks like:

It's a pretty straightforward process (click "create archive" and you'll see), but we'll show you exactly what happens when you want to download a version of your course in another article (which has not yet been created, sorry!).

All right, remember how we just created a brand new file called new-chapter.txt? Let's go ahead and turn that into a real course!

Writing a Basic Course with Content and a Quiz

Let's make a very basic course, with a paragraph of content, and a single quiz. Here is a sample you can use:

# Fun Cat Facts Quizzes: Introduction

Below you will find a brief quiz about cats. We hope you have fun and do well!

{quiz, id: quiz1}

# Fun Cat Facts: Quiz #1

? What is the name of the talking cat in Bulgakov's famous novel?

a) Beetlejuice
b) Fluffy
C) Behemoth
d) Ed

? How many unique letters are there in the name "Behemoth"?

a) 5
B) 6
c) 7
d) 8

? How fast can cats run?

a) About 10 mph
b) About 20 mph
C) About 30 mph
d) About 40 mph

? What is the name of a cross between a Burmese cat and a Chinchilla Persian cat?

! Burmilla

? What is the name of the most popular cat on YouTube?

! Maru

{/quiz}

(The above content is adapted from the manuscript for our free Creating Leanpub Courses course.)

Now, let's copy and paste the example above into new-chapter.txt and save the change:

[Editor's Note: We'll go into further detail regarding quizzes in a separate article, and post a link to it here when it's written.]

We recommend you take a look for a moment at how the quiz and questions are written in this example. Note that when you write multiple choice questions, you use a capital letter to indicate the correct answer, for example "C) Behemoth" in the first question in the example above:

Adding an Image to Your Course Content

Next, let's see how we can add an image to our course.

[Editor's Note: You can also add YouTube videos to courses! We'll show you how to do this in a separate article, and post a link to it here when it's written.]

To add an image to your course, go to the resources folder in your manuscript folder:

To add an image, paste the image file into the resources folder:

To add an image to a course in Markua, you write this in your text file, using the file name for the image, like this:

![](marm-and-tangie.jpg)

Let's put that in our new quiz:

Now, let's add a caption to the image, like this:

![Marmalade and Tangerine](marm-and-tangie.jpg)

OK, now let's create a new preview to see all of our changes.

First, you need to save, commit, and push your changes again. Go back to your folder (in Terminal, in this example, on a Mac), like you did before:

Commit your changes by by typing git add . and hitting return:

Next, type git commit -m "editing course" and hit return:

Note that the "message" between the quotation marks (in this case editing course) can be anything you like; you might want to try being more descriptive than just saying "editing course", especially if you're working with other people, but it's up to you!).

Finally, type git push and hit return:

All right, now we're ready to generate another preview:

To go back to the Preview page, click "Preview New Version":

This will take you back to the Preview page:

To create a new preview, scroll to the bottom and click the "Create Preview" button:

When the process is complete, scroll down and click "View the latest preview of your course":

In a new browser tab, you'll now see the content that we added is included in the course:

Finally, click on the quiz:

This will take you to the page where you can take the quiz:

All right, we're almost ready to publish our course! But first, we have to add some important information.

Before publishing, we need to add some information about the course for people to read before they decide to purchase it.

To get back to working on your course, close the browser tab that opened when you clicked the link to view the course. This should take you back to the Preview page for your course:

Click on "Settings" in the horizontal menu at the top of the page:

By default, this will take you to the "About the Course" page for your course, which is the top item in the vertical menu at the left:

Next, type some information into the "Teaser Text" box, the "About the Course" box, and the "Meta Description" box. You can edit these any time!

When you're done, scroll down and click the "Update Course" button:

Adding a Course Image

Next, let's add an image to our course, that will be displayed on the course's web page on Leanpub.

To do this, click on "Upload Course Image" in the vertical menu to the left:

This will take you to a page where you can upload an image for your course:

Under the default image, you will see the following recommendation regarding image sizing:

"We recommend 2560 pixels wide by 1440 pixels high, but you can also use 640 pixels wide by 360 pixels high."

This is a 16:9 ratio.

When you're ready to upload your course image, click "Choose File":

Navigate on your computer to the image you want to use. What this looks like will depend on your operating system. Here's what it looks like in a Mac:

Click "Open" (or the equivalent button you see on your computer) to add the image as your course image.

You will now see the image has been selected:

You may have an option to adjust the size of the selected area; in the example below, we have increased the area a bit:

Finally, scroll down and click "Update Course":

When the process completes, you will see that the image has now been added to your course:

[Editor's Note: We're using an image from Unsplash, which is a great resource for images you are free to use (though you should always check attribution requirements, of course!).]

Pricing

Leanpub uses a "variable pricing" model for selling books, courses and bundles.

Before you publish your course, you will want to set the Minimum Price and Suggested Price for the course.

To set the Minimum and Suggested prices for your course, click on "Store" in the horizontal menu at the top of the page:

Next, click on "Pricing" in the vertical menu to the left:

For this example, we're going to set the Minimum price to $29.99 and the suggested price to $39.99:

[Editor's Note: Pricing is notoriously hard, so we recommend experimenting with different price points over time, to see which prices work best for you and your audience. However, we would like to note that the most common mistake authors make when it comes to pricing, is selling themselves short, and setting the price too low!]

We also suggest you opt in to Leanpub's discount sales by adding a "Maximum Leanpub Discount %", which we're going to set at 50% in this example:

When you're ready, click the "Update Course Price" button:

Setting Up Your Course Certificate

When a learner submits a completed course and gets a passing grade, they can get a certificate to prove their accomplishment.

Before you can complete your course, you need to add an image of your signature (or something you consider functionally equivalent, like a company logo) to your certificate.

To do this, click on "Settings" in the horizontal menu at the top of the page:

Next click on "Certificate" in the vertical menu to the left:

This will take you to the "Certificate" page:

You may want to scroll down the page to look at the options available to you here.

For this walkthrough, we are going to choose the minimum requirement, which is to add a signature image for our selected Certificate.

To upload an image of your signature, click "edit":

This will take you to the page where you can edit your Course Instructor profile information:

Under "Instructor Signature", select "Choose File":

Navigate on your computer to the image you want to use. What this looks like will depend on your operating system. Here's what it looks like in a Mac:

Click "Open" (or the equivalent button you see on your computer) to add the image.

You will now see that the file has been selected:

Scroll down and click the "Update Course" button:

You will now see that the image has been uploaded at the bottom of the page:

Publishing Your Course

OK, now we're ready to publish our course!

Please note that you should NOT actually publish a course you made just to follow along with this tutorial! We just wanted to show you how to do it, for when you're ready to publish your course for the first time :)

To publish your course, go back to the Versions section:

In the vertical menu to the left, click "Publish New Version":

This will take you to the Publish page for your course:

Like Leanpub books, Leanpub courses can be published while they are still works-in-progress, and you should check the "Completion Percentage" whenever you publish a version.

Your learners will not be able to complete the course themselves until you have finished it, AND you marked it as 100% complete.

To mark your course as 100% complete, type "100" in the "Percent Complete" box:

Next, scroll down and click the "Publish Your Course" button:

When the process is complete, you will see that the course is marked as 100% complete:

That's it, our course is published and for sale on Leanpub!

Viewing Your Course on Leanpub

To view the web page on Leanpub where people can buy your course, click on the image at the top left:

There you'll see what the web page for your course on Leanpub looks like:

Please note that only a signed-in author of a course will see the "Edit" button:

Normal visitors to the website will not see the "Edit" button:

Congratulations!

You've completed the Getting Started walkthrough for writing a course in Leanpub using our In-Browser Plain Text Editor.

Next Steps

Next, we recommend you explore the Overview page for your course.

Go ahead and click the blue "Edit" button:

That will take you to the "Overview" page for your course:

You can get back to your course's "Overview" page anytime by clicking on it in the horizontal menu at the top of the page, when you're working on your course in Leanpub:

On the Overview page, you can see all the pages you need to get your course set up on Leanpub.

If you haven't done so already, we would also recommend you set up your author profile information here.

To learn more about navigating around Leanpub as an author, please read this article.

Also, you may want to check out our free Creating Leanpub Courses course. If you look in the "Course Info" section, you'll find a download link to the manuscript files for that very same course. It's a great way to figure out how various features work in courses.

Finally, you might also want to check out the Markua manual here:

Markua is the name of the manuscript markup syntax you use to write books and courses in plain text on Leanpub. It’s easy to learn the basics you need to write most Leanpub books and courses. In fact, you know some Markua already from completing this tutorial!

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

OK, that's it!


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!

Subscribe to our YouTube channel here: https://www.youtube.com/leanpub

Please 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?