GithubHelp home page GithubHelp logo

Comments (3)

Carreau avatar Carreau commented on May 17, 2024

But does not the syntax of comment depend on the language ?

Also the "jinja" syntax is not specific to jinja it is used in many templating library of many languages :
http://liquidmarkup.org/ (ruby), http://mozilla.github.io/nunjucks/ (node)

I would say that people that use this are advance user, and that with comment-like templating you risk of reinventing your own thing. Also it is trivial to test wether an notebook with jinja-block is valid, or still contain jinja-block. When it's comment, you can mistype, and create an assigment notebook with solutions, so you have to check all by hand.

So please wait cost of comment more.

from nbgrader.

ellisonbg avatar ellisonbg commented on May 17, 2024

The comment approach simplifies things dramatically:

  • It allows instructors to write notebook that are valid code in whatever
    language/kernel they want. The jinja stuff essentially made an entirely new
    language that has to be installed by anyone who wants to run those
    notebooks. That is a horrible user experience and echoes the failed model
    of sweave, etc where the document the author writes is pretty much useless
    without additional processing.
  • It allows the "master" notebook that is written by the instructor to be
    handed out to students as the official solutions without any further
    processing. This alone cuts out a ton of complex code from nbgrader.
  • Requiring instructors to know jinja dramatically increases the cognitive
    load on instructors.
  • The second you allow jinja in this type of context, you end up with
    massive risk of further scope creep - this was already happening with the
    TOC stuff - basically notebooks were starting to become big jinja templates
  • that is the wrong direction.
  • The workflow becomes much more complex.
  • The code to implement the commend handling, while language dependent is
    super, super simple.

On Tue, Sep 16, 2014 at 1:02 AM, Matthias Bussonnier <
[email protected]> wrote:

But does not the syntax of comment depend on the language ?

Also the "jinja" syntax is not specific to jinja it is used in many
templating library of many languages :
http://liquidmarkup.org/ (ruby), http://mozilla.github.io/nunjucks/
(node)

I would say that people that use this are advance user, and that with
comment-like templating you risk of reinventing your own thing. Also it is
trivial to test wether an notebook with jinja-block is valid, or still
contain jinja-block. When it's comment, you can mistype, and create an
assigment notebook with solutions, so you have to check all by hand.

So please wait cost of comment more.


Reply to this email directly or view it on GitHub
#4 (comment).

Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]

from nbgrader.

jhamrick avatar jhamrick commented on May 17, 2024

I was originally in favor of the jinja templates too -- hence why I had them :) -- but after discussing it and thinking about it more I'm fairly convinced that they are overkill, largely for the reasons @ellisonbg stated. Also, although there is less of a risk (because syntax errors will be caught), you do still run the risk of having mistyped jinja templates, like this:

{% if soluton %}
some stuff here
{% endif %}

Which would just render an empty string, because soluton isn't defined.

from nbgrader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.