-
-
Notifications
You must be signed in to change notification settings - Fork 381
Discuss: improving our build system #349
Comments
You've pointed out some of the advantages of pandoc, I just want to make sure you understand some of its limitations as well. I can't address all of these issues, but I think you should be very careful about using pandoc as a default MarkDown parser for IPython Notebooks. Due to its inability to pass raw LaTeX from Markdown -> HTML, pandoc doesn't support embedding mathematics as smoothly as Marked. The IPython team now uses Marked + node (which they use on the front-end IPython Notebook for MarkDown processing) to generate static views of their notebooks. |
You can't do the following:
But you can do:
Unfortunately, those blank lines between the div statements are syntactically significant. I don't think people were opposed to using HTML when needed, I just don't think they wanted to write in HTML. |
This shouldn't be a big problem now because this problem was fixed this week. |
The annoying thing about setting up Travis-CI is encrypting the Github token that allows pushing the website online, because it requires a Ruby environment to install the Now instructors can just go there, put their Once the instructors have the encrypted token, they can just paste it to the For For example it already builds the ipython notebooks to html, but in the future I would recommend to keep under version control only the notebooks with no output, then have Travis run all of them and store in the website the Also if we need to run R, we can run it on Travis. |
If we do move in the direction of requiring local builds of the bootcamp repo's, I'm +1 for Pelican over Jekyll (don't have as much experience with pandoc so can't comment on that), mostly because almost all of the instructors use Python, which suggests that Pelican would be easier to maintain and extend in the long run by the community. |
@jkitzes If we adopt #347, then instructors will only have to build files locally if:
Putting it another way:
The second of these isn't quite true yet: the cached versions of Markdown-ized IPython Notebooks are currently stored in a The major disadvantage of #347 is the whole "classes for
I don't like either of these:
|
@gvwilson, that's a good summary, and I both see what you're saying and I'm convinced by your conclusions about extra moving parts and local builds. At this point, I personally like #347 and think it's the closest we've gotten so far - I think it nicely meets the needs of almost all instructors (while providing a relatively easy way for those who want that last piece, HTML customized IPython notebooks, to get that too). I also don't think it's a big deal to have to use the raw HTML for the fenced code blocks. A separate question on notebook rendering - have we considered just using |
@jkitzes (and everyone else): I have updated #347 to use a combination of
More importantly, the PR now also puts the |
Closed by #347. |
Hi folks, Sorry to jump in here over my head, was hoping someone could clarify the rendering workflow ultimately settled on here for me, as I can't seem to reconstruct it from the referenced pull requests. @jdblischak pointed me to this thread in regards to our discussion of how knitr should be rendering code blocks in the markdown. He currently uses the approach described here: #524 (comment) which puts a lot of html tags into the markdown, resulting in a syntax that displays incorrectly on Github's markdown rendering (in particular, swallowing the first line of input code). I'm a bit concerned that the heavy mixing of html and markdown results in a chimerical format whose rendering is hard to predict. If this is just an intermediary format that no one should look at, maybe pure html would be best? If anyone is intended to look at these .md files, it seems it should be possible to write them in a cleaner kramdown-flavored syntax? (e.g He does this for consistency with the python markdown format, but I'm afraid I don't understand what markdown flavour is being rendered for the python examples or how it is being generated. Ultimately I understand that you are using Jekyll with kramdown to render markdown syntax, but the example python md files I see look primarily like HTML: https://raw.githubusercontent.com/swcarpentry/bc/master/novice/python/01-numpy.md ? Seems like both that example and the knitr markdown outputs would be happier as pure html or as pure kramdown (possibly with a |
Discussion of #298 (build takes too long), #329 (how to distinguish input from output), #342 (use Pandoc instead of Jekyll) and #347 (use Jekyll with translated files) should take place here. See also http://zonca.github.io/2014/02/build-software-carpentry-with-pelican.html.
Our lesson materials, and the template for bootcamp web sites, are in https://github.com/swcarpentry/bc. We keep the two together because instructors sometimes want to modify lessons for particular bootcamps.
We used to store all lessons as pure HTML. Some are now IPython Notebooks instead, and the rest are Markdown because people believe it's easier to write and manage than HTML.
GitHub uses Jekyll to translate Markdown and/or HTML into a web site for the repo (which is visible at github.io). It does not run other tools, or even Jekyll extensions, for security reasons.
This means that our IPython Notebooks don't show up in bootcamp web sites as HTML pages (which is probably OK). It also means that if people want to do local builds, they have to install IPython, which is probably also OK, except the number of tools we need to install is going to grow as we use other input formats for lessons on other subjects. We'd like a general solution.
Meanwhile, the Markdown supported by Jekyll (and hence by GitHub) has some significant limitations. In particular, we cannot add attributes to fenced code blocks: while Pandoc and some other tools support this:
to create:
Jekyll doesn't. This means that we can't (easily) distinguish input and output cells in our shell and Git lessons (which are stored as Markdown). Learners don't like this.
We can use explicit
<pre class="in">
tags in our Markdown source files, but if we do, we have to replace special characters like<
with their ampersand equivalents. Authors don't like this.We want:
#342 (posted earlier this week) attempted to fix some of this by getting rid of Jekyll and:
This lets us add class attributes to fenced code blocks, but:
Andrea Zonca then built http://zonca.github.io/2014/02/build-software-carpentry-with-pelican.html, which uses a different website compiler called Pelican to do conversation. It also uses a continuous integration (CI) tool called Travis to automatically rebuild sites when changes are committed, rather than relying on GitHub's built-in tool. This:
#347 (posted today) is a third run at this. It expects people to commit Markdown versions of non-Markdown content to the repository, then uses Jekyll as before. This:
The text was updated successfully, but these errors were encountered: