cs50 / lab50.vsix

Inspired by https://github.com/lostintangent/workspace-layout/
GNU General Public License v3.0
21 stars 4 forks source link

Possible to support these keys in `README.md` YAML front matter? #25

Closed dmalan closed 2 years ago

dmalan commented 2 years ago
lab50:
  cmd: CMD
  files:
    - foo.c
    - bar.c
  port: PORT
  readme: README
  window:
    - browser
    - terminal
    - x

whereby:

dmalan commented 2 years ago

This is inspired by https://cs50.readthedocs.io/lab/, with these differences:

I don't love the readme key at the moment, since it feels redundant for README.md to exist locally and just get overwritten by a remote copy. But I'm not sure we need to generalize autoupdates to support files besides README.md.

If we were to move all this YAML to the top of README.md itself, whereby it could be contained in YAML front matter instead of in .cs50.yml, that might be cleaner, if we're requiring that README.md exist anyway. Feels a bit redundant for .cs50.yml also to exist. But that would then start to drift from our implementations of submit50 and check50. Then again, this .cs50.yml is being used locally, not remotely in a repo, so it's already a bit different; we haven't distributed .cs50.yml files to students before.

dmalan commented 2 years ago

If we were to move the YAML to README.md instead, the top of the file could instead look like:

---
cmd: CMD
files:
  - foo.c
  - bar.c
port: PORT
url: URL
window:
  - browser
  - terminal
  - x
---
# README
...

where URL would be a value like https://github.com/cs50/lab50.vsix/blob/main/lab_demo/README.md or https://raw.githubusercontent.com/cs50/lab50.vsix/main/lab_demo/README.md.

This way, too, it would suffice to check for the presence of a README.md in a dir, to decide whether to show Open in CS50 Lab.

If there's no YAML present, defaults could be:

files: []
window:
  - terminal
rongxin-liu commented 2 years ago

https://github.com/cs50/lab50.vsix/commit/d08db648d99a5fe5564f2a5ab178f80f0c386c8e