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
Size: 131
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
An extension to Kramdown to add special markup for the RPF's learning platform.
Add this line to your application's Gemfile:
'kramdown-rpf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kramdown-rpf
ire 'kramdown_rpf'
down::Document.new(markdown, input: 'KramdownRPF').to_html
KramdownRPF uses the Kramdown GFM
markdown parser.
Within your markdown, add a challenge like this:
challenge ---
hallenge: Improving your drum
y markdown here
/challenge ---
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 ---
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 ---
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 —
Within your markdown, add some hints like this:
hints ---
hint ---
1
/hint ---
hint ---
2
/hint ---
hint ---
3
/hint ---
hint ---
4
/hint ---
/hints ---
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.
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.
The gem is available as open source under the terms of the MIT License.