-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* convert all packages * script to convert scss docs to md files * remove Weights, convert to `@#+` * add pages for common files * add `@page` roots * 4-space md files (mostly for source) * remove some `parent` front matters * remove docs from .scss except markup & modifiers
- Loading branch information
Showing
100 changed files
with
3,136 additions
and
3,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
const glob = require("glob"); | ||
const fs = require("fs"); | ||
|
||
// captures: [title, body, reference] | ||
const BLOCK_REGEX = /\/\*\n(.+)\n\n((?:.|\n)+?)\nStyleguide:? (.+)\n\*\//g; | ||
|
||
const HEADINGS = "######"; | ||
|
||
glob.sync("packages/core/src/components/*/*.scss") | ||
.filter((filepath) => !/common\.scss$/.test(filepath)) | ||
.forEach((comp) => { | ||
const scss = fs.readFileSync(comp, "utf-8").replace(/^ */gm, ""); | ||
const contents = [`---\nparent: ${comp.indexOf("/forms/") > 0 ? "forms" : "components"}\n---`]; | ||
|
||
/** @type {RegExpExecArray} */ | ||
let match; | ||
// tslint:disable-next-line:no-conditional-assignment | ||
while ((match = BLOCK_REGEX.exec(scss)) !== null) { | ||
const [title, body, reference] = match.slice(1); | ||
const depth = reference.split(".").length - 1; | ||
|
||
contents.push( | ||
`${HEADINGS.slice(0, depth)} ${title}`, | ||
body.trim().replace(/@\w+(-\w+)/g, (tag, ext) => tag.replace(ext, ext[1].toUpperCase() + ext.slice(2))) | ||
); | ||
} | ||
fs.writeFileSync(comp.replace(".scss", ".md").replace("/_", "/"), contents.join("\n\n") + "\n"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@# Alerts | ||
|
||
Alerts notify users of important information and force them to acknowledge the alert content before | ||
continuing. | ||
|
||
Although similar to [dialogs](#components.dialog), alerts are more restrictive and should only be | ||
used for important informations. The user can only exit the alert by clicking one of the | ||
confirmation buttons—clicking the overlay or pressing the `esc` key will not close the alert. | ||
|
||
You can only use this component in controlled mode. Use the `onClick` handlers in the primary and | ||
secondary action props to handle closing the `Alert`. Optionally, display an icon next to the body | ||
to show the type of the alert. | ||
|
||
@reactExample AlertExample | ||
|
||
@## JavaScript API | ||
|
||
The `Alert` component is available in the __@blueprintjs/core__ package. | ||
Make sure to review the [general usage docs for JS components](#components.usage). | ||
|
||
@interface IAlertProps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@# Breadcrumbs | ||
|
||
Breadcrumbs identify the current resource in an application. | ||
|
||
@## CSS API | ||
|
||
* Begin with a `ul.pt-breadcrumbs`; each crumb should be in its own `li` as a direct descendant. | ||
* Breadcrumbs are typically navigation links (for example, to the parent folder in a file path), and | ||
therefore should use `<a>` tags (except for the final breadcrumb). | ||
* Each navigation breadcrumb should use `.pt-breadcrumb`. | ||
* Make a breadcrumb non-interactive with the `.pt-disabled` class. You should only use this | ||
state when you want to indicate that the user cannot navigate to the breadcrumb (for example, if | ||
the user does not have permission to access it). Otherwise, clicking a breadcrumb should take the | ||
user to that resource. | ||
* Mark the final breadcrumb `.pt-breadcrumb-current` for an emphasized appearance. | ||
* The `.pt-breadcrumbs-collapsed` button-like element can be used as the target for a dropdown menu | ||
containing breadcrumbs that are collapsed due to layout constraints. | ||
* When adding another element (such as a [tooltip](#components.tooltip) or | ||
[popover](#components.popover)) to a breadcrumb, wrap it around the contents of the `li`. | ||
|
||
@## JavaScript API | ||
|
||
The `Breadcrumb` component is available in the __@blueprintjs/core__ package. | ||
Make sure to review the [general usage docs for JS components](#components.usage). | ||
|
||
The component renders an `a.pt-breadcrumb`. You are responsible for constructing | ||
the `ul.pt-breadcrumbs` list. [`CollapsibleList`](#components.collapsiblelist) | ||
works nicely with this component because its props are a subset of `IMenuItemProps`. | ||
|
||
@interface IBreadcrumbProps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.