Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Overhaul #917

Merged
merged 35 commits into from
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a56b804
split docs package into `docs` and `docs-site`
Mar 29, 2017
f0f781f
move BaseExample into `docs` package
Mar 29, 2017
62ec82e
move typings around
Mar 29, 2017
167eb96
fix docs-site webpack compile errors!
Mar 29, 2017
57d6798
fix sass compile errors
Mar 29, 2017
6fea121
require react ^15.3 so we can use PureComponent
Mar 29, 2017
a817270
clean up docs common files
Mar 29, 2017
e87dea5
move FocusStyleManager call into Styleguide componentDidMount
Mar 29, 2017
023b159
fix html paths
Mar 29, 2017
fa7373f
fix broken import (forgot to save)
Mar 29, 2017
1ae362d
rename Styleguide to Documentation
Mar 29, 2017
f29d78e
copyright headers
themadcreator Mar 29, 2017
92cc546
Merge branch 'feature/publish-docs' of github.com:palantir/blueprint …
themadcreator Mar 29, 2017
1d4dfa5
move docs-site files into same structure as docs
Mar 29, 2017
2681625
Documentation navbarLeft/Right props
Mar 29, 2017
cb396ab
make some Documentation props optional
Mar 29, 2017
2b45ad3
remove theme from docs
Mar 29, 2017
27195bf
enable strictNullChecks in docs and docs-site!!
Mar 29, 2017
bbc98bb
move docs md file, rename styleguide.md to blueprint.md
Mar 29, 2017
44a4349
Update to documentalist 0.0.7
themadcreator Mar 29, 2017
8850502
Merge branch 'feature/publish-docs' of github.com:palantir/blueprint …
themadcreator Mar 29, 2017
601d1b8
move .d.ts and README around
Mar 29, 2017
591ab86
move normalize.css import to docs-site.scss
Mar 29, 2017
01a3687
fix some small build errors
Mar 29, 2017
73d8def
add project files
Mar 29, 2017
88d3697
update links to docs-site
Mar 29, 2017
19e3661
Add top comment block to interface table tag renderer
themadcreator Mar 30, 2017
536877e
Merge branch 'feature/publish-docs' of github.com:palantir/blueprint …
themadcreator Mar 30, 2017
56f4a34
export BaseExample from docs package, refactor example imports
Mar 30, 2017
ec3be13
fix CONTRIBUTING docs path
Mar 30, 2017
f1d3d69
Null check when naving to section
themadcreator Mar 30, 2017
05081e1
Lint
themadcreator Mar 30, 2017
10c9a69
Add docs-site artifact
themadcreator Mar 30, 2017
7c01073
Fix gulp watch task
themadcreator Mar 30, 2017
d4eb32b
minor polish
Mar 31, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A typical contributor workflow looks like this:
1. Create a new feature branch. We use a format like `[your-initials]/[short-name]`:
`bd/refactor-buttons`.
1. Run the development server via `gulp` (no arguments).
- Navigate to http://localhost:9000/packages/docs/dist/ when the server starts.
- Navigate to http://localhost:9000/packages/docs-site/dist/ when the server starts.
- See [Build tasks](https://github.com/palantir/blueprint/wiki/Build-tasks) on the wiki for more
details on the inner workings of the Gulp build.
- If you are contributing to the `table` or `landing` packages then run `npm start` in those
Expand Down
8 changes: 8 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,18 @@ const projects = [
}, {
id: "docs",
cwd: "packages/docs/",
dependencies: ["core"],
sass: "compile",
typescript: true,
}, {
id: "docs-site",
cwd: "packages/docs-site/",
dependencies: [
// You must add your package to this dependency list if you have any
// examples in the docs.
"core",
"datetime",
"docs",
"table",
],
sass: "bundle",
Expand All @@ -87,6 +94,7 @@ const projects = [
// (they all import @blueprint/* but don't actually have themselves in their node_modules)
"@blueprintjs/core",
"@blueprintjs/datetime",
"@blueprintjs/docs",
"@blueprintjs/table",
"dom4",
"moment",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ __Prerequisite__: Node.js v6 or v7
1. `npm install` to install build dependencies
1. `npm run bootstrap` to install and link each package using [Lerna](https://lernajs.io/)
1. `npm run gulp` to compile and start the server and watcher
1. Open your browser to [localhost:9000/packages/docs/dist/](http://localhost:9000/packages/docs/dist/)
1. Open your browser to [localhost:9000/packages/docs-site/dist/](http://localhost:9000/packages/docs-site/dist/)

## Contributing

Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ general:
- packages/core/dist
- packages/datetime/dist
- packages/docs/dist
- packages/docs-site/dist
- packages/landing/dist
- packages/table/dist
# code coverage reports
Expand All @@ -22,6 +23,7 @@ dependencies:
- packages/core/node_modules
- packages/datetime/node_modules
- packages/docs/node_modules
- packages/docs-site/node_modules
- packages/landing/node_modules
- packages/table/node_modules
# non-zero exit codes in `dependencies` group will fail the build early
Expand Down
2 changes: 1 addition & 1 deletion gulp/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = (blueprint, gulp, plugins) => {
const text = require("./util/text");
const spawn = require("child_process").spawn;
const semver = require("semver");
const cwd = blueprint.findProject("docs").cwd;
const cwd = blueprint.findProject("docs-site").cwd;

const config = {
data: path.join(cwd, "src", "generated"),
Expand Down
6 changes: 3 additions & 3 deletions gulp/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = (blueprint, gulp, plugins) => {
gulp.task("watch-files", ["connect"], () => {
blueprint.projectsWithBlock("sass").forEach((project) => {
const tasks = [`sass-${project.id}:only`];
if (project.id !== "docs") {
if (project.id === "core") {
tasks.push("sass-variables");
}
gulp.watch(createSrcGlob(project, "*.scss"), tasks);
Expand All @@ -36,8 +36,8 @@ module.exports = (blueprint, gulp, plugins) => {

gulp.watch("packages/*/!(node_modules)/**/*.md", ["docs-json"]);

// recompile docs CSS when non-docs dist/*.css files change
gulp.watch("packages/!(docs)/dist/*.css", ["sass-docs:only"]);
// recompile docs CSS when non-docs-site dist/*.css files change
gulp.watch("packages/!(docs-site)/dist/*.css", ["sass-docs-site:only"]);
});

gulp.task("watch", ["watch-files", "webpack-docs-watch"]);
Expand Down
2 changes: 1 addition & 1 deletion gulp/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = (blueprint, gulp) => {
const webpack = require("webpack");
const webpackConfig = require("./util/webpack-config");

const docsProject = blueprint.findProject("docs");
const docsProject = blueprint.findProject("docs-site");
const configuration = webpackConfig.generateWebpackTypescriptConfig(docsProject);

gulp.task("webpack-docs", ["docs"], (callback) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/alertExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Alert, Button, Intent, IToaster, Toaster } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface IAlertExampleState {
isOpen?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/buttonsExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as classNames from "classnames";
import * as React from "react";

import { AnchorButton, Button, Classes, Intent, Switch } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleNumberChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleNumberChange } from "@blueprintjs/docs";
import { IntentSelect } from "./common/intentSelect";

export interface IButtonsExampleState {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/collapseExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Button, Collapse } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class CollapseExample extends BaseExample<{ isOpen: boolean }> {
public state = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/collapsibleListExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
RadioGroup,
Slider,
} from "@blueprintjs/core";
import BaseExample, { handleNumberChange } from "./common/baseExample";
import { BaseExample, handleNumberChange } from "@blueprintjs/docs";

export interface ICollapsibleListExampleState {
collapseFrom?: CollapseFrom;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/contextMenuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as PureRender from "pure-render-decorator";
import * as React from "react";

import { ContextMenu, ContextMenuTarget, Menu, MenuDivider, MenuItem } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

/**
* This component uses the imperative ContextMenu API.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/controlsExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Checkbox, Classes, Radio, RadioGroup, Switch } from "@blueprintjs/core";
import BaseExample, { handleStringChange } from "./common/baseExample";
import { BaseExample, handleStringChange } from "@blueprintjs/docs";

export interface IControlsExampleState {
radioValue?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/dropdownMenuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Menu, MenuDivider, MenuItem, Popover, Position } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class DropdownMenuExample extends BaseExample<{}> {
protected renderExample() {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/editableTextExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Classes, EditableText, Intent, Switch } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleNumberChange, handleStringChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleNumberChange, handleStringChange } from "@blueprintjs/docs";
import { IntentSelect } from "./common/intentSelect";

export interface IEditableTextExampleState {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/focusExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Button, FocusStyleManager, InputGroup, Switch } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange } from "@blueprintjs/docs";

export interface IFocusExampleState {
isFocusActive?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/hotkeyPiano.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as classNames from "classnames";
import * as React from "react";

import { Hotkey, Hotkeys, HotkeysTarget } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

class Oscillator {
public oscillator: OscillatorNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/hotkeyTester.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { getKeyComboString, KeyCombo } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface IHotkeyTesterState {
combo: string;
Expand Down
2 changes: 0 additions & 2 deletions packages/core/examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

export * from "./common/baseExample";

export * from "./alertExample";
export * from "./buttonsExample";
export * from "./collapseExample";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/inputGroupExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
Tag,
Tooltip,
} from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleStringChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleStringChange } from "@blueprintjs/docs";

export interface IInputGroupExampleState {
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/menuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Classes, Menu, MenuDivider, MenuItem } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class MenuExample extends BaseExample<{}> {
protected renderExample() {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/nonIdealStateExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { InputGroup, NonIdealState } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class NonIdealStateExample extends BaseExample<{}> {
protected renderExample() {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/numericInputBasicExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
Position,
Switch,
} from "@blueprintjs/core";
import { BaseExample, handleBooleanChange, handleNumberChange } from "@blueprintjs/docs";

import BaseExample, { handleBooleanChange, handleNumberChange } from "./common/baseExample";
import { IntentSelect } from "./common/intentSelect";

export interface INumericInputBasicExampleState {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/examples/numericInputExtendedExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
Keys,
NumericInput,
} from "@blueprintjs/core";

import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface INumericInputExtendedExampleState {
value?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/overlayExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
Overlay,
Switch,
} from "@blueprintjs/core";
import BaseExample, { handleBooleanChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange } from "@blueprintjs/docs";

const OVERLAY_EXAMPLE_CLASS = "docs-overlay-example-transition";

Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/popoverExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
Slider,
Switch,
} from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleNumberChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleNumberChange } from "@blueprintjs/docs";

const INTERACTION_KINDS = [
{ label: "Click", value: PopoverInteractionKind.CLICK.toString() },
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/progressExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Intent, ProgressBar, Slider, Switch } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleNumberChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleNumberChange } from "@blueprintjs/docs";
import { IntentSelect } from "./common/intentSelect";

export interface IProgressExampleState {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/rangeSliderExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { NumberRange, RangeSlider } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface IRangeSliderExampleState {
range?: NumberRange;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/sliderExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Slider } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface ISliderExampleState {
value1?: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/spinnerExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Classes, Spinner } from "@blueprintjs/core";
import { handleStringChange } from "./common/baseExample";
import { handleStringChange } from "@blueprintjs/docs";
import { ProgressExample } from "./progressExample";

const SIZES = [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/tabs2Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as classNames from "classnames";
import * as React from "react";

import { Classes, Switch, Tab2, Tabs2 } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange } from "@blueprintjs/docs";

export interface ITabs2ExampleState {
activeTabId?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/tabsExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Switch, Tab, TabList, TabPanel, Tabs } from "@blueprintjs/core";
import BaseExample, { handleBooleanChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange } from "@blueprintjs/docs";

export class TabsExample extends BaseExample<{ isVertical?: boolean }> {
public state = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/tagExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Classes, Intent, Tag } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class TagExample extends BaseExample<{ showTag?: boolean }> {
public state = {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/examples/textExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import * as classNames from "classnames";
import * as React from "react";

import { BaseExample, handleStringChange } from "@blueprintjs/docs";
import * as Classes from "../src/common/classes";
import { Text } from "../src/components/text/text";
import BaseExample from "./common/baseExample";
import { handleStringChange } from "./common/baseExample";

export interface ITextExampleState {
textContent: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/toastExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Switch,
Toaster,
} from "@blueprintjs/core";
import BaseExample, { handleBooleanChange, handleNumberChange } from "./common/baseExample";
import { BaseExample, handleBooleanChange, handleNumberChange } from "@blueprintjs/docs";

type IToastDemo = IToastProps & { button: string };

Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/tooltipExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Intent, Popover, Position, Switch, Tooltip } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export class TooltipExample extends BaseExample<{ isOpen: boolean }> {
public state = {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/examples/treeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as React from "react";

import { Classes, ITreeNode, Tooltip, Tree } from "@blueprintjs/core";
import BaseExample from "./common/baseExample";
import { BaseExample } from "@blueprintjs/docs";

export interface ITreeExampleState {
nodes: ITreeNode[];
Expand Down
3 changes: 2 additions & 1 deletion packages/core/examples/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"stripInternal": true,
"target": "es5",
"paths": {
"@blueprintjs/core": ["../dist/index"]
"@blueprintjs/core": ["../dist/index"],
"@blueprintjs/docs": ["../../docs/dist/index"]
}
}
}
2 changes: 1 addition & 1 deletion packages/core/src/components/hotkeys/hotkeysDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function isHotkeysDialogShowing() {
return HOTKEYS_DIALOG.isShowing();
}

export function setHotkeysDialogProps(props: IHotkeysDialogProps) {
export function setHotkeysDialogProps(props: Partial<IHotkeysDialogProps>) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: this is a pretty critical change because IHotkeysDialogProps requires isOpen (since it extends IDialogProps) but that's not reasonable to pass here.

for (const key in props) {
if (props.hasOwnProperty(key)) {
(HOTKEYS_DIALOG.componentProps as any)[key] = (props as any)[key];
Expand Down
Loading