govariantsteam / govariants

A place to play Go variants
https://www.govariants.com
GNU Affero General Public License v3.0
5 stars 1 forks source link

add rules view #296

Closed merowin closed 1 month ago

merowin commented 1 month ago

I figured it would be good to add a rule description page.

issue: #112

Adds a new view for variant rule descriptions, alongside the rules of fractional.

merowin commented 1 month ago

I don't understand why the pipeline has an error, to be honest.

benjaminpjones commented 1 month ago

I don't understand why the pipeline has an error, to be honest.

I think there are some HTML issues:

https://stackoverflow.com/a/60344917

merowin commented 1 month ago

I don't understand why the pipeline has an error, to be honest.

I think there are some HTML issues:

* p is a "self-closing" tag

* ul/li not allowed in p

https://stackoverflow.com/a/60344917

Thank you, I did not know that.

benjaminpjones commented 1 month ago

I like the idea! One idea (that doesn't necessarily need to be implemented in this PR):

Would be nice if the content were not tied to Vue since it's static, and not using Vue's reactivity. Ideally it would be some raw HTML (or better yet, Markdown), and then we could store it in shared/ and add it to the variant_map, instead of creating a separate map in RulesView.

merowin commented 1 month ago

Would be nice if the content were not tied to Vue since it's static, and not using Vue's reactivity. Ideally it would be some raw HTML (or better yet, Markdown), and then we could store it in shared/ and add it to the variant_map, instead of creating a separate map in RulesView.

I moved the html content into shared as a string and "inject" it with vue-html. This way we can use variant_map, unfortunately the html highlighting / auto-completion is lost.

JonKo314 commented 1 month ago

unfortunately the html highlighting / auto-completion is lost.

Because it's a TypeScript file. It could also be an HTML file, but that would make importing it more complicated.

benjaminpjones commented 1 month ago

Yeah, the lack of highlighting is a bummer. As @JonKo314 said, we could push it into an html file, and get html IDE support. On the other hand, this could be a reason to use Markdown - it's easy to read and write even without IDE support.

merowin commented 1 month ago

I don't know how to render the markdown, but in theory it sounds good.