Cauen / prisma-generator-pothos-codegen

The fastest way to create a fully customizable CRUD Graphql API from Prisma Schema.
https://www.npmjs.com/package/prisma-generator-pothos-codegen
100 stars 19 forks source link

Automatically generate README table of contents #38

Closed coopbri closed 1 year ago

coopbri commented 1 year ago

Based on https://github.com/Cauen/prisma-generator-pothos-codegen/pull/33#issue-1571695978

Automatically generate README table of contents using markdown-toc. Note that this library hasn't had a commit since 2021, but it seems to work well. Also note that the --no-firsth1 flag skips adding the first README header/title.

This PR currently has the generation in the postbuild script -- we may want to move this to a different build hook. We may also want to move the generation code to its own script (e.g. generate:toc or something, and call it automatically from a build hook script or a CI workflow). Let me know!

Cauen commented 1 year ago

Awesome, @coopbri 🎉 Thanks for the contribution

we may want to move this to a different build hook. We may also want to move the generation code to its own script (e.g. generate:toc or something, and call it automatically from a build hook script or a CI workflow). Let me know!

I think it's fine :)

Cauen commented 1 year ago

Needed to revert, once i was unable to generate a working toc (PR generated toc in the print) Used https://ecotrust-canada.github.io/markdown-toc/ to generate the new... Its using the same lib, but works O.o I'll see this later e.e

image

coopbri commented 1 year ago

Weird!! I'll try to debug as well.