Skip to content

Commit

Permalink
build lessons
Browse files Browse the repository at this point in the history
  • Loading branch information
hschellman committed Nov 7, 2024
1 parent 7a01043 commit c923203
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 21 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ and to meet some of our community members.
## Where to Contribute

1. If you wish to change this lesson,
please work in <https://github.com/swcarpentry/FIXME>,
which can be viewed at <https://swcarpentry.github.io/FIXME>.
please work in <https://github.com/dune/FIXME>,
which can be viewed at <https://dune.github.io/FIXME>.

2. If you wish to change the example lesson,
2. If you wish to change the Carpentries example lesson,
please work in <https://github.com/carpentries/lesson-example>,
which documents the format of our lessons
and can be viewed at <https://carpentries.github.io/lesson-example>.

3. If you wish to change the template used for workshop websites,
3. If you wish to change the template used for Carpentries workshop websites,
please work in <https://github.com/carpentries/workshop-template>.
The home page of that repository explains how to set up workshop websites,
while the extra pages in <https://carpentries.github.io/workshop-template>
provide more background on our design choices.

4. If you wish to change CSS style files, tools,
4. If you wish to change DUNE CSS style files, tools,
or HTML boilerplate for lessons or workshops stored in `_includes` or `_layouts`,
please work in <https://github.com/carpentries/styles>.
please work in <https://github.com/dune/lesson-template>.

## What to Contribute

Expand Down
30 changes: 30 additions & 0 deletions _episodes/00-Local-Setup-For-Local-Build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Local Setup Instructions
teaching: 30
exercises: 0
questions:
- How can I set up a local server to check my lesson
objectives:
- Learn how to set up locally
keypoints:
- This is the hard part, need to get ruby
---


## Instructions for local setup to build your lessons - very useful


> #### Note:
> The Carpentries provide excellent instructions and examples at: [https://carpentries.github.io/lesson-example/setup.html](https://carpentries.github.io/lesson-example/setup.html).
> Carpentries has moved on to an 'R' based system which we are not using. We are still using this older format.
{: .callout}


## Do local setup for local rendering (optional)

Follow the instructions [https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional](https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional) for setup on your local machine - in principle this is optional but in practice it is really helpful. You are going to need ruby and pyYAML. I used conda on a mac but they have instructions for Windows, Mac and UNIX.

> #### Alert!!!
> At this point you should stop following their instructions and start using our github template to avoid overwriting DUNE specific items.
{: .callout}

120 changes: 120 additions & 0 deletions _episodes/01-How-to-make-a-lesson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
title: How to make a Lesson for DUNE
teaching: 30
exercises: 0
questions:
- How can I make a lesson like this from scratch using the DUNE template
objectives:
- Learn how to set up locally to build a lesson and to deploy it.
keypoints:
- If you can do basic markdown, you can do this.
---


## Here I describe how I built this lesson. You can follow along.



> #### Note:
> Check out the [previous episode]({{ site.baseurl }}/00-Local-Setup-For-Local-Build.html)to set up a local server and to do local builds.
{: .callout}

## First you need to decide on a name for your new lesson.

> #### Note:
> Because github insists on using gh_pages for deployment, it is good to use your own github account for initial (and ongoing) development and pull over to /DUNE/ for the official version rather than using branches in the /DUNE/ github area.
{: .callout}

## Do local setup for local rendering (optional)

Then follow the instructions [https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional](https://carpentries.github.io/lesson-example/setup.html#setup-for-local-rendering-of-the-lessons-optional) for setup on your local machine - in principle this is optional but in practice it is really helpful. You are going to need ruby and pyYAML. I used conda on a mac but they have instructions for Windows, Mac and UNIX.

> #### Alert!!!
> At this point you should stop following their instructions and start using our template to avoid overwriting DUNE specific items.
{: .callout}

## Then import this template.

- Use the [GitHub’s importer](https://github.com/new/import) to make a copy of this repo in your own GitHub account. (Note: This is like a GitHub Fork, but not connected to the upstream changes)

- Put the URL of this repository, that is https://github.com/DUNE/lesson-template.git in the “Your old repository’s clone URL” box.

- Select the owner for your new repository (you).

- Set the name you chose for your lesson repository.

- Make sure the repository is public.

> #### Note:
> Please import to your own account and new lesson, work there and then move it over to `/DUNE/` once you have a decent draft in place.
{: .callout}


The difference from the carpentries is the addition of the DUNE logo and stuff specific to our lessons.


## now make a local copy on the gh-pages branch and edit away
~~~
git clone -b gh-pages <your new repository>
~~~
{: .language-bash}

You need to look at the following pages.

- `_config.yml ` to set the title and other parameters for the lesson
- `AUTHORS` to tell people who is doing this
- `CITATION` how to cite the page - often just the URL
- `LICENSE` you can keep it as is
- `LICENSE.md`
- `README.md`
- `reference.md`
- `setup.md` This is currently the full setup for new users.

Then throw your individual modules into `_episodes` with leading numbers to set the order. The code will follow the ordering of the files in `_episodes`.

There are very nice examples and a formatting tutorial at: [https://carpentries.github.io/lesson-example/](https://carpentries.github.io/lesson-example/)

You can throw supplemental stuff into `_extras`.

## You can then build your site locally either as a server or just a local site.

### local site

~~~
make site
~~~
{: .language-bash}

This does a lot of setup - it's pulling in a lot of ruby "gem" files.

Your local site will be in _sites/index.html

#### Checking

~~~
make lesson-check
~~~
{: .language-bash}

will tell you about all the FIXME's you haven't fixed and missing formatting syntax.

### local server

~~~
make serve
~~~
{: .language-bash}

will launch a web server and a site at: `http://127.0.0.1:4000`

You need to reload the web site to see your changes.

> ### Note:
These will hang around until you kill them so if you try to launch twice so look for processes with:
{: .callout}


~~~
ps -ef | grep jekyll
~~~
{: .language-bash}
Empty file.
15 changes: 0 additions & 15 deletions _extras/TutorialsMasterList.md

This file was deleted.

Empty file removed _extras/discuss.md
Empty file.

0 comments on commit c923203

Please sign in to comment.