-
-
Notifications
You must be signed in to change notification settings - Fork 224
Conversation
Add: Compress webpage output.
…oneComponents into peer_support
Brian and I talked yesterday and agreed that this is ready for your review. |
@@ -18,6 +18,9 @@ | |||
"author": "", | |||
"license": "ISC", | |||
"devDependencies": { | |||
"@babel/core": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to transpile back to ES5 ?? We already require a modern browser, or are there other reasons for using babel that I should be aware of??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the server-side code, I run JS in a Python emulator which only supports ES5. It runs a piece of the client-side code; I use webpack to transpile it as a part of the build.
node.runestone_options["client_json"] = client_json | ||
outer_html = """ | ||
<div class="%(divclass)s"> | ||
<div data-component="fillintheblank" data-question_label="%(question_label)s" id="%(divid)s" %(optional)s style="visibility: hidden;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, this really goes against the principle of creating simple html to represent a component. I think this will make it more difficult to integrate with PreTeXt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's definitely more complex, but ends up being just adding/removing JSON pieces. I don't know of a simpler form. For PreTeXt, it's possible to support just one flavor (client-side only, for example) to keep it simpler.
self.body.append(res) | ||
if node_with_document.document.settings.env.config.runestone_server_side_grading: | ||
if node.dynamic: | ||
# Server-side graded dynamic problems render and provide the problem's HTML on the server; just tell the client it's a dynamic problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I'm following this. This will need a corresponding server PR to work correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there's also a server-side PR. I can push that now if you'd like, or wait until this is merged. The server-side tests don't pass until this is merged, of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and pushed RunestoneInteractive/BookServer#83. I'm leaving it as a draft for now, in case I need to update it based on the conversation here.
# ] | ||
# | ||
# ...and a transformed node structure: | ||
# | ||
# .. code-block:: | ||
# :number-lines: | ||
# :linenos: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was number-lines
a mistake? Did this change? is this 4.x ? (we are not ready for 4.x yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was strange to me also. I'm using Sphinx 3.5.2 AFAIK. I'll check...
@@ -0,0 +1,940 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these ejs files be here or npm installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a modified version of ejs to work around some bugs / limitation of ejs, hence putting it here.
// ********* | ||
// |docname| | ||
// ********* | ||
// *********************************************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might require a zoom meeting at some point to walk me through this. This is quite a complicated PR and I think either some high level written explanation to give me the big picture or a zoom would really help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite complicated, but as simple as I know how to make it. I'd be happy to chat via Zoom. Let me know when you're free.
I just merged in the latest changes from the |
Require webpack which supports the ``xxhash64`` algorithm.
Closed in favor of #1278. |
This improves fitb problems to support dynamic exercises, graded either on the client or on the server. It's based on discussions / collaboration between myself and Brian Walton.
Replaces #1225.