diff --git a/docs/api-site-config.md b/docs/api-site-config.md index 1651693fa5..cc7fa31c68 100644 --- a/docs/api-site-config.md +++ b/docs/api-site-config.md @@ -128,7 +128,7 @@ The default version for the site to be shown. If this is not set, the latest ver #### `docsUrl` [string] -The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL. +The base url for all docs file. Set this field to `''` to remove the `docs` prefix of the documentation URL. If unset, it is defaulted to `docs`. #### `disableHeaderTitle` [boolean] @@ -247,6 +247,10 @@ Hostname of your server. Useful if you are using GitHub Enterprise. Path to your web app manifest (e.g., `manifest.json`). This will add a `` tag to `
` with `rel` as `"manifest"` and `href` as the provided path. +#### `markdownOptions` [object] + +Override default [Remarkable options](https://github.com/jonschlinkert/remarkable#options) that will be used to render markdown. + #### `markdownPlugins` [array] An array of plugins to be loaded by Remarkable, the markdown parser and renderer used by Docusaurus. The plugin will receive a reference to the Remarkable instance, allowing custom parsing and rendering rules to be defined. diff --git a/packages/docusaurus-1.x/lib/core/renderMarkdown.js b/packages/docusaurus-1.x/lib/core/renderMarkdown.js index 6d08d4091f..4b6cac348c 100644 --- a/packages/docusaurus-1.x/lib/core/renderMarkdown.js +++ b/packages/docusaurus-1.x/lib/core/renderMarkdown.js @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ +const _ = require('lodash'); const hljs = require('highlight.js'); const Markdown = require('remarkable'); const prismjs = require('prismjs'); const loadLanguages = require('prismjs/components/index'); -const deepmerge = require('deepmerge'); const chalk = require('chalk'); const anchors = require('./anchors.js'); @@ -88,7 +88,7 @@ class MarkdownRenderer { // Allow overriding default options if (siteConfig.markdownOptions) { - markdownOptions = deepmerge( + markdownOptions = _.merge( {}, markdownOptions, siteConfig.markdownOptions, diff --git a/packages/docusaurus-1.x/lib/write-translations.js b/packages/docusaurus-1.x/lib/write-translations.js index b316e89cfd..2b0f3add4a 100755 --- a/packages/docusaurus-1.x/lib/write-translations.js +++ b/packages/docusaurus-1.x/lib/write-translations.js @@ -26,7 +26,7 @@ const fs = require('fs-extra'); const glob = require('glob'); const mkdirp = require('mkdirp'); const nodePath = require('path'); -const deepmerge = require('deepmerge'); +const _ = require('lodash'); const readMetadata = require('./server/readMetadata.js'); @@ -43,7 +43,8 @@ let customTranslations = { 'pages-strings': {}, }; if (fs.existsSync(`${CWD}/data/custom-translation-strings.json`)) { - customTranslations = deepmerge( + customTranslations = _.merge( + {}, JSON.parse( fs.readFileSync(`${CWD}/data/custom-translation-strings.json`, 'utf8'), ), @@ -187,7 +188,8 @@ function execute() { translations['pages-strings'], customTranslations['pages-strings'], ); - translations['localized-strings'] = deepmerge( + translations['localized-strings'] = _.merge( + {}, translations['localized-strings'], customTranslations['localized-strings'], ); diff --git a/packages/docusaurus-1.x/package.json b/packages/docusaurus-1.x/package.json index 5caba7bfa0..b70c65022d 100644 --- a/packages/docusaurus-1.x/package.json +++ b/packages/docusaurus-1.x/package.json @@ -44,7 +44,6 @@ "cross-spawn": "^6.0.5", "crowdin-cli": "^0.3.0", "cssnano": "^3.10.0", - "deepmerge": "^2.1.1", "escape-string-regexp": "^1.0.5", "express": "^4.15.3", "feed": "^1.1.0", diff --git a/packages/docusaurus/lib/default-theme/Layout/index.js b/packages/docusaurus/lib/default-theme/Layout/index.js index 1e5e5aa78b..04b5e2023d 100644 --- a/packages/docusaurus/lib/default-theme/Layout/index.js +++ b/packages/docusaurus/lib/default-theme/Layout/index.js @@ -21,7 +21,7 @@ function Layout(props) { return (