Commit graph

160 commits

Author SHA1 Message Date
Joel Marcey
c888bc52b9 Fix og:image URL to make it absolute 2017-12-14 09:53:37 -08:00
Joel Marcey
606029b9ff Fix prettier 2017-12-14 09:38:32 -08:00
Joel Marcey
d6fb14cfa4
Add introductory blog post (#279)
* Add introductory blog post

For launch!

\o/

* Update post to launch date

* Add ogImage and fix how we get og:Description

Plus a few updates to the post

* Remove some code block info
2017-12-14 09:32:49 -08:00
Jan Kassens
b174ee2d2a Update prettier to 1.9.1 (#273) 2017-12-12 12:47:52 -08:00
Héctor Ramos
97612cf20b Link to master version of doc when editing (#262)
* Ensure Edit this Doc links always point to the master source of truth, and not a particular version

* Only show Edit this Doc link if editUrl has been set
2017-12-05 15:44:14 -08:00
Héctor Ramos
65421db62e Add Prettier Formatting (#258)
* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs

* Remove trailing-comma as we are using Node 6 on Circle

* Use latest Node 6 LTS version in Circle

* Remove unused test
2017-12-04 19:21:02 -08:00
Héctor Ramos
df05fd2bbc Switch Algolia DocSearch to load using https (#252)
* Change docsearch to explicit https
2017-12-04 09:26:44 -08:00
Héctor Ramos
bb48bb4f0c Remove keys warning when loading scripts (#244) 2017-11-27 15:14:55 -08:00
Christopher Chedeau
c407cdf96f Enable stylesheets as a parallel to scripts (#225)
* Enable stylesheets as a parallel to scripts

Also moves the scripts above the custom stylesheet to follow the comment :)

* Update api-site-config.md
2017-11-13 17:54:24 -08:00
Joel Marcey
e273dfc13b Allow the docs not to just be in a folder called docs
Also:
- regex escaping
- update api documentation
2017-11-09 09:55:26 -08:00
Christopher Chedeau
d5f26a52d4 Add the ability to render html and linkify links (#208)
Marked had the ability to display html code. This is useful if you want to embed iframes, set size to images... This allows arbitrary html to be embedded with no sanitization, so `<script>alert()</script>` will be executed. This isn't such a big issue since the markdown is written only by contributors.

I also removed the componentWillUpdate call since it's not used (and wrong).
2017-11-01 13:40:00 -07:00
Christopher Chedeau
e9c5cef664 Add the ability to define a default language (#206)
* Add the ability to define a default language

I don't want to have to add the language i'm working on to every single block nor do I want to rely on a default heuristic to find the language.

This adds the ability to write

```
highlight: { defaultLang: 'xxxx' }
```

in `siteConfig.js` to force the language when not specified.

I tested it without a a highlight block, without a defaultLang attribute and with one and with a wrong one. All of them work as expected.

* Move comment around
2017-11-01 12:16:15 -07:00
Joel Marcey
b2de777b1e
Add docusaurus-init to the headerlink message (#202) 2017-10-31 09:20:23 -07:00
Héctor Ramos
09354ab738 [BREAKING] Rename Marked to MarkdownBlock (#162)
* Switch to Remarkable

* Clean up references to custom code blocks

* Remove valdiateDOMNesting warning

* Add syntax highlighting

* Add Reason support

* Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs

* Completely remove Prism and associated CSS rules

* Support loading plugins and scripts

* Remove CSS rules, allowing Highlight.js theme to be used entirely

* Remove unnecessary webplayer script

* Rename Marked to MarkdownBlock

* Rename Marked to MarkdownBlock

* Remove Marked.js
2017-10-30 15:47:13 -07:00
Ricky Vetter
5263976ad3 move main.css below hljs css (#195) 2017-10-30 10:55:39 -07:00
Joel Marcey
fe516baaa2 Syntax bug fix from #169 2017-10-26 16:29:14 -07:00
Eric Nakagawa
fa1ec70432 Bug fixes in generatejs (#169)
* Misc cleanups related to console.log messages in yarn build

* Fixes https://github.com/facebookexperimental/Docusaurus/issues/96
2017-10-26 16:13:56 -07:00
Héctor Ramos
73b9a1128b Switch to GFM-style heading anchors (#164) 2017-10-26 16:12:17 -07:00
Héctor Ramos
ba666cc6ae Remove sourceCodeButton config key (#181) 2017-10-26 12:16:36 -07:00
Hector Ramos
9bb4f906fc Use RegExp with global flag to ensure all fenced code blocks have the hljs class applied 2017-10-26 12:14:46 -07:00
Héctor Ramos
fb294ab845 [markdown] Remove client-side syntax highlighting (#189)
* Remove client side highlighting

* Update CSS rules to render plain code blocks with expected left border

* Add back codeColor background color config

* Ensure all pre code blocks use Highlight.js classes
2017-10-26 12:07:02 -07:00
Joel Marcey
0df005484c Oops - forgot to remove debugging statement 2017-10-24 19:10:29 -07:00
Joel Marcey
7b2e950a4c Add previous and next titles to metadata props 2017-10-24 19:09:34 -07:00
Joel Marcey
429ffda351 Use title of previous and next if no i18n 2017-10-24 16:42:31 -07:00
Joel Marcey
78bd09dec3 Better logic 2017-10-24 16:35:32 -07:00
Joel Marcey
7c1b48b92c Show doc names instead of previous and next
Use the previous and next doc metadata to show docs in the buttons
2017-10-24 16:20:32 -07:00
Eric Nakagawa
867a49dd1c Removes #content from sidebar links and from within pages (#170) 2017-10-24 15:15:52 -07:00
Eric Nakagawa
c2243a3c20 Only show 'Read More' button on blog list page when post has <!-- truncate --> token (#161)
* Only show 'Read More' button on blog list page when the text includes a <truncate> token

* Remove console.log
2017-10-24 13:46:42 -07:00
Héctor Ramos
49034dd6bb Fix Remarkable case issue (#166) 2017-10-24 10:49:13 -07:00
Héctor Ramos
b832176dc6 [markdown] Switch to Remarkable (#153)
* Switch to Remarkable
* Clean up references to custom code blocks
* Remove valdiateDOMNesting warning
* Add syntax highlighting
* Add Reason support
* Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs
* Completely remove Prism and associated CSS rules
* Support loading plugins and scripts
* Remove CSS rules, allowing Highlight.js theme to be used entirely
* Remove unnecessary webplayer script
2017-10-24 09:45:21 -07:00
Ricky Vetter
58613545b6 add translateable strings and allow overriding of english strings (#158) 2017-10-23 15:01:26 -07:00
Eric Nakagawa
dc0cc487fa Add back metadata generator (#150)
Rollback package.json
2017-10-19 13:43:03 -07:00
Eric Nakagawa
22d0cebc18 Merge pull request #149 from ericnakagawa/noop-redirect
Removed copy from redirect page, reduced delay to 0s for js and meta
2017-10-19 13:20:07 -07:00
Eric Nakagawa
a9571ebf4d Removed copy from redirect page, reduced delay to 0s for js and meta 2017-10-19 13:15:05 -07:00
Eric Nakagawa
7c80becb87 Fix bug in when running local server 2017-10-19 12:58:57 -07:00
Eric Nakagawa
a4695a3083 Code cleanups for consistency & adds Docusaurus to meta tags (#138)
* Add a made with Docusaurus meta tag

* Code cleanups and changes for clarity

* Add back pages string extraction
2017-10-18 14:40:16 -07:00
Ricky Vetter
fd05bb3239 More consistent headers (#140)
* More consistent headers

* Clean up mobile blog posts styles
2017-10-18 13:04:29 -07:00
Eric Nakagawa
967970eaa5 Generates a file that redirects from /docs/file.html to /docs/en/folder.html when languages are enabled (languages.js is present) (#137) 2017-10-18 12:56:14 -07:00
Eric Nakagawa
bcba05ae03 Adds sitemap.xml. Adds 'Help Translate' to translatable strings. Error messages and fn name cleanups. (#136)
* added a note about needing more than one language to be enabled to allow for a drop down

* Removing debug statements

* Add 'Help Translate' to translatable strings, improves error messages around missing translated strings, calls write-translations on some routes

* Adds sitemap.xml to live server and build. Versioning not supported. -- Also did some file name and module cache cleanups.
2017-10-18 12:55:58 -07:00
Ricky Vetter
768ed88978 Add option to avoid indexing site (#142) 2017-10-18 11:35:30 -07:00
Christopher Chedeau
a26bba14c6 Add the ability to provide custom layout (#128)
* Add the ability to provide custom layout

When I designed the system, I added the ability to provide a custom layout that would use arbitrary JavaScript to render some custom pages. This is why files are called "DocsLayout.js", "BlogPostLayout.js"... This ability to customize it was [ripped out](https://github.com/facebook/react-native/blob/master/website/server/convert.js#L78) during the migration to Docusaurus but I need it for the project I'm working on right now (that should remain unnamed!).

This adds back the ability to do it in a way that fits the third party system. In order to provide a new layout:

1) Add a `layout` field in the header of your markdown file:

```js
---
layout: mylayout
---
```

2) In your `siteConfig`, add

```js
  layouts: {
    mylayout: function({React, Marked}) {
      return class extends React.Component {
        render() {
           return React.createElement('div', {}, this.props.metadata.layout);
         }
      }
    }
  }
```

I think that it's a reasonable to add and would unblock me :)

* Update DocsLayout.js
2017-10-18 10:20:13 -07:00
Ricky Vetter
e466c60481 Remove author name when unused (#131) 2017-10-18 09:52:23 -07:00
Joel Marcey
77535d80f2 The complete move to MIT license (#115)
- headers in .js files
- update README and LICENSE year

Testing:

grep BSD, Patents, patents turned up nothing
2017-10-05 11:14:49 -07:00
Joel Marcey
01ebbb1512 Check for required folders based upon headerLinks right up front (#111)
I was getting this error when running the examples:

```
Error: It looks like you've enabled language support, but haven't provided translated files. The document with id: 'en-doc1' doesn't exist.
```

However, this error was an indirect result of me not renaming the `docs-examples-from-docusaurus` directory to `docs` since I had `doc` in my
`headerLinks` in the example siteConfig.js.

So let's check the headerLinks and make sure we have the required directories.

Here is an example of the error if I try to load a Docusaurus site just after running `npm run examples` without having renamed the directories.

```
Error: You have 'doc' in your headerLinks, but no 'docs' folder exists one level up from 'website' folder. Are you running the examples? If so, make sure you rename 'docs-examples-from-docusaurus' to 'docs'.
    at /Users/joelm/dev/test/website/node_modules/docusaurus/lib/core/nav/HeaderNav.js:226:15
:
:
```

Test Plan: Tested a local package in verdaccio
2017-10-05 11:14:27 -07:00
Héctor Ramos
14dfcff769 Support algoliaOptions object as value in siteConfig.js (#113) 2017-10-04 19:13:30 -07:00
Joel Marcey
56e7c41893 Case sensitive requires 2017-10-04 09:17:07 -07:00
Héctor Ramos
053f384cfe Add web player files (#112) 2017-10-04 09:10:33 -07:00
Héctor Ramos
419a11af3e Extend Marked.js in order to support React Native's code players (#109)
* Extend Marked.js to support SnackPlayer and the WebPlayer, as used in React Native
2017-10-04 08:56:55 -07:00
Ricky Vetter
9c7d8e55a9 add sourceCodeButton to site config (#93) 2017-10-03 15:20:35 -07:00
Eric Nakagawa
dc835770a0 RSS/ATOM Feed added, Prism changes, and global Copyright notice. (#94)
* Add Reason support to Prism.js

* Add XML/ATOM feed. Generates for both localhost and build script. Adds meta links to feeds to all html files.

* Updated /core/Footer.js to pull from siteConfig
2017-09-27 12:49:09 -07:00