npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

svelte-blueprint

v2.0.4

Published

Create documentation of svelete components

Downloads

100

Readme

Svelte blueprint 🏗️

Build svelte components documentation.

Svelte-blueprint create documentation files for components based in comments in the source code.

⚠️ For version 2.0.0 all js code has been migrated to rust-lang.

🗨️ For spanish go here.

Install

$ npm i -D svelte-blueprint

Example of output:

example1

Creating a component ...

Svelte component files should include some comments in order to generate a better documenation file.

  • A description for the comment can be included as:

    <!--D Description of the component -->
  • To add a description of a prop just add a single line comment next to it's definition.

    export let name // Name string
  • To set usage example add:

    <!--E
        <Component  />
    -->

The tool can be used in a svelte project via plugins or cli.

🔌 Plugins

  • Rollup for svelte-blueprint < 2.0.0
  • Vite for svelte-blueprint >= 2.0.0

🖥️ Cli

After the package is installed it can run via terminal client.

Usage

$ ./node_modules/svelte-blueprint/blueprint/target/release/blueprint -h
Usage: blueprint [OPTIONS] [COMMAND]

Commands:
  document  Create svelte documentation files
  help      Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...  Turn debugging information on
  -h, --help        Print help
  -V, --version     Print version

Command document

$ ./node_modules/svelte-blueprint/blueprint/target/release/blueprint document -h
Create svelte documentation files

Usage: blueprint document [OPTIONS] --source <FILE> --destination <Directory>

Options:
  -s, --source <FILE>            Sets a source path
  -d, --destination <Directory>  Sets a destination path
  -t, --template <FILE>          Sets a template for the final component
  -h, --help                     Print help

Templates

By default, the genrated Blueprint file uses a Blueprint Component contained in this library.

You can customize the colors of that template or use your own template.

These are the variables you may want to override to match your own style.

 :global(:root) {
    --svelte-blueprint-background: transparent;
    --svelte-blueprint-color: #3e3e3e;
    --svelte-blueprint-accent: #55c1ff;
    --svelte-blueprint-table-border: #e7e7e7;
    --svelte-blueprint-table-background: #fff;
    --svelte-blueprint-table-hover: #eaeaea;
    --svelte-blueprint-table-header-color: #fff;
}

If you need to use your own template this are the svelete slots you should define:

<slot name='description' > 
    Component description
</slot>
<slot name='props'>
    Component properties
</slot>
<slot name='slots'>
    Component slots
</slot>
<slot name='example'>
    Component example
</slot>

Also you may want to use these props:

title
code

For a better understanding, checkout the default template

Guides

  • Youtube for svelte-blueprint < 2.0.0