griffel icon indicating copy to clipboard operation
griffel copied to clipboard

docs: use autogenerated pages for try out

Open layershifter opened this issue 3 years ago • 0 comments

Currently our https://griffel.js.org/try-it-out/ is powered by hash based based on snippets collected in Playground component:

https://github.com/microsoft/griffel/blob/62cf39c860782a69ea9c89d797cdda094a3605a6/apps/website/src/components/Playground/index.tsx#L9

Ideally we should have:

  • a real page for every example i.e. /try-it-out/margin
    • remove require.resolve() in Playground
  • pass source as a string Playground component
    <Playground source={props.source} />
    
  • it be part of docusaurus start i.e. no other commands are required to update these pages

Ideally, we are looking for something like getStaticPaths() in Next.js, but in docusaurus 🙃

layershifter avatar Sep 26 '22 15:09 layershifter