Show Markdown task statements in CWS
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
This ws previously requested in #859, but the discussion there got quite far off topic so i'm making a new issue for it.
I think Markdown would be quite reasonable for writing task statements. I also think some sort of math rendering would be useful. (initially i thought it was completely obvious that this is necessary, but thinking about it a bit more, it's possible to do quite a lot using just a serif italics font for variable names. so maybe it's not quite necessary? but i'd still prefer having it.)
My proposal would be to render task statements as markdown, and use KaTeX for rendering math. (there are other math-in-browser libraries, but i'm not aware of any that are better than katex.) The markdown parser needs to be aware of math syntax to some degree, to avoid interpreting the math syntax as markdown commands. It seems like the markdown-it-py parser we already use has a plugin for this. Then the markdown would be parsed server-side, like it currently is, and math would be rendered client-side by katex.
Some of the math-rendering libraries can apparently also be used server-side, but they all seem to be written in javascript so they would add nodejs as a dependency, which i don't think we'd want.
Another alternative would be to do everything client-side, including markdown. There are plenty of libraries for this. It would then make sense to use the same library for rendering announcements (which would allow removing the server-side dependency on markdown-it-py).
Also, there needs to be some way to include images in task statements. Is it enough to support data:image/png;base64, uris or should we allow uploading additional files for a statement?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue mentions markdown-it-py, server-side parsing, client-side KaTeX, and announcements but names no files or tests. Start by tracing the current task-statement and announcement rendering, then compare the proposed server/client approaches and image handling. Done criteria remain unresolved, including math and image support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, python
- Domain
- backend, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100