stackblitz / tutorialkit

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

When using code snippet from file, if no title is specified, place the file name #392

Open noam-honig opened 4 weeks ago

noam-honig commented 4 weeks ago

Is your feature request related to a problem?

Almost everytime I use a file as a code snippet, I also write the same name of the file as the title for that code snippet

For example:

```file:/frontend/Page.tsx title="frontend/Page.tsx"


### Describe the solution you'd like.

It'll be great if when no title was specified, the file name will be used as the title by default.

### Describe alternatives you've considered.

Writing it manually

### Additional context

Love your work
AriPerkkio commented 3 weeks ago

[...] the file name will be used as the title by default

With this approach, how could users disable the title?

noam-honig commented 3 weeks ago

@AriPerkkio I think that when you import a file - the common case, is that you'll want its name in the title. users who will not want a title can set the title to "".

Alternatively - you can add a new flag called autoTitle that'll automatically set the title.