Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Markdown-based styleguide generator

License

NotificationsYou must be signed in to change notification settings

peopledoc/styledown

Repository files navigation

Write maintainable CSS styleguides efficiently using a Markdown.

Example

ℹ️ This package is forked fromStyledown.

Installation

Add the github registry in your.npmrc for @peopledoc scoped package:

# Points to Github NPM registry@peopledoc:registry=https://npm.pkg.github.com

Then you can install it:

npm install -g @peopledoc/styledownstyledown --help

How it works

Styledown is made to work in most web development setups. It doesn't favor any framework or language or any preprocessor.

  • Document your CSS files with inline comments, or as a separate.md file.
  • Create a file with styleguideconfiguration.
  • Invokestyledown *.css > styleguide.html.
  • Enjoy your styleguide! Read more about theformat.

Quickstart guide

Here's a generic guide on getting started with Styledown on any project. We'regonna assume that you're using Sass and that your project bundles all CSS filesinto one file.

Let's assume that your files are incss/, and that your final styleguide willbe inpublic/styleguide.html.

                    Example setup.----------------------.     .---------------------.| css/                 |     |                     ||     config.md        |     |  public/            ||     button.scss      | ==> |    styleguide.html  ||     forms.scss       |     |                     ||     whatever.scss    |     |                     |'----------------------'     '---------------------'

Step 1: Document

Document your project's stylesheets with inline comments, or as separate.mdfiles.

/** * Component name: * `.your-component-here` - documentation on what your * component is goes here. Markdown is encouraged. * *     @example *     div.your-component-here *       h3 Sample code *       p goes here */.your-component-here {display: block;/*...*/}

Read more:Documenting ▸

Step 2: Configure

Make a file, let's call itconfig.md. (styledown --conf > config.md) Thislets you define what will be in the output head/body.

#Styleguide options###Headlink(rel="stylesheet" href="/assets/application.css")<style>  /* styledown css */</style><script>  /* styledown js */</script>###Bodyh1 My Awesome Styleguidesdiv#styleguides(sg-content)

The first one (application.css) should point to your project's concatenatedstylesheets. The second and third one (styledown.css andstyledown.js)point to the default Styledown CSS/JS files.

Read more:Configuration ▸

Step 3: Build

Invokestyledown to generate an HTML file. (Make sure that the extras.css ispassed on the end, since anything after the "Styleguide options" heading is ignored.)

 styledown css/*.css css/config.md> public/styleguides.html

Enjoy!

Now openpublic/styleguides.html in your browser.

Usage

Styledown generates.html styleguides. It can take CSS files or Markdownfiles, or a combination of the two.

Inline CSS mode: Parses comments from CSS files. This is what happens whenyou pass .css, .sass, .scss, .less and .styl files.

 styledown*.css> styleguide.html

Markdown mode: Takes Markdown files.

 styledown*.md> styleguide.html

Markup format

Read more:Markup format ▸

Contributors

rstacruz
rstacruz
KamiKillertO
KamiKillertO
ryuran
ryuran
MrChocolatine
MrChocolatine
GreatWizard
GreatWizard
Erol
Erol

[8]ページ先頭

©2009-2025 Movatter.jp