maxg / handx Goto Github PK
View Code? Open in Web Editor NEWMarkdown handouts + exercises
License: Other
Markdown handouts + exercises
License: Other
This paragraph has no linkable # marker in the left margin:
http://web.mit.edu/6.031/www/sp20/classes/22-locks/#^deadlock
but this paragraph (which also starts with a topics-and-terms word) does have a linkable # marker:
file:///Users/rcm/6.031-fa20/classes/22-locks/handout/index.html#^blocking
https://github.com/maxg/handx/blob/00ac2c3/web/handout/handout-render.js#L224
<code>
<strong>
and similar<span>
itselfWill require review and updating of many existing handouts.
For example:
[ ] Option 1
> This option is incorrect because...
[ ] Option 2
> This option is correct because...
All these checkboxes should still be treated as a single question.
Patterns are anchored only at the beginning and not at the end, so answers with arbitrary text after a matching prefix are considered correct.
Avoids places where we hack onHandoutReady
to check window.HANDOUT_PREVIEW
or window.callPhantom
, places where we should be doing that but aren't, and places where the ready callback doesn't run. See #27.
We could remove Bootstrap's URL printing entirely:
@media print {
a[href]:after {
content: "";
}
}
But perhaps we can cut off URLs after a maximum length instead?
Delivery script should already require that resources like images are valid.
Check that all hyperlinks go to working pages. (e.g. correctly renumbered classes)
Check that links go to the correct semester? (e.g. code on GitHub)
Timeouts or file-not-found errors are quietly swallowed by the lambda function, so git pushes that should deliver updates to the website are not reaching the website.
E.g. add an "airplane" mode that uses local versions of the dependencies.
A dropdown whose labels are booleans, e.g. [[(true), false]]
is always marked wrong.
https://github.com/maxg/handx/blob/f1b9405/web/handout/handout-render.js#L445
Implementation currently works around #19 for non-paragraph-item lists by looking only at their first child, but we want to look at text in all the children since each item might be very short.
When the expected answer is 0
, it is stored as numerical zero. The loose comparison with ==
used for answer checking considers random input strings equal.
for elements with class pull-margin (margin-right:-25%, position:relative):
For examples, see
classes/16-recursive-data-types/handout/recursive/index.html#@interface_declares_generic
classes/16-recursive-data-types/handout/recursive/index.html#@signature_empty_uses
https://github.com/maxg/handx/blob/f1b9405/web/handout/handout-render.js#L445
Implementation currently works around this problem for non-paragraph-item lists by looking only at their first child, but this is itself bug #20.
Are there any other problem elements? E.g. <table>
? Need to special-case all of these elements.
For text boxes with regex matching, must use e.g. [|]
rather than \|
because MarkdownExtra eats \|
into |
.
Add .with-content h2
to the selector used for building the table of contents.
go to http://web.mit.edu/6.031/www/fa17/classes/28-little-languages-2/
click the "Implementing the variables operation" header to close it
it closes briefly then pops back open
but now it's in a state where it can close and open correctly
deliver.phantom.js
should report but not exit on resource errors that won't impede rendering.
It should either appear to the right of the wrapped text, or at the end of the last line.
See 6.031 spring 17 reading 16 part 2 for examples of hand-made exercises that work reasonably well.
For example, psets/ps4/handout/index.html#gameplay_rules
6.031 is using newer versions of repo-post-receive-hook
, deliver-handouts
, and deliver-handouts-athena
e.g. with different semester naming, Slack notifications.
The recursive parser doesn't differentiate HTML tags, so:
Foo <span>bar</span> baz
becomes:
<p>Foo</p>
<span><p>bar</p></span>
<p>baz</p>
This would eliminate many situations that currently require class="no-markdown"
, e.g. <sup>
and <sub>
.
Perhaps a whitelist of elements to treat specially during recursive parsing?
Add label.exercise-part-heading
to the list of ID'ed chunks?
When the first h3
appears before the first h2
(or, in theory, if the first h2
appeared before the first h1
, which does not happen because the title is injected as a h1
), its data-outline
<div>
encloses the rest of the handout.
Need to consume siblings only up to a heading that is the same or higher.
Sometimes the lambda function fails with this error:
{
"errorType": "Error",
"errorMessage": "Navigation failed because browser has disconnected!",
"trace": [
"Error: Navigation failed because browser has disconnected!",
" at /opt/nodejs/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:51:147",
" at /opt/nodejs/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:47:62",
" at Array.map (<anonymous>)",
" at Object.emit (/opt/nodejs/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:47:43)",
" at CDPSession.emit (/opt/nodejs/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js:72:22)",
" at CDPSession._onClosed (/opt/nodejs/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:247:14)",
" at Connection._onClose (/opt/nodejs/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:128:21)",
" at WebSocket.<anonymous> (/opt/nodejs/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebSocketTransport.js:17:30)",
" at WebSocket.onClose (/opt/nodejs/node_modules/ws/lib/event-target.js:129:16)",
" at WebSocket.emit (events.js:314:20)"
]
}
Which often leaves the disk full on the lambda function execution instance (perhaps it is caused by disk-full?), and the lambda function stops working until it has been redeployed (or until the execution instance has been garbage-collected from lack of use).
Demonstrate build-related CSS classes, etc.
The iframe
has extra height to account for the unknown content of the status page, but that extra height can obscure margin content just below an exercise block.
Changing the z-index
does not work, that makes the buttons/links unclickable.
Whitespace and comments are not included by wrapAll
.
The injection of <meta charset="utf-8">
is too late for PhantomJS. Pages are not interpreted in UTF-8, and mangled characters are baked into the (ostensibly UTF-8) output.
Unfortunately, the tag is used by Chrome during local preview, masking the issue.
Workaround is to include the tag in the page.
In particular, when handouts are delivered, deliver.phantom.js
cannot await asynchronous operations in, e.g., onHandoutDidRender
or onHandoutReady
before saving the page.
For example:
<code class="no-markdown">a<sub>i</sub></code>
: the a entries
deliver-handouts
translates relative links on delivery to remove the handout
directory level, but exercise explanations have already been removed, so links in those explanations end up broken unless they use the web-ready form.
One fix would be to include the (possible) exercise JSON file in the set of files to translate.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.