Commit graph

5592 commits

Author SHA1 Message Date
Eric Nakagawa
b378215f66 Adds Jest to Docusaurus users 2017-10-24 12:56:39 -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
Joel Marcey
7bad58022c Check if a port is in use
Test:

Ran a separate server on port 3000

```
Checking if port 3000 is free...
Extracting translateable strings from files...
Loading translation files...
Generating Metadata for Docs....
Generating Metadata for Docs....
server.js triggered...
Generating Metadata for Docs....
Extracting translateable strings from files...
listening on port: 3000
Open http://localhost:3000/
Port 3000 is in use
```

Fixes #124
2017-10-23 18:32:39 -07:00
Ricky Vetter
58613545b6 add translateable strings and allow overriding of english strings (#158) 2017-10-23 15:01:26 -07:00
Ricky Vetter
65a5e02ec2 Remove animation on anchor hover (#156) 2017-10-23 06:31:11 -07:00
Joel Marcey
3fe1b7e0d4 Bump to 1.0.0.beta.5 2017-10-21 20:24:41 -07:00
Joel Marcey
7e23f3e4ef Avoid null enabledLanguages when there is no languages.js file (#155)
```
var enabledLanguages = languages.filter(function (lang) {
                                  ^

TypeError: Cannot read property 'filter' of null
    at module.exports
```
2017-10-20 15:19:13 -07:00
Héctor Ramos
a8cdcd11a3 Document Remarkable extensions (#154)
* Document Remarkable extensions

* Clarify how the plugin is loaded
2017-10-20 12:05:51 -07:00
Joel Marcey
b7819a18d8 Bump to 1.0.0-beta.4 2017-10-19 16:57:09 -07:00
Eric Nakagawa
574872d075 Only builds redirect pages if the current file is an english doc (#152) 2017-10-19 16:56:14 -07:00
Eric Nakagawa
d8b55fffa4 Fall back to English when strings are missing (#151) 2017-10-19 16:41:20 -07:00
Joel Marcey
b312821f78 Bump package to Beta 3 2017-10-19 14:52:28 -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
7f7459baa5 Merge pull request #148 from ericnakagawa/default-localization-english
This PR will create a default set of docs to use when localization is…
2017-10-19 13:19:55 -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
bf2f0cf935 Typo fix 2017-10-19 10:27:03 -07:00
Eric Nakagawa
bfb28441b4 This PR will create a default set of docs to use when localization is enabled. This allows seeing using the site without having synced with crowdin. Once synced, those files will replace the default set generated by this PR. 2017-10-19 09:57:10 -07:00
Christopher Chedeau
57251a22c0 Ability to tweak the prism language (#146)
I want to be able to tweak the default tokenizer for syntax highlighting. The current one isn't as good as it could be.

With this PR, I would be able to add this to the siteConfig and it would give me the Prism access so that I can get proper syntax highlighting:

```js
  prism: function(Prism) {
    Prism.languages.javascript = Prism.languages.extend("javascript", {
      keyword: /\b(alias|as|async|await|base class|...|with)\b/,
      constant: /\b[A-Z][a-zA-Z0-9_]*\b/,
      builtin: /\bopen_file|...|invariant_violation|invariant|getcwd\b/,
      function: /\b[_$a-z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/,
    });
  },
```
2017-10-19 08:21:00 -07:00
Eric Nakagawa
c3a1d99964 Include baseUrl when redirecting /docs/ pages in a localized project (#147) 2017-10-19 07:29:48 -07:00
Eric Nakagawa
2da255fa74 Merge pull request #145 from JoelMarcey/fix-langjs-check
Add a check for languages.js in sitemap.js
2017-10-19 06:02:52 -07:00
Joel Marcey
26f498a2db Add a check for languages.js in sitemap.js
Without this a build failure would occur for those that are not using the languages.js file.

e.g.,

```
sitemap.js triggered...
module.js:471
    throw err;
    ^

Error: Cannot find module '/home/ubuntu/fasttext-website/website/languages.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at module.exports (/home/ubuntu/fasttext-website/website/node_modules/docusaurus/lib/server/sitemap.js:48:15)
    at execute (/home/ubuntu/fasttext-website/website/node_modules/docusaurus/lib/server/generate.js:316:5)
    at Object.<anonymous> (/home/ubuntu/fasttext-website/website/node_modules/docusaurus/lib/build-files.js:31:1)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
Error: generating html failed
```
2017-10-18 15:43:25 -07:00
Joel Marcey
3e9e130256 Bump Docusaurus version number 2017-10-18 15:11:30 -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
30eea17a24 upstream small screen header changes (#141) 2017-10-18 12:44:28 -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
Christopher Chedeau
5693eba5d1 Allow for header and empty body (#127)
My hack of checking if the body was empty wasn't correct :(

```js
---
id: String
title: String
layout: stdlib
---
```

The above would be treated as pure content. Now it's working properly :)
2017-10-18 10:16:30 -07:00
Ricky Vetter
a794897d85 switch to fbids (#135) 2017-10-18 10:02:12 -07:00
Ricky Vetter
967d0b7f3c Make some changes to font size/spacing (#134) 2017-10-18 10:01:06 -07:00
Ricky Vetter
e85e0822e5 Use fixed position on mobile nav (#133) 2017-10-18 09:58:41 -07:00
Ricky Vetter
e723d21113 normalize header padding (#132) 2017-10-18 09:53:08 -07:00
Ricky Vetter
e466c60481 Remove author name when unused (#131) 2017-10-18 09:52:23 -07:00
Ricky Vetter
fe938cd5b4 align search bar better (#130) 2017-10-18 09:51:16 -07:00
Ricky Vetter
3ec5da2b4e Remove active item bolding in sidebar (#122) 2017-10-12 14:21:34 +01:00
Ricky Vetter
524c577788 Add more robust font stack (#121) 2017-10-12 14:12:26 +01:00
Joel Marcey
348ca219b7 Bump docusuarus-init version 2017-10-06 13:09:47 -07:00
Joel Marcey
f55e09a427 Bump the version number to Beta 1
\o/
2017-10-06 12:59:22 -07:00
Joel Marcey
d3018dcb5b Docusaurus documentation license (#118)
CC 4.0 Attribution
2017-10-06 12:59:01 -07:00
Eric Nakagawa
8ac191a331 Fixes #104 by providing a useful error message.
Next step will be to run 'write-translations' on 'yarn start' and 'yarn build' (#119)
2017-10-06 12:16:27 -07:00
Joel Marcey
a1810c99fc Remove dependency from website package.json (#117)
This isn't needed and we don't need to keep up with it everytime we push a package.

We only have to keep up with the versioning in the main package.json
2017-10-06 10:36:37 -07:00
Joel Marcey
5e4ee88153 Admin: Info for testing Docusaurus with Docusaurus (#116) 2017-10-06 10:36:19 -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
Joel Marcey
3558f8ca4e Ignore package-lock.json (#114) 2017-10-04 20:15:43 -07:00