# Building a custom Course

This workflow details the steps needed to make your own custom course. 

These instructions focus on assembling a group of lectures and building them
locally as a first step. 

Once the local version is up and running the next step is to add the files
to a repository and setup hosting of the `html` files using `gh-pages`.

```{warning}
This workflow may change significantly in the future to make these steps easier. 
Currently this is geared towards manually preparing a repository for use with
jupyter-book
```

## Steps to assemble a Jupyter Book

1. Set up the standard Jupyter Book project layout — a `lectures` folder containing `_config.yml`,
   `_toc.yml`, and `intro.md`. Use an existing QuantEcon lecture repository (for example
   [lecture-dp](https://github.com/QuantEcon/lecture-dp)) as a reference for these configuration files,
   and the shared {ref}`quantecon environment <quantecon-environment>` for the build dependencies.
2. Add `myst markdown` files or `notebooks` to the `lectures` folder
3. Update `lectures/_toc.yml` with the required information including titles for Parts and `filenames` to include the lectures in the `jupyter-book`. 
4. Enable the quantecon environment using `conda activate quantecon`
5. Build using `jb build lectures` at the root level of the folder

```{tip}
You will also want to update:
1. `intro.md` with update information for the front landing page
```

## Steps to migrate to GitHub and Hosting on GH-PAGES

Once your course builds locally you can move it to a GitHub repository and host the `html` on GitHub Pages:

1. Create a new GitHub repository and copy the workflow templates (`ci.yml`, `cache.yml`, `publish.yml`)
   from [quantecon/actions/templates](https://github.com/QuantEcon/actions/tree/main/templates) into
   `.github/workflows/`, following that directory's README to configure them.
2. Apply the standard {ref}`lecture repository configuration <config:repo:lecture>`.
3. Push your lecture files, then build and publish following
   {ref}`Publishing Lectures <publish/automatic>`.