stackblitz / tutorialkit

TutorialKit by StackBlitz - Create interactive tutorials powered by the WebContainer API
https://tutorialkit.dev
MIT License
513 stars 49 forks source link

Parts of only one lesson #304

Closed eric-burel closed 2 weeks ago

eric-burel commented 2 months ago

Is your feature request related to a problem?

I'd like to write intro/outro parts that may not need a 3-level subdivision between part, chapter and lesson.

Currently, I need multiple levels so my introduction page maybe /getting-started/intro/about", instead of just/getting-started`. The UX is not as smooth as it could when it comes to writing proper course introductions or conclusions.

Describe the solution you'd like.

Allow having 2-levels or 1-level hierarchy.

intro
|_ _files
|_ content.md
|_ meta.md
short-part
|_ chapter-1
|__ _files
|__ content.md

Describe alternatives you've considered.

This seems a little change but I understand how this can affect UX.

Additional context

The file packages/astro/src/default/utils/routes.ts seems to be responsible to route creation and could be tweaked quite easily. However such a change may have consequences on the mental model around parts/chapters/lessons in other places.

Nemikolh commented 2 months ago

Thanks for opening this issue!

I agree with the general idea proposed here, although I would instead allow the tutorial meta to have lessons or chapters which would achieve the same thing but keep the existing logic for parts and chapters.

If we don't allow mixed hierarchies where a tutorial has both parts and chapters / lessons, then it should be pretty easy to add.