balena-io / pensieve

A tool for managing and viewing structured documents, backed by the power of git
7 stars 5 forks source link

Setup in index.html seems a bit odd #237

Open lurch opened 6 years ago

lurch commented 6 years ago

Only a minor issue, but it seems a bit weird that in the index.html setup schema is scoped at the 'top level' but file is scoped inside the repo object? schema and file are both files in the same repo, so they should probably be scoped similarly? And also, given how tightly-coupled the contentPath and file attributes are, it also seems odd that these are scoped differently?

Perhaps the easiest way to fix both these points would be to move file outside of the repo object, so that repo only specifies name, account and ref? Also, it might make sense to show account before name in the example, as GitHub URLs always have the account (user) before the name (repo)?

lurch commented 6 years ago

Also, following on from comments by @sqweelygig , maybe it'd make sense to apply default values to some of these parameters if no value is explicitly set? schema could default to schema.yaml, contentPath could default to content, file could default to document.yaml, and ref could default to master; leaving the only required-params as account and name. Connects to #241

Hmmm, and I've just spotted that ref is documented as The name of the commit/branch/tag. usually the repository’s default branch (eg master) - if a commit or tag is used here, how does the Save-changes work in Pensieve? Would it effectively become readonly?

sqweelygig commented 6 years ago

And interestingly, since I'm hosting my static index.html page (the /docs directory of https://github.com/resin-io/integration-ecosystem) via github pages the account and name are also present in the window.location of https://resin-io.github.io/integration-ecosystem/index.html

lurch commented 6 years ago

A no-config Pensieve would be a very sweet thing indeed ;)

lurch commented 6 years ago

And in an effort to minimise the amount of config needed, maybe if the index.html doesn't set a <title> tag, that could also be set automatically from the repo's name?