cms-dev / cms-dev/cms

Show Markdown task statements in CWS

Open
#1,463 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cws feature_request
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.