Andriamanitra / clash-search

CodinGame puzzle search
https://codingame.tools
10 stars 2 forks source link

Improve how the clash statements are rendered in HTML #5

Open Andriamanitra opened 1 year ago

Andriamanitra commented 1 year ago

Currently the descriptions get rendered as plain text, ignoring special formatting directives used by CodinGame (<<Bold>>, [[Variable]], {{Constant}}, `monospace`). It would also be a good idea to show other sections in addition to the problem statement (input/output description, constraints, test cases).

There are 2 different approaches to render the special formatting directives in a nicer way:

  1. In addition to the plaintext statement the JSON for clashes includes the full statement as HTML that could be used (although currently MeiliSearch is configured to not return it to search clients). This would require some more processing and styling, because the statement HTML includes bunch of unnecessary information and headings etc.
  2. The plaintext statement could be processed to replace the formatting directives with specific styled elements.
Andriamanitra commented 1 year ago

8de9617 got rid of the extra formatting characters by regex replacing them. The formatting codes should eventually be used to make the statements look more like they do on CodinGame.