Open brownsarahm opened 6 years ago
@brownsarahm Thanks very much for the proposal. As we discuss during CarpentryCon, it is good but we should be careful. Some food for thoughts. :-)
You said "no more >
and >>
" but >
and >>
are part of "standalone" Markdown. This means that the text will be render by GitHub Preview or any other Markdown tool. include
is a Jekyll specific directive so the content of the file included will not be render by GitHub Preview neither other Markdown parser. We had some conversations of lowering the barrier to contribute using only GitHub web interface (or GitLab Web IDE in the future) so the use of include
will be something that could make harder for novices to contribute.
In addition to that, if we adopt include
directive for exercises, can we adopt it for figures as well? Please see https://github.com/carpentries/styles/issues/161 for more details.
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.
_includes/exercise_output.html could be simplified to
<article class="exercise">
{{content}}
</article>
and a light Javascript could convert it to
<article class="exercise">
<div class="challenge">
<h2 id="challenge"><code class="highlighter-rouge">.challenge</code></h2>
<p>An exercise.</p>
</div>
<div class="solution">
<h2 id="solution"><code class="highlighter-rouge">.solution</code></h2>
<p>Exercise solution.</p>
</div>
</article>
The header inside `{{content}}`` would be used as separator between the exercise body and the solution body so we would have
An exercise.
# Solution
Exercise solution.
as the exercise file.
People complained about the XX-name
notation for the episodes because it make painful to add a new episode since you have to rename all the episodes after the one you include. This would be a big problem for exercises.
I 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.
I'll read up on that issue, but I think these should remain independent decisions
I 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.
I 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.
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;
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?