-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal to Change How Exercises are included in repository #21
Comments
@brownsarahm Thanks very much for the proposal. As we discuss during CarpentryCon, it is good but we should be careful. Some food for thoughts. :-) Jekyll directive vs MarkdownYou said "no more In addition to that, if we adopt Why not all information are in YAML?The body of the exercise isn't part of YAML but would be very useful to be if we are planning to make the data more accessible, in other words, having all the information in YAML allow us or anyone to use any YAML parser to process the exercises. Why not have a simple _includes/exercise_output.html and use Javascript to improve the layout?_includes/exercise_output.html could be simplified to
and a light Javascript could convert it to
The header inside `{{content}}`` would be used as separator between the exercise body and the solution body so we would have
as the exercise file. How should we name files if we decide to drop the XX-name notation?People complained about the |
Jekyll vs markdownI think the benefits of the parsable content and less syntax only characters outweighs being able to see the exercises and the episdoe content in the same preview. There may even be pedagogical benefit to separating the two visually, so that each is written to be complete, making things more modular and flexible. As is, I've found many exercise boxes are not a complete activity; they depend on the text of the lesson, which makes it hard to jump or skip. While this means moving around to different files, that actually may help enforce lesson contributors to be more thoughtful in a way that benefits learners and instructors. Include for figuresI'll read up on that issue, but I think these should remain independent decisions YAML for exercise contentI left the exercises as the body because I found it easier to read and edit them that way. Moving them to also yaml isn't a big deal though. That would make the parsing a little easier. JavascriptI think javascript makes editing and understanding what's going on a lot harder to follow. Yes it hides some HTML, but I think HTML is easier to follow and debug than javascript. It could be because I've gotten used to HTML and jekyll, but I think that javascript is generally harder to learn and get help for. I also think javascript has more variable behavior than static HTML. We want new people to be able to contribute to lessons easily, debug things quickly, etc. Is that javascript run once on jekyll compile or on every page load. If every load, that's a lot of wasted processing to save a few lines of code in a template file. |
my general comments about this approach, how it was working for me at a recent workshop: Last week I taught a workshop where we followed Sarah's approach with exercises in an individual folder within the lesson repository and python code created per exercise to be loaded with %load magic in the notebook. I really liked the option to %load the exercise text directly into the notebook, it worked well and the participants did not have any problem with that. It also made it much easier for me as an instructor, since I did not have to copy paste exercises from the lesson webpage into the etherpad (my previous approach) I also updated some exercises in the lesson material we used for the workshop, and followed Sarahs approach for that, i.e. using {% include ...} in the lesson md file and then creating an extra md file per exercise. I found this working well and did not have a problem adding exercises in this way. I actually found it easier not to have to use the > and >> and {: .exercise} ... syntax in the lesson md file, which often gives problems with rendering, when missing just one detail or so. What I didn't like is having the solution in the YAML header in the exercise md file. If it is a long solution with several parts, the header becomes long. However, a big part of my problem was the issue with rendering, but I guess that can be sorted, I did not know about using the | there ... |
Summary of @fmichonneau's plan based on the planned move to more automation and broader use of Rmarkdown. We would be converting from plain markdown to Rmarkdown and use a feature of the Rmarkdown to mark exercises and with Travis-CI integration automatically extract the exercise content out for various rendering uses; it would not live outside of the episode narrative text, but we would get access to the individual files for download, individual html pages, etc as this solution does. |
What is the feature that you are referencing? |
I can't remember the name of it, Francios described this on the maintainer's call I joined. @fmichonneau would have to provide details; this update was mainly to note that the details of this proposal are not worth debating at the moment, because other changes in the works render the details here irrelevant. I wanted to keep this up to date with discussions that have happened in other places (albeit coarsely). I'm working on a blog post that will direct people to discuss how they use/ would like to use exercises on another issue on this repo. |
We could use purl and/or commonmark to extract the challenges. |
NOTE: the discussion below reflects major changes; the technical details here are no longer what's most likely
Summary: Change exercises to a separate collection and allow them to be easily parsed into code excerpt files for use while teaching
Example repo, it's on the master branch to be able to render this version and still contribute via gh-pages
rendered example, see last exercise on this page
rendered exercise list
rendeered single exercise
poster
lightning talk
Benefits
>
and>>
%load
magic)Summary of Changes
_exercises
collection: add folder, add to_config.yml
- must be before_episodes
to render properly_includes/exericse_output.html
_episodes/<epnum>-*.md
to_exercises/<epnum>-<exnum>-<name>.md
for each exercise_episodes/*.md
with 1 lines of liquid and setname
to be the correct for the current exercise_layouts/exercise.md
for individual exercise outputsexercise-list
*.py
(if wanted) [preliminary]Notes
|
) instead of wrapped in""
. It's different but it's one syntax only, no meaning character instead of two, so maybe it's less prone to errors (once steady state is reached).exercise/<name>
required changingbase.html
and_include/javascript.html
to usesite.baseurl
instead ofpage.root
there could be other options for thisPoints for discussion
_layouts/exercises.html
: related to above, for usageload
magic for R? If teaching with R studio, would having the files alone be helpful?The text was updated successfully, but these errors were encountered: