Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
live-guide
Advanced tools
live-guide
is a subset of Markdown that allows developers one place to create both documentation and a styleguide for their end users. Simply write comments, get styleguides!
/**
* ### Links
* Link do not need any special class names to match stylistically, however they should follow some convetions
* - links should direct users through the page
* - links should direct pages to outside pages or pages of content within the site structure
* - links **should not** be used to trigger user actions such as modals.
*
* @example html
* <a href="#">I am a link</a>
*/
a {
display: inline-block;
color: var(--accent);
text-decoration: none;
vertical-align: middle;
font-weight: 700;
border-bottom: 1px solid transparent;
}
a + a {
margin-top: 1vw;
}
a:hover {
border-bottom: 1px solid var(--primary-dk);
}
const styleguide = require('live-guide');
const options = {
input: "src/**/*.css",
resources: ['path/to/compiled/style.css', 'path/to/other/required/files/app.js']
};
styleguide(options)
.then(function(data) {
// Do something after styleguide is compiled.
// data refers to an array of objects containing all the relevant data from your build
});
type: path
description: Glob pattern to files to read comments from.
required: true
default: none
type: path
description: Where to export HTML files.
required: false
default: ./styleguide
type: Array
description: Path (relative or absolute) to files to import into styleguide examples
required: false
default: none
type: String
description name of style guide
required: false
default: Styleguide
type: Module
description Additional syntax parsers that will be merged with the default syntaxes. This preforms a deepmerge
so you can override existing functionality.
required: false
default: {}
$ npm install --global live-guide
$ live-guide --input="path/to/**/*.css" --output=/var/www/styleguide --resource path/to/style.css another/path/here.js
styleguider --input **/*.css [options]
Options:
--input, -i file(s) (glob pattern) that should be evaulated and built into the Styleguide [required]
--output, -o Where should the output styleguide go? Defaults to current working directory /styleguide
--resource, -r additional resources to be loaded into the code example iframes [array]
--name, -n name for the style guide or product
--syntax, -s add or override syntax filters to our main parser, this preforms a deepmerge
--help, -h Show help [boolean]
Description: Contribute the code to someone. Example:
/* @author Jan Doe */
// @author Jon Doe
Description: Set a description for this section of the styleguide, generally used after an @title
Example:
/* @description This describes your component or module */
//@description This describes your component or module
Description: A code example, similar to writing code blocks in Markdown
Any example will need a blank comment line after it.
You can add blank lines in examples with
.
Example:
//@example
//<button class="btn">Click me, I do stuff!</button>
//
/*
@example
*<button class="btn">Click me, I do stuff!</button>
*/
Description: Allows line to be skipped on output
Description: The title of the component, module or API you are developing
Description: Let users know what needs to be done in this section of your styleguide
Description: Add a link to the styleguide, automatically opens in a new tab
Description: If you want the file name to be different than the title, for instance setting up an index page. There is no need to provide a file extension
FAQs
Generate style guides based on commented style sheets.
The npm package live-guide receives a total of 4 weekly downloads. As such, live-guide popularity was classified as not popular.
We found that live-guide demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.