Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan for learner/instructor view #12

Closed
zkamvar opened this issue Nov 16, 2021 · 0 comments
Closed

Plan for learner/instructor view #12

zkamvar opened this issue Nov 16, 2021 · 0 comments
Labels
implementation discussion on implementation items

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Nov 16, 2021

The new frontend is coming soon and we will need to make sure that we connect the wires properly.

variables

The contractor tried to separate out the common components and used jekyll templating to achieve this, which is very similar to mustache templating. The variables they used were:

  • header-type : one of "software", "data", "library", or "carpentries" (I believe this will probably the incubator color as well)
  • logo : takes from header-type and points to -logo.svg
  • logo-sm : similar to logo, but small
  • progress: the percentage of the way through the lesson by page (not taking into consideration page length).

That being said, we will need to consider the variables we already use for the header/footer.

learner/instructor view

Because we now have differing views based on learner and instructor views, we also need to reconsider how the pages will be laid out.

Right now, everything is flat, which means that all pages are at URL/page.html and there is no URL/folder/page.html. Because we now have a button that can switch between the learner and instructor view, which will have different information associated, we have different options:

Default Learner view; duplicated instructor view in nested folder

For example, when I visit https://carpentries.github.io/sandpaper-docs/pull-request, I will see the default "learner view", which will have things like the glossary in the top bar, but when I click on "Instructor view", I will be taken to https://carpentries.github.io/sandpaper-docs/ins/pull-request (or maybe spell out instructor fully)

Importantly, the instructor view setting should not change if the user changes pages. The only time the instructor view should change is if the user explicitly requests a change in view from the dropdown. The most straightforward way to implement this is: make a direct copy of all HTML pages (not the assets) into the instructor/ subdirectory and make sure the assets exist.

  • Pros: relatively straightforward to implement, can be accessed offline, clear labelling of URL for easy navigation between views
  • Cons: increases the size of the repository and increases the build time even if lessons have no instructor components, this also increases the potential for link rot and will affect our SEO stats since /page and instructor/page are not the same (but then again, it might give us better stats to figure out who is using it 💡)

JavaScript-mediated switch

Because the learner and instructor views would be not significantly different (instructor view allows in-document instructor notes), we might want to avoid duplication by including everything in the page and using client-side JavaScript to manipulate the DOM to show/hide the instructor note element depending on what view is selected.

  • Pros: simpler SEO, lighter page, less time for build
  • Cons: no direct way to access instructor page (maybe a ?query). Unknown developer time to implement because we do not have frontend expertise. Unknown how this will affect offline use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation discussion on implementation items
Projects
None yet
Development

No branches or pull requests

1 participant