Commit graph

488 commits

Author SHA1 Message Date
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
Ricky Vetter
0cead4b6f9 Update deployment script to work on github.io repos as well (#256)
* Update deployment script to work on github.io repos as well

* remember how index of works

* CURRENT_BRANCH
2017-12-04 09:59:49 -08:00
Cheng Lou
76e423fba3 Use path module instead of string concat / (#255)
This also in part prepares for #253. I discovered a bug when setting `projectName` to `""`, and some `"build/" + projectName + "/foo"` concatenated into `"build//foo"`. Granted, it's a hack, but we should use `path` anyway.

Test: tested on https://github.com/BuckleScript/bucklescript.github.io. Seems working
2017-12-04 09:32: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
31b70f053c Update docusaurus-publish (#250)
* Update publish script to allow configuration via siteConfig.js file, as well as non-CircleCI env vars

* Use || instead of |
2017-12-04 09:15:32 -08:00
Héctor Ramos
bb48bb4f0c Remove keys warning when loading scripts (#244) 2017-11-27 15:14:55 -08:00
Héctor Ramos
1efce743dd Provide additional debugging information (#241) 2017-11-26 21:59:28 -08:00
Héctor Ramos
ff5f6b578d Reduce init script verbosity. (#239) 2017-11-21 09:44:45 -08:00
Joel Marcey
16aa42a705 Allow deploying docs from a branch other than master
Still have to deploy to `gh-pages`
2017-11-17 14:26:08 -08:00
Ricky Vetter
71dec39c3b Change pointer events on language dropdown (#233)
The dropdown positioning makes it overlay the main menu on mobile layout. This means that clicking the language button a second time doesn't close the menu.
2017-11-16 09:23:54 -08:00
Héctor Ramos
09726c6361 [Versioning] Fix issue when a doc is added (#231)
* Simplify function, return error if doc not found
2017-11-15 15:55:08 -08:00
Héctor Ramos
420d2e86fb Replace diff with string comparison (#230) 2017-11-15 12:17:05 -08:00
Héctor Ramos
19e6cc7ecc Check whether a previous/next doc actually exists (#226)
* Check whether a previous/next doc actually exists

* Use reasonable defaults

* Remove extraneous space
2017-11-14 20:36:25 -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
Eric Nakagawa
8d14f8fb02
Merge pull request #217 from JoelMarcey/custom-docs-subdir
Allow custom path for the location of documentation
2017-11-13 13:50:39 -08:00
Christine Abernathy
1d3f71a60a Fix HTML copy file generation (#223) 2017-11-10 15:46:22 -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
Joel Marcey
dc0c1390c4 [WIP] Allow custom subpath for docs within the "docs" folder
e.g.,

The default is

`docs/*.md`

This allows

`docs/somedir/*.md`

or

`docs/somedir/anotherdir/*.md`

Notes:

- All URLs are still /docs/*.html (i.e. the subpath does not get preserved in the link).
- Files in `translated_docs`, if any, will still only be one level
- This should not affect translations or versioning
2017-11-08 20:16:05 -08:00
Christopher Chedeau
f19bd80d80 Center iframes and make them responsive (#209)
So if you add an image and an iframe (youtube embed), they behave the same at all resolutions.
2017-11-01 13:40:11 -07: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
Ricky Vetter
1ba37f857c More breakpoint consolidation fixes 2017-10-30 22:50:51 -07:00
Ricky Vetter
b59b58af0d
Consolidate break points
These 900 break points were always triggered with the mobile nav. They don't make sense with the desktop navigation. See photo.
2017-10-30 22:37:07 -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
Joel Marcey
d26d263bd0
Don't try to version files that have no metadata headers (#197) 2017-10-30 12:00:55 -07:00
Héctor Ramos
459984516b Ensure some errors are logged to the console (#194)
* Clarify some error conditions in versioning

* Clarify missing doc error;

* Remove excess space

* Remove excess space part duex
2017-10-30 11:42:45 -07:00
Joel Marcey
47c955c7b0
Mobile nav at 736px instead of 1024px (#179)
* Mobile nav at 736px instead of 1024px

I was not totally clear on the issue here, but I assumed is that you wanted normal navigation to begin at 736px instead of 1024px. I think this does it.

Tested 735px was mobile, 736px was normal

Fixes #102

* 735 and 736 in more places
2017-10-30 11:00:04 -07:00
Ricky Vetter
5263976ad3 move main.css below hljs css (#195) 2017-10-30 10:55:39 -07:00
Ricky Vetter
10e8c7cba3 enforce 70% width on mainContainer (#196) 2017-10-30 09:51:44 -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
Ricky Vetter
c97da9d3f7 Sitemap local (#157)
* Better support for localized pages in sitemap

* clean console
2017-10-26 16:12:47 -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
db8daa635d Merge branch 'master' of github.com:facebookexperimental/Docusaurus 2017-10-26 12:14:53 -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
Ricky Vetter
3017554616 Delete unused styles (#180) 2017-10-26 12:10:53 -07:00
Joel Marcey
ae08fa31d6 Fix custom port number parsing... (#187)
* Fix custom port number parsing...

Checking if a port was in use raised a bug where the port coming in from the command line is a string and not an int. And that was causing the check to fail. Make the port an int from the get go

* Specifiy radix
2017-10-26 12:09:12 -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
f72df94dd3 Return empty object instead of false if no metadata (#182)
Closes #139
2017-10-26 07:02:52 -07:00
Héctor Ramos
140dcaa500 [CI] Switch to Circle 2 (#168)
* Switch to Circle 2

* Use Yarn in CI

* Move things around

* Fix Remarkable case issue

* Run placeholder test

* Update deploy script

Use multiline commit messages to ensure commit beign deployed is documented in git history
2017-10-25 14:04:24 -07:00
Eric Nakagawa
55b0f33f2a Allows periods in blog file names -- will allow for version numbers, etc (#163)
* Allows periods in blog file names -- will allow for version numbers, etc

* Removed debug lines...
2017-10-24 19:27:37 -07:00
Eric Nakagawa
a6bad7f92d Merge pull request #176 from ericnakagawa/write-translations-autogen
Improve translations guide + add comment about translations autogen
2017-10-24 19:21:19 -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
Eric Nakagawa
ee5c8a4278 Adds a note that languages.js is autogenerated
Add a comment about auto-generation to top of en.json file
2017-10-24 16:21:16 -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