RaspberryPiFoundation/kramdown_rpf

Name: kramdown_rpf

Owner: Raspberry Pi Foundation

Description: An extension to Kramdown to add special markup for the RPF's learning platform

Created: 2017-04-24 13:58:25.0

Updated: 2018-05-16 11:50:27.0

Pushed: 2018-05-24 13:38:36.0

Homepage:

Size: 131

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

KramdownRPF

An extension to Kramdown to add special markup for the RPF's learning platform.

Installation

Add this line to your application's Gemfile:

'kramdown-rpf'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kramdown-rpf
Usage
ire 'kramdown_rpf'

down::Document.new(markdown, input: 'KramdownRPF').to_html

KramdownRPF uses the Kramdown GFM markdown parser.

Challenges

Within your markdown, add a challenge like this:

challenge ---

hallenge: Improving your drum

y markdown here

/challenge ---
Code block

When you want to include a code block, include the following in your Markdown

code ---

uage: python # required
name: whoopee.py # optional
_numbers: true # optional - default false
_number_start: 3 # optional - default 0
_highlights: 3, 5-6 # optional

e True:
button.wait_for_press()
parp = random.choice(trumps)
os.system("aplay {0}".format(parp))
sleep(2)
/code ---
Collapsed content

Within your markdown, add some collapsed content (primarily ingredients) like this:

collapse ---

e: Downloading and installing the Raspberry Pi software


ent here comes from the ingredient.

/collapse ---
Print-specific content

When printing projects, we need to be able to hide that which on a screen would be interactive, and show a print fallback. Similarly we don't want to show the fallback content on screen where the interactive content is available. These two blocks will allow content editors to selectively show or hide content on screens and in print.

Content inside the following tags will NOT be shown when printed: — no-print — This will not print — /no-print —

…and content inside this block will ONLY be shown when printed, not on a screen: — print-only — This will not show on screen, only in print — /print-only —

Hints

Within your markdown, add some hints like this:

hints ---
hint ---

 1

/hint ---
hint ---
 2

/hint ---
hint ---

 3
/hint ---
hint ---
 4
/hint ---

/hints ---
Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RaspberryPiFoundation/kramdown_rpf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.