Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Migrate to Docusaurus - Attempt #2
Browse files Browse the repository at this point in the history
Summary:
This PR continues #1607 (by aadsm) to update the website to https://github.com/facebook/docusaurus.

Changes from the original PR:
* Removing the `./setup.sh` line in .travis.yml (since the file was removed).
* Upgrading to the latest Docusaurus and React.
* Adding Google Analytics to Docusaurus config.
* Adding cname to Docusaurus config.
* Wiring the correct footer links.

Live Example: https://noamelb.github.io/draft-js/

Thanks flarnie & yangshun for all the help ☺️

![screencapture-localhost-3000-2018-05-10-23_18_05](https://user-images.githubusercontent.com/7422547/39892600-d14dc6be-54a9-11e8-953e-51be1cf48637.png)
![screencapture-localhost-3000-docs-getting-started-html-2018-05-10-23_18_26](https://user-images.githubusercontent.com/7422547/39892604-d3d9bdac-54a9-11e8-8306-e878775c1f79.png)
<img width="1055" alt="ga" src="https://user-images.githubusercontent.com/7422547/39892610-d6dc2c7e-54a9-11e8-8f58-9d256d2247ee.png">

Co-authored-by: António Afonso <aadsm@users.noreply.github.com>
Closes #1759

Reviewed By: flarnie

Differential Revision: D8026140

Pulled By: flarnie

fbshipit-source-id: 975fcde309a8ab24af90c5363acf1b601dfdcde7
  • Loading branch information
NoamELB authored and facebook-github-bot committed May 16, 2018
1 parent b2f6ed0 commit 710919b
Show file tree
Hide file tree
Showing 71 changed files with 20,078 additions and 3,347 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,15 @@ script:
else
set -e
./node_modules/.bin/gulp
cd website
yarn install
./setup.sh
if [ "$TRAVIS_PULL_REQUEST" = false ] && [ "$TRAVIS_BRANCH" = master ]; then
# Automatically publish the website
git config --global user.name "Travis CI"
git config --global user.email "travis@reactjs.org"
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" >~/.netrc
./publish.sh
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
cd website && yarn install && GIT_USER=reactjs-bot npm run publish-gh-pages
else
# Make sure the website builds without error
node server/generate.js
cd website && yarn install && yarn build
fi
fi
Expand Down
5 changes: 0 additions & 5 deletions docs/APIReference-APIMigration.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: v0-10-api-migration
title: v0.10 API Migration
layout: docs
category: Advanced Topics
next: advanced-topics-decorators
permalink: docs/v0-10-api-migration.html
---

The Draft.js v0.10 release includes a change to the API for managing
Expand Down Expand Up @@ -152,4 +148,3 @@ function findLinkEntities(contentBlock, callback, contentState) {
## More Information

For more information see the [updated examples](https://github.com/facebook/draft-js/tree/master/examples/draft-0-10-0).

6 changes: 1 addition & 5 deletions docs/APIReference-AtomicBlockUtils.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
id: api-reference-atomic-block-utils
title: AtomicBlockUtils
layout: docs
category: API Reference
next: api-reference-key-binding-util
permalink: docs/api-reference-atomic-block-utils.html
---

The `AtomicBlockUtils` module is a static set of utility functions for atomic
The `AtomicBlockUtils` module is a static set of utility functions for atomic
block editing.

In each case, these methods accept `EditorState` objects with relevant
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-CharacterMetadata.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-character-metadata
title: CharacterMetadata
layout: docs
category: API Reference
next: api-reference-entity
permalink: docs/api-reference-character-metadata.html
---

`CharacterMetadata` is an Immutable
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-CompositeDecorator.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-composite-decorator
title: CompositeDecorator
layout: docs
category: API Reference
next: api-reference-data-conversion
permalink: docs/api-reference-composite-decorator.html
---

See the [advanced topic article on Decorators](/docs/advanced-topics-decorators.html#compositedecorator).
4 changes: 0 additions & 4 deletions docs/APIReference-ContentBlock.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-content-block
title: ContentBlock
layout: docs
category: API Reference
next: api-reference-character-metadata
permalink: docs/api-reference-content-block.html
---

`ContentBlock` is an Immutable
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-ContentState.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-content-state
title: ContentState
layout: docs
category: API Reference
next: api-reference-content-block
permalink: docs/api-reference-content-state.html
---

`ContentState` is an Immutable
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-Data-Conversion.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-data-conversion
title: Data Conversion
layout: docs
category: API Reference
next: api-reference-rich-utils
permalink: docs/api-reference-data-conversion.html
---

Because a text editor doesn't exist in a vacuum and it's important to save
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-Editor.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-editor
title: Editor Component
layout: docs
category: API Reference
next: api-reference-editor-change-type
permalink: docs/api-reference-editor.html
---

This article discusses the API and props of the core controlled contentEditable
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-EditorChangeType.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-editor-change-type
title: EditorChangeType
layout: docs
category: API Reference
next: api-reference-editor-state
permalink: docs/api-reference-editor-change-type.html
---

[EditorChangeType](https://github.com/facebook/draft-js/blob/master/src/model/immutable/EditorChangeType.js)
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-EditorState.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-editor-state
title: EditorState
layout: docs
category: API Reference
next: api-reference-content-state
permalink: docs/api-reference-editor-state.html
---

`EditorState` is the top-level state object for the editor.
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-Entity.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-entity
title: Entity
layout: docs
category: API Reference
next: api-reference-selection-state
permalink: docs/api-reference-entity.html
---

`Entity` is a static module containing the API for creating, retrieving, and
Expand Down
6 changes: 1 addition & 5 deletions docs/APIReference-KeyBindingUtil.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
id: api-reference-key-binding-util
title: KeyBindingUtil
layout: docs
category: API Reference
next: api-reference-modifier
permalink: docs/api-reference-key-binding-util.html
---

The `KeyBindingUtil` module is a static set of utility functions for
The `KeyBindingUtil` module is a static set of utility functions for
defining key bindings.

## Static Methods
Expand Down
3 changes: 0 additions & 3 deletions docs/APIReference-Modifier.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
id: api-reference-modifier
title: Modifier
layout: docs
category: API Reference
permalink: docs/api-reference-modifier.html
---

The `Modifier` module is a static set of utility functions that encapsulate common
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-RichUtils.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-rich-utils
title: RichUtils
layout: docs
category: API Reference
next: api-reference-atomic-block-utils
permalink: docs/api-reference-rich-utils.html
---

The `RichUtils` module is a static set of utility functions for rich text
Expand Down
4 changes: 0 additions & 4 deletions docs/APIReference-SelectionState.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: api-reference-selection-state
title: SelectionState
layout: docs
category: API Reference
next: api-reference-composite-decorator
permalink: docs/api-reference-selection-state.html
---

`SelectionState` is an Immutable
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Block-Components.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-block-components
title: Custom Block Components
layout: docs
category: Advanced Topics
next: advanced-topics-inline-styles
permalink: docs/advanced-topics-block-components.html
---

Draft is designed to solve problems for straightforward rich text interfaces
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Block-Styling.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-block-styling
title: Block Styling
layout: docs
category: Advanced Topics
next: advanced-topics-custom-block-render-map
permalink: docs/advanced-topics-block-styling.html
---

Within `Editor`, some block types are given default CSS styles to limit the amount
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Custom-Block-Render.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-custom-block-render-map
title: Custom Block Rendering
layout: docs
category: Advanced Topics
next: advanced-topics-block-components
permalink: docs/advanced-topics-custom-block-render-map.html
---

This article discusses how to customize Draft default block rendering.
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Decorators.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-decorators
title: Decorators
layout: docs
category: Advanced Topics
next: advanced-topics-key-bindings
permalink: docs/advanced-topics-decorators.html
---

Inline and block styles aren't the only kind of rich styling that we might
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-EditorState-Race-Conditions.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-editorstate-race-conditions
title: EditorState Race Conditions
layout: docs
category: Advanced Topics
next: advanced-topics-issues-and-pitfalls
permalink: docs/advanced-topics-editorstate-race-conditions.html
---

Draft `Editor` is a *controlled input* component (you can read about this in detail in the [API Basics](/docs/quickstart-api-basics.html) section), meaning that changes made to the `Editor` state are propagated upwards through `onChange` and it's up to the app to feed it back to the `Editor` component.
Expand Down
6 changes: 1 addition & 5 deletions docs/Advanced-Topics-Entities.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
id: advanced-topics-entities
title: Entities
layout: docs
category: Advanced Topics
next: v0-10-api-migration
permalink: docs/advanced-topics-entities.html
---

This article discusses the Entity system, which Draft uses for annotating
ranges of text with metadata. Entities introduce levels of richness beyond
styled text. Links, mentions, and embedded content can all be implemented
styled text. Links, mentions, and embedded content can all be implemented
using entities.

In the Draft repository, the
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Inline-Styles.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-inline-styles
title: Complex Inline Styles
layout: docs
category: Advanced Topics
next: advanced-topics-nested-lists
permalink: docs/advanced-topics-inline-styles.html
---

Within your editor, you may wish to provide a wide variety of inline style
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Issues-and-Pitfalls.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-issues-and-pitfalls
title: Issues and Pitfalls
layout: docs
category: Advanced Topics
next: api-reference-editor
permalink: docs/advanced-topics-issues-and-pitfalls.html
---

This article addresses some known issues with the Draft editor framework, as
Expand Down
6 changes: 1 addition & 5 deletions docs/Advanced-Topics-Key-Bindings.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-key-bindings
title: Key Bindings
layout: docs
category: Advanced Topics
next: advanced-topics-managing-focus
permalink: docs/advanced-topics-key-bindings.html
---

The `Editor` component offers flexibility to define custom key bindings
Expand Down Expand Up @@ -75,7 +71,7 @@ class MyEditor extends React.Component {
this.handleKeyCommand = this.handleKeyCommand.bind(this);
}
// ...

handleKeyCommand(command: string): DraftHandleValue {
if (command === 'myeditor-save') {
// Perform a request to save your contents, set
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Managing-Focus.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-managing-focus
title: Managing Focus
layout: docs
category: Advanced Topics
next: advanced-topics-block-styling
permalink: docs/advanced-topics-managing-focus.html
---

Managing text input focus can be a tricky task within React components. The browser
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Nested-Lists.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-nested-lists
title: Nested Lists
layout: docs
category: Advanced Topics
next: advanced-topics-text-direction
permalink: docs/advanced-topics-nested-lists.html
---

The Draft framework provides support for nested lists, as demonstrated in the
Expand Down
4 changes: 0 additions & 4 deletions docs/Advanced-Topics-Text-Direction.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: advanced-topics-text-direction
title: Text Direction
layout: docs
category: Advanced Topics
next: advanced-topics-editorstate-race-conditions
permalink: docs/advanced-topics-text-direction.html
---

Facebook supports dozens of languages, which means that our text inputs need
Expand Down
4 changes: 0 additions & 4 deletions docs/Overview.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: getting-started
title: Overview
layout: docs
category: Quick Start
next: quickstart-api-basics
permalink: docs/overview.html
---

Draft.js is a framework for building rich text editors in React, powered by an immutable model and abstracting over cross-browser differences.
Expand Down
4 changes: 0 additions & 4 deletions docs/QuickStart-API-Basics.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: quickstart-api-basics
title: API Basics
layout: docs
category: Quick Start
next: quickstart-rich-styling
permalink: docs/quickstart-api-basics.html
---

This document provides an overview of the basics of the `Draft` API. A
Expand Down
4 changes: 0 additions & 4 deletions docs/QuickStart-Rich-Styling.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
id: quickstart-rich-styling
title: Rich Styling
layout: docs
category: Quick Start
next: advanced-topics-entities
permalink: docs/quickstart-rich-styling.html
---

Now that we have established the basics of the top-level API, we can go a step
Expand Down
2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.js.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion meta/bundle-size-stats/Draft.min.js.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/model/immutable/DraftBlockRenderConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

'use strict';

const React = require('React');

export type DraftBlockRenderConfig = {
element: string,
wrapper?: React.Node,
Expand Down
Loading

0 comments on commit 710919b

Please sign in to comment.