Closed dmalan closed 2 years ago
This is inspired by https://cs50.readthedocs.io/lab/, with these differences:
README.md
is now required; no README-less labs.editor
anymore.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.
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
whereby:
CMD
is the command to run in the terminal; if not provided, terminal should use default; it is an error to providecmd
but notterminal
files
is an array of files to open in the editor, from left to right, with the leftmost tab foregrounded ultimatelyreadme
is the URL via which to autoupdateREADME.md
browser
embeds a browser to the right of the editor and console, full height; it's an error to usex
tooterminal
embeds a single terminal window in the consolex
embeds an X window to the right of the editor and console, full height; it's an error to usebrowser
tooPORT
is the TCP port with which to configure an embedded browser (onlocalhost
); it is an error to provideport
but notbrowser
; defaults to8080