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

Improve docs syntax and formatting #2267

Closed
wants to merge 2 commits into from
Closed

Improve docs syntax and formatting #2267

wants to merge 2 commits into from

Conversation

yangshun
Copy link
Contributor

@yangshun yangshun commented Dec 1, 2019

Summary

Reformat the docs in preparation for Docusaurus 2:

  • Add syntax highlighting for the code blocks
  • Remove .html from the Markdown link extensions. Docusaurus 1 allows clean URL but Docusaurus 2 doesn't, so this is necessary
  • Wrap API headings in code blocks
  • Change the level of some API headings so that they appear in the right table of contents

Test Plan

Run Docusaurus website locally and click through.

Try it out - https://draft-js-pc0wv8qnv.now.sh

Copy link
Contributor

@claudiopro claudiopro left a comment

Choose a reason for hiding this comment

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

Thank you for taking the time to format all code snippets as JS!
I didn't realize Docusaurus supports URL both with and without the .html suffix, but I trust you to make the right decision in removing them from hyperlinks.

Please fix the headings for method names by adding parens () and eventual arguments, otherwise looking good to me! 👍

@@ -21,7 +21,7 @@ operations are already implemented and available via utility modules. The getter
methods, however, may come in handy at render time.

See the API reference on
[ContentBlock](/docs/api-reference-content-block.html#representing-styles-and-entities)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@@ -170,36 +170,39 @@ objects.

## Static Methods

### createFromText
Copy link
Contributor

Choose a reason for hiding this comment

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

Unlike previous headings e.g. getDepth(), this and later method names are missing parens (). While you're at it, do you mind adding them here and in the other occurrences? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure whether the omission of the parens was intentional so I left them out. Have added them to all the functions/methods in the API section!

@claudiopro claudiopro self-assigned this Dec 1, 2019
Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@yangshun has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@yangshun yangshun mentioned this pull request Dec 1, 2019
@claudiopro claudiopro added documentation website Issues related to Draft.js website labels Dec 3, 2019
@facebook-github-bot
Copy link

@yangshun merged this pull request in 9b4a628.

@yangshun yangshun deleted the md branch December 4, 2019 06:06
facebook-github-bot pushed a commit that referenced this pull request Dec 4, 2019
Summary:
**Summary**

Fixes #2261. This should be merged after #2267 (how I wish there were stacked diffs on GitHub)

Migrate the website to Docusaurus 2 which provides the following benefits specific to Draft.js:

- Consistency with the other FB Docusaurus websites
- Easy way to import Draft.js (bundle via webpack, no more ugly client-side script tags)
- Nicer CSS framework
- Dark mode (disabled for now until I sort out the dark mode styling for the editor)

Changes made:

- I also changed the theme color of Draft.js to be lighter brown so that the contrast is better in general (much better on dark mode). Let me know if this is not ok.

**Test Plan**

<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 32 PM" src="https://user-images.githubusercontent.com/1315101/69909874-bc28fd80-13b6-11ea-90bb-c6b44a1186a5.png">
<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 39 PM" src="https://user-images.githubusercontent.com/1315101/69909875-bcc19400-13b6-11ea-9eda-c6eabfc4fde4.png">

Try it out here - https://build-swart-eight.now.sh
Pull Request resolved: #2268

Reviewed By: mrkev

Differential Revision: D18758642

Pulled By: yangshun

fbshipit-source-id: 169087f716ef2792dade75388b86debbaf34ac44
mmissey pushed a commit to mmissey/draft-js that referenced this pull request Mar 24, 2020
Summary:
**Summary**

Reformat the docs in preparation for Docusaurus 2:

- Add syntax highlighting for the code blocks
- Remove `.html` from the Markdown link extensions. Docusaurus 1 allows clean URL but Docusaurus 2 doesn't, so this is necessary
- Wrap API headings in code blocks
- Change the level of some API headings so that they appear in the right table of contents

**Test Plan**

Run Docusaurus website locally and click through.

Try it out - https://draft-js-pc0wv8qnv.now.sh
Pull Request resolved: facebookarchive#2267

Reviewed By: claudiopro

Differential Revision: D18758620

Pulled By: yangshun

fbshipit-source-id: 73b9572e521cbf891abcf5099fec65f0cbef91d2
mmissey pushed a commit to mmissey/draft-js that referenced this pull request Mar 24, 2020
Summary:
**Summary**

Fixes facebookarchive#2261. This should be merged after facebookarchive#2267 (how I wish there were stacked diffs on GitHub)

Migrate the website to Docusaurus 2 which provides the following benefits specific to Draft.js:

- Consistency with the other FB Docusaurus websites
- Easy way to import Draft.js (bundle via webpack, no more ugly client-side script tags)
- Nicer CSS framework
- Dark mode (disabled for now until I sort out the dark mode styling for the editor)

Changes made:

- I also changed the theme color of Draft.js to be lighter brown so that the contrast is better in general (much better on dark mode). Let me know if this is not ok.

**Test Plan**

<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 32 PM" src="https://user-images.githubusercontent.com/1315101/69909874-bc28fd80-13b6-11ea-90bb-c6b44a1186a5.png">
<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 39 PM" src="https://user-images.githubusercontent.com/1315101/69909875-bcc19400-13b6-11ea-9eda-c6eabfc4fde4.png">

Try it out here - https://build-swart-eight.now.sh
Pull Request resolved: facebookarchive#2268

Reviewed By: mrkev

Differential Revision: D18758642

Pulled By: yangshun

fbshipit-source-id: 169087f716ef2792dade75388b86debbaf34ac44
vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this pull request Jul 16, 2020
Summary:
**Summary**

Reformat the docs in preparation for Docusaurus 2:

- Add syntax highlighting for the code blocks
- Remove `.html` from the Markdown link extensions. Docusaurus 1 allows clean URL but Docusaurus 2 doesn't, so this is necessary
- Wrap API headings in code blocks
- Change the level of some API headings so that they appear in the right table of contents

**Test Plan**

Run Docusaurus website locally and click through.

Try it out - https://draft-js-pc0wv8qnv.now.sh
Pull Request resolved: facebookarchive#2267

Reviewed By: claudiopro

Differential Revision: D18758620

Pulled By: yangshun

fbshipit-source-id: 73b9572e521cbf891abcf5099fec65f0cbef91d2
vilemj-Viclick pushed a commit to kontent-ai/draft-js that referenced this pull request Jul 16, 2020
Summary:
**Summary**

Fixes facebookarchive#2261. This should be merged after facebookarchive#2267 (how I wish there were stacked diffs on GitHub)

Migrate the website to Docusaurus 2 which provides the following benefits specific to Draft.js:

- Consistency with the other FB Docusaurus websites
- Easy way to import Draft.js (bundle via webpack, no more ugly client-side script tags)
- Nicer CSS framework
- Dark mode (disabled for now until I sort out the dark mode styling for the editor)

Changes made:

- I also changed the theme color of Draft.js to be lighter brown so that the contrast is better in general (much better on dark mode). Let me know if this is not ok.

**Test Plan**

<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 32 PM" src="https://user-images.githubusercontent.com/1315101/69909874-bc28fd80-13b6-11ea-90bb-c6b44a1186a5.png">
<img width="1552" alt="Screen Shot 2019-11-30 at 9 16 39 PM" src="https://user-images.githubusercontent.com/1315101/69909875-bcc19400-13b6-11ea-9eda-c6eabfc4fde4.png">

Try it out here - https://build-swart-eight.now.sh
Pull Request resolved: facebookarchive#2268

Reviewed By: mrkev

Differential Revision: D18758642

Pulled By: yangshun

fbshipit-source-id: 169087f716ef2792dade75388b86debbaf34ac44
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

Reformat the docs in preparation for Docusaurus 2:

- Add syntax highlighting for the code blocks
- Remove `.html` from the Markdown link extensions. Docusaurus 1 allows clean URL but Docusaurus 2 doesn't, so this is necessary
- Wrap API headings in code blocks
- Change the level of some API headings so that they appear in the right table of contents

**Test Plan**

Run Docusaurus website locally and click through.

Try it out - https://draft-js-pc0wv8qnv.now.sh
Pull Request resolved: facebookarchive/draft-js#2267

Reviewed By: claudiopro

Differential Revision: D18758620

Pulled By: yangshun

fbshipit-source-id: 73b9572e521cbf891abcf5099fec65f0cbef91d2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed documentation Merged website Issues related to Draft.js website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants