Files
flipper/website/docusaurus.config.js
Bartosz Kaszubowski 40e6cdebb1 improve docs code blocks highlighting (#2049)
Summary:
This PR adds missing Objective-C entry to the Docusaurus config, fixes Objective-C code blocks label and adds or replaces several code block labels to improve the currently highlighted blocks.

Prism in Docusaurus by default also includes syntax highlight for `jsx` and `tsx`, which improves the nodes and props highlight, so I have used those syntaxes in few places too.

I have also fixed one typo that I have spotted and my IDE made a cleanup of whitespaces in edited files.

## Changelog

* [website] improve docs code blocks highlighting

Pull Request resolved: https://github.com/facebook/flipper/pull/2049

Test Plan:
The changes have been tested running Flipper website on `localhost`.

## Preview

<img width="650" alt="Screenshot 2021-03-12 150934" src="https://user-images.githubusercontent.com/719641/110951135-fff20d00-8344-11eb-96db-1bdc82c8d5ea.png">

<img width="649" alt="Screenshot 2021-03-12 151022" src="https://user-images.githubusercontent.com/719641/110951268-2ca62480-8345-11eb-9d3b-1a48f1267776.png">

Reviewed By: priteshrnandgaonkar

Differential Revision: D27336599

Pulled By: passy

fbshipit-source-id: c2dfb3d8cad4675da0f5e1270cada1e56a0175c0
2021-03-29 02:46:11 -07:00

240 lines
6.1 KiB
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
// start-import-example
const {fbContent, fbInternalOnly} = require('internaldocs-fb-helpers');
// end-import-example
const repoUrl = 'https://github.com/facebook/flipper';
const siteConfig = {
title: fbContent({
internal: 'Flipper @FB',
external: 'Flipper',
}),
tagline: 'Extensible mobile app debugging',
url: fbContent({
internal: 'https://flipper.thefacebook.com/',
external: 'https://fbflipper.com/',
}),
baseUrl: '/',
projectName: 'flipper',
// TODO: T69061026 enable once sandy docs are complete: external_domain: 'fbflipper.com',
themeConfig: {
navbar: {
title: fbContent({
internal: 'Flipper @FB',
external: 'Flipper',
}),
logo: {
alt: 'Flipper Logo',
src: 'img/icon.png',
},
items: [
{
to: 'docs/features/index',
label: 'Features',
position: 'right',
},
{
to: 'docs/getting-started/index',
label: 'Setup',
position: 'right',
},
{
to: 'docs/tutorial/intro',
label: 'Creating Plugins',
position: 'right',
},
{
to: 'docs/internals/index',
label: 'Under the Hood',
position: 'right',
},
{
href: repoUrl,
position: 'right',
'aria-label': 'GitHub repository',
className: 'navbar-github-link',
},
],
},
colorMode: {
// Nothing against dark mode, but our current CSS doesn't have high contrast
// so it needs some work before being enabled.
defaultMode: 'light',
disableSwitch: true,
},
footer: {
style: 'dark',
links: [
{
title: 'Learn',
items: [
{
label: 'Getting Started',
to: 'docs/getting-started/index',
},
{
label: 'Plugin Creation Tutorial',
to: 'docs/tutorial/intro',
},
],
},
{
title: 'Plugins',
items: [
{
label: 'Core Plugins',
to: 'docs/features/index',
},
{
label: 'Community Plugins',
href: 'https://www.npmjs.com/search?q=keywords:flipper-plugin',
},
],
},
{
title: 'Legal',
// Please do not remove the privacy and terms, it's a legal requirement.
items: [
{
label: 'Privacy',
href: 'https://opensource.facebook.com/legal/privacy/',
},
{
label: 'Terms',
href: 'https://opensource.facebook.com/legal/terms/',
},
],
},
{
title: 'More',
items: [
{
label: 'Twitter',
href: 'https://twitter.com/flipper_fb',
},
{
label: 'GitHub',
href: repoUrl,
},
],
},
],
copyright: 'Copyright © ' + new Date().getFullYear() + ' Facebook',
logo: {
alt: 'Flipper Mascot',
src: 'img/mascot.png',
},
},
algolia: fbContent({
internal: undefined,
external: {
apiKey: '2df980e7ffc95c19552790f7cad32666',
indexName: 'fbflipper',
algoliaOptions: {
hitsPerPage: 5,
},
},
}),
prism: {
additionalLanguages: ['groovy', 'java', 'kotlin', 'ruby', 'swift', 'objectivec'],
},
},
favicon: 'img/icon.png',
scripts: [
'https://buttons.github.io/buttons.js',
'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js',
'/js/code-blocks-buttons.js',
'/js/google-analytics.js',
],
stylesheets: [],
// start_config_example
presets: [
[
require.resolve('docusaurus-plugin-internaldocs-fb/docusaurus-preset'),
{
docs: {
path: '../docs',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/facebook/flipper/blob/master/website',
},
theme: {
customCss: require.resolve('./static/css/custom.css'),
},
},
],
],
// end_config_example
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
to: '/docs/troubleshooting',
from: ['/docs/fb/troubleshooting'],
},
{
to: '/docs/tutorial/intro',
from: ['/docs/extending'],
},
{
to: '/docs/extending/desktop-plugin-structure',
from: ['/docs/extending/js-setup'],
},
{
to: '/docs/extending/create-plugin',
from: [
'/docs/extending/send-data',
'/docs/fb/android-plugin-development-Android-interacting-0',
],
},
{
to: '/docs/tutorial/intro',
from: ['/docs/fb/create-new-plugin'],
},
{
to: '/docs/extending/dev-setup',
from: ['/docs/fb/developmentworkflow'],
},
{
to: '/docs/getting-started/index',
from: ['/docs/fb/Help-Updating-Flipper'],
},
{
to: '/docs/extending/create-plugin',
from: [
'/docs/fb/ios-plugin-development-sending-data-to-an-ios-plugin-0',
],
},
{
to: '/docs/extending/dev-setup',
from: ['/docs/fb/TypeScript'],
},
{
to: '/docs/extending/flipper-plugin',
from: ['/docs/fb/using-gatekeepers'],
},
{
to: '/docs/getting-started/index',
from: ['/docs/fb/using-flipper-at-facebook'],
},
{
to: '/docs/getting-started/index',
from: ['/docs/fb/index'],
},
],
},
],
],
};
module.exports = siteConfig;