Rob's garden / notes / note

Note

I've been playing around with streamlining documentation by pulling JSDoc comments straight into an #11ty website. I'll try and write it up once I get it to somewhere I'm a bit happier with.

For example, this page is partially generated based on the comments directly in the JavaScript code

https://github.com/robb-j/gruber/blob/main/postgres/postgres-migrator.ts

It's pretty cool, and hopefully makes the documentation so much closer to edit when the code itself changes, Though I think there needs to be more curatability in it.

Some screenshots so it's easier to understand:

TypeScript code reading:

/**

  • A record in a postgres database containing information about a migration that has been run.
  • const record = {
  • name: '001-add-users-table.js',
  • created: new Date()
  • }

*/ export interface PostgresMigrationRecord { name: string; created: Date; }

a HTML page with the contents:

PostgresMigrationRecord (type)

A record in a postgres database containing information about a migration that has been run.

Then there is an inline code example