Skip to content

Conversation

@cycle4passion
Copy link

I did not take this to the conclusion of adding imports to individual layerchart components. I expect you'll want to tweak it before that step.

This script generates mini-docs component files for all components in the layerchart library.

  • It extracts API properties from the generated/api/*.json files.
  • It extracts metadata from the docs/src/content/*.md files.
  • It extracts 1st usage example from the docs/src/examples/components/*.svelte files.
  • It trims the code to remove module exports and data export statement.
  • It applies the appropriate indentation to the code to preserve the indentation of the code in mini-docs.
  • It generates the mini-docs content and saves it as a svelte file in docs/src/generated/mini-docs/*.svelte.
  • Once the components are imported to the Layerchart components, you can hover over the component in the IDE to see mini docs for each component.

@description

  • Scans all .md files in docs/src/content and extracts:
    • Component name
    • Component URL
    • Description
    • Category
    • Layers
    • Related
    • Usage example
  • @output Generates individual ts files in generated/mini-docs/ for each component

I did not take this to the conclusion of adding imports to individual layerchart components. I expect you'll want to tweak it before that step.

This script generates mini-docs component files for all components in the layerchart library.
 * It extracts API properties from the generated/api/*.json files.
 * It extracts metadata from the docs/src/content/*.md files.
 * It extracts 1st usage example from the docs/src/examples/components/*.svelte files.
 * It trims the code to remove module exports and data export statement.
 * It applies the appropriate indentation to the code to preserve the indentation of the code in mini-docs.
 * It generates the mini-docs content and saves it as a svelte file in docs/src/generated/mini-docs/*.svelte.
 * Once the components are imported to the Layerchart components, you can hover over the component
 * in the IDE to see mini docs for each component.

 @description
 * Scans all .md files in docs/src/content and extracts:
 * - Component name
 * - Component URL
 * - Description
 * - Category
 * - Layers
 * - Related
 * - Usage example

- @output
Generates individual ts files in generated/mini-docs/ for each component
@changeset-bot
Copy link

changeset-bot bot commented Jan 3, 2026

⚠️ No Changeset found

Latest commit: ba974a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/layerchart@752

commit: ba974a4

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
layerchart ✅ Ready (View Log) Visit Preview ba974a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant