在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mpetrovich/stylemark开源软件地址(OpenSource Url):https://github.com/mpetrovich/stylemark开源编程语言(OpenSource Language):JavaScript 62.7%开源软件介绍(OpenSource Introduction):StylemarkNOTICE: This project has been abandoned. See this issue for details. Generate interactive style guides from Markdown. Document your style guide components in code comments or Markdown files, and Stylemark will generate a static HTML site with live, interactive components. ExamplesInstallationRequires Node 6.x+ npm install -g stylemark For a native app with built-in auto-updating/hot-reloading, see Stylemark App. Documenting style guide componentsDocumenting style guide components is as easy as writing Markdown. Components can be documented in dedicated Markdown files or as comment blocks within any source code. See the full Stylemark spec. As a dedicated Markdown file---
name: Button
category: Components
---
Buttons can be used with `<a>`, `<button>`, and `<input>` elements.
Types of buttons:
- Default: Standard button
- Primary: Provides extra visual weight and identifies the primary action in a set of buttons
- Success: Indicates a successful or positive action
```types.html
<button class="btn btn-default">Default</button>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-success">Success</button>
``` As a comment block within source codeThe language of your source code doesn't matter as long as the docs are in /*
---
name: Button
category: Components
---
Buttons can be used with `<a>`, `<button>`, and `<input>` elements.
Types of buttons:
- Default: Standard button
- Primary: Provides extra visual weight and identifies the primary action in a set of buttons
- Success: Indicates a successful or positive action
```types.html
<button class="btn btn-default">Default</button>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-success">Success</button>
```
*/
.btn {
display: inline-block;
text-align: center;
vertical-align: middle;
…
}
.btn-default {
…
} Generating the HTML style guideIn Node.jsstylemark({ input, output, configPath })
Example: stylemark({
input: "~/git/acme-source-code",
output: "~/acme-style-guide",
configPath: "~/acme-source-code/config/stylemark.yml",
}) On the command-linestylemark -i <input> -o <output> -c <configPath> -w [<delay>] -b [<port>]
Example: Build a style guide from stylemark -i path/to/source/code -o path/to/style/guide -c ~/acme-source-code/config/stylemark.yml Example: Build and open the style guide in a browser, and automatically rebuild and reload it when the source code is modified stylemark -i path/to/source/code -o path/to/style/guide -w -b Configuration fileThe Stylemark configuration file is a YAML file that contains settings to use when generating the HTML style guide. NOTE: All paths are relative to root project directory of the configuration file (ie. the first ancestor directory that contains name: Name of the style guide
excludeDir: (optional) Regex pattern (in double quotes) or list of directories to exclude; .git and node_modules are always excluded
match: (optional) Regex pattern or list of files to process; by default, common source files are included
assets: (optional) List of relative file/directory paths to copy and mirror in the generated style guide
theme:
logo: (optional) Filepath or URL of your logo
css: (optional) List of any CSS files to include in the <head> of the generated styleguide; see Theming section
js: (optional) List of any JS files to include in the <body> of the generated styleguide; see Theming section
sidebar:
background: (optional) Background of the sidebar; any valid CSS background property allowed, but hex colors must be quoted
textColor: (optional) Text color of the sidebar; any valid CSS color property allowed, but hex colors must be quoted
examples:
css: (optional) List of any CSS files to include in the <head> of each rendered example
js: (optional) List of any JS files to include in the <head> of each rendered example
doctypeTag: (optional) HTML doctype to use for each rendered example; defaults to "<!doctype html>"
htmlTag: (optional) <html> tag to use for each rendered example; defaults to "<html>"
bodyTag: (optional) <body> tag to use for each rendered example; defaults to "<body>"
headHtml: (optional) HTML to insert before the closing </head> tag for each rendered example
bodyHtml: (optional) HTML template of the example; the example's HTML content will be inserted in place of "{html}"
webpackAppPath: For Webpack apps (esp. React, Angular, etc.), this is the `output.library` value in your webpack config
emberAppName: For Ember apps, this is the name of the Ember app exported to the window object
order: (optional) See Ordering section OrderingThe relative order of categories can be defined by prefixing a category name with
Omitted categories are ordered as if they were included but unprefixed. Within each of the
ThemingThe look and feel of the generated styleguide can be customized in the For example:
With that configuration, Stylemark will include Stylemark includes a number of CSS class hooks you can use to style specific elements. These CSS classes all start with
IMPORTANT: Use only these Example configurationHere's a sample configuration with all options provided: name: Acme Design
excludeDir:
- dist
- docs
assets:
- dist
- fonts
theme:
logo: assets/brand/logo.png
css:
- theme/theme.css
js:
- theme/theme.js
sidebar:
background: "#3b2a55"
textColor: "#fff"
examples:
css:
- dist/css/app.min.css
js:
- https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
- dist/js/app.min.js
doctypeTag: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
htmlTag: <html id="acme">
bodyTag: <body class="acme-body">
headHtml: |
<meta name="google-site-verification" content="52cae…">
<script>
window.disableRouting = true;
</script>
bodyHtml: |
<div style="padding: 20px">
{html}
</div>
order:
- +Introduction
- +Installation
- -Credits |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论