Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d531e50
fix(create-docusaurus): improve init template misleading doc + add Do…
slorber Nov 2, 2022
b82c31b
fix(theme-translations): complete Turkish theme translations #8289
ABB65 Nov 9, 2022
a5a1949
fix(theme-translations): complete Swedish theme translations (#8312)
stnor Nov 10, 2022
21ad883
fix(mermaid): fix Mermaid integration for v9.2 release
slorber Nov 10, 2022
5d2dd9b
fix(theme): forward className prop in theme-classic's Heading (#8350)
JoshuaKGoldberg Nov 16, 2022
0294171
fix(core): normalize input for poll option (#8342)
mhnaeem Nov 17, 2022
8ef6e62
fix(utils): allow partially backticked markdown h1 contentTitles (#8314)
JoshuaKGoldberg Nov 17, 2022
cf3ec18
fix(content-docs): add trailing slash to contentDirs, before passing …
denis-alkhelali Nov 23, 2022
3f55453
fix(mdx-loader): support nested admonitions #8303
lebalz Nov 23, 2022
d20d144
fix(theme): preserve sidebar height on collapse (#8328)
0916dhkim Nov 24, 2022
1ff378d
feat(core): deploy CLI - add support for git url "insteadOf": use 're…
friederbluemle Nov 30, 2022
5cf826a
fix(content-blog): blog Atom feed id + RSS feed guid should be fully …
johnnyreilly Nov 30, 2022
2d5d7bd
fix(theme): add missing aria-labels to the main and sidebar navs #8366
r-lawrence Nov 30, 2022
9547b05
fix(translations): complete farsi theme translations #8406
SadeghKrmi Dec 7, 2022
3eb866a
feat(eslint-plugin): add plugin to exported configs (#8281)
lachieh Dec 7, 2022
cc95fb6
fix(translations): typo in lastUpdatedAtBy Vietnamese translation (#8…
slorber Dec 9, 2022
78d5a53
feat(theme-classic): store selected tab in query string. (#8225)
mturoci Dec 9, 2022
6aecc23
fix(translations): complete Chinese theme translations (#8423)
SJFCS Dec 14, 2022
e5b0707
fix(theme-translations): complete Vietnamese theme translations #8450
namnguyenthanhwork Dec 16, 2022
deb376e
feat(theme-algolia): add option.replaceSearchResultPathname to proces…
slorber Jan 26, 2023
f3507e0
fix(theme-classic): content container grow to take all the available …
Djunnni Dec 22, 2022
70bfaae
fix(core): explicitly define CopyWebpackPlugin toType: 'dir' (#8481)
Thomascogez Dec 27, 2022
266209f
fix(theme): refactor Tabs, make groupId + queryString work fine toget…
slorber Dec 29, 2022
30573dd
fix(search-algolia): pass custom transformItems function to SearchBar…
mturoci Dec 29, 2022
25a4ec3
feat(blog): add options.createFeedItems to filter/limit/transform fee…
johnnyreilly Dec 29, 2022
704365c
fix(theme-classic) extract HomeBreadcrumbItem + fix swizzle bugs (#8445)
3v0k4 Dec 29, 2022
003729e
feat(plugin-google-tag-manager): add new google-tag-manager plugin + …
lanegoolsby Dec 29, 2022
74fc822
chore(deps): bump json5 from 1.0.1 to 1.0.2 (#8502)
dependabot[bot] Jan 4, 2023
41d0043
fix(core): avoid hash collision when generating chunk names (#8538)
Josh-Cena Jan 18, 2023
61f7d56
chore(theme-translations): complete pl translations #8525
mariuszkrzaczkowski Jan 18, 2023
6d575d1
fix(algolia): make search footer respect searchPagePath (#8539)
Josh-Cena Jan 19, 2023
c6cdf70
feat(theme-translations): default translations for Slovenian (sl-SI) …
MatijaSi Jan 19, 2023
63ec772
fix(theme): add accessible name for the heading hash-link #8562
zmrhaljiri Jan 26, 2023
35a691b
chore: fix 2.3 backport tests due to failing test after backport, see…
slorber Jan 26, 2023
86a85c5
fix swizzle test failures related to https://github.com/facebook/docu…
slorber Jan 27, 2023
ad47778
v2.3.0
slorber Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/new.docusaurus.io/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.docusaurus.io",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"scripts": {
"start": "npx --package netlify-cli netlify dev"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.0",
"version": "2.3.0",
"npmClient": "yarn",
"useWorkspaces": true,
"changelog": {
Expand Down
6 changes: 3 additions & 3 deletions packages/create-docusaurus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-docusaurus",
"version": "2.2.0",
"version": "2.3.0",
"description": "Create Docusaurus apps easily.",
"type": "module",
"repository": {
Expand All @@ -22,8 +22,8 @@
},
"license": "MIT",
"dependencies": {
"@docusaurus/logger": "2.2.0",
"@docusaurus/utils": "2.2.0",
"@docusaurus/logger": "2.3.0",
"@docusaurus/utils": "2.3.0",
"commander": "^5.1.0",
"fs-extra": "^10.1.0",
"lodash": "^4.17.21",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-typescript-template",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -15,16 +15,16 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/core": "2.3.0",
"@docusaurus/preset-classic": "2.3.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.2.0",
"@docusaurus/module-type-aliases": "2.3.0",
"@tsconfig/docusaurus": "^1.0.5",
"typescript": "^4.7.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const config = {
title: 'My Site',
tagline: 'Dinosaurs are cool',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
Expand Down Expand Up @@ -56,6 +61,8 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Site',
logo: {
Expand Down
8 changes: 4 additions & 4 deletions packages/create-docusaurus/templates/classic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-classic-template",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -14,16 +14,16 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/core": "2.3.0",
"@docusaurus/preset-classic": "2.3.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.2.0"
"@docusaurus/module-type-aliases": "2.3.0"
},
"browserslist": {
"production": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@
const config = {
title: 'My Site',
tagline: 'The tagline of my site',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://your-docusaurus-test-site.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

presets: [
[
'classic',
Expand Down Expand Up @@ -53,6 +58,7 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'My Meta Project',
logo: {
Expand Down
6 changes: 3 additions & 3 deletions packages/create-docusaurus/templates/facebook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-2-facebook-template",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -18,8 +18,8 @@
"format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/core": "2.3.0",
"@docusaurus/preset-classic": "2.3.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"react": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ You can use absolute paths to reference images in the static directory (`static/

![Docusaurus logo](/img/docusaurus.png)

You can reference images relative to the current file as well, as shown in [the extra guides](../tutorial-extras/manage-docs-versions.md).
You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:

```md
![Docusaurus logo](./img/docusaurus.png)
```

## Code Blocks

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/docusaurus-cssnano-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/cssnano-preset",
"version": "2.2.0",
"version": "2.3.0",
"description": "Advanced cssnano preset for maximum optimization.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/logger",
"version": "2.2.0",
"version": "2.3.0",
"description": "An encapsulated logger for semantically formatting console messages.",
"main": "./lib/index.js",
"repository": {
Expand Down
9 changes: 4 additions & 5 deletions packages/docusaurus-mdx-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/mdx-loader",
"version": "2.2.0",
"version": "2.3.0",
"description": "Docusaurus Loader for MDX",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -20,8 +20,8 @@
"dependencies": {
"@babel/parser": "^7.18.8",
"@babel/traverse": "^7.18.8",
"@docusaurus/logger": "2.2.0",
"@docusaurus/utils": "2.2.0",
"@docusaurus/logger": "2.3.0",
"@docusaurus/utils": "2.3.0",
"@mdx-js/mdx": "^1.6.22",
"escape-html": "^1.0.3",
"file-loader": "^6.2.0",
Expand All @@ -37,10 +37,9 @@
"webpack": "^5.73.0"
},
"devDependencies": {
"@docusaurus/types": "2.2.0",
"@docusaurus/types": "2.3.0",
"@types/escape-html": "^1.0.2",
"@types/mdast": "^3.0.10",
"@types/mermaid": "^8.2.9",
"@types/stringify-object": "^3.3.1",
"@types/unist": "^2.0.6",
"rehype-stringify": "^8.0.0",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ exports[`admonitions remark plugin interpolation 1`] = `
"<p>Test admonition with interpolated title/body</p>
<admonition type="tip"><mdxAdmonitionTitle>My <code>interpolated</code> <strong>title</strong> &#x3C;button style={{color: "red"}} onClick={() => alert("click")}>test</mdxAdmonitionTitle><p><code>body</code> <strong>interpolated</strong> content</p></admonition>"
`;

exports[`admonitions remark plugin nesting 1`] = `
"<p>Test nested Admonitions</p>
<admonition type="info"><mdxAdmonitionTitle><strong>Weather</strong></mdxAdmonitionTitle><p>On nice days, you can enjoy skiing in the mountains.</p><admonition type="danger"><mdxAdmonitionTitle><em>Storms</em></mdxAdmonitionTitle><p>Take care of snowstorms...</p></admonition></admonition>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ describe('admonitions remark plugin', () => {
const result = await processFixture('interpolation');
expect(result).toMatchSnapshot();
});

it('nesting', async () => {
const result = await processFixture('nesting');
expect(result).toMatchSnapshot();
});
});
48 changes: 42 additions & 6 deletions packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,20 @@ const plugin: Plugin = function plugin(
const options = normalizeOptions(optionsInput);

const keywords = Object.values(options.keywords).map(escapeRegExp).join('|');
const nestingChar = escapeRegExp(options.tag.slice(0, 1));
const tag = escapeRegExp(options.tag);
const regex = new RegExp(`${tag}(${keywords})(?: *(.*))?\n`);
const escapeTag = new RegExp(escapeRegExp(`\\${options.tag}`), 'g');

// resolve th nesting level of an opening tag
// ::: -> 0, :::: -> 1, ::::: -> 2 ...
const nestingLevelRegex = new RegExp(
`^${tag}(?<nestingLevel>${nestingChar}*)`,
);

const regex = new RegExp(`${tag}${nestingChar}*(${keywords})(?: *(.*))?\n`);
const escapeTag = new RegExp(
escapeRegExp(`\\${options.tag}${options.tag.slice(0, 1)}*`),
'g',
);

// The tokenizer is called on blocks to determine if there is an admonition
// present and create tags for it
Expand All @@ -77,6 +88,11 @@ const plugin: Plugin = function plugin(
];
const food = [];
const content = [];
// get the nesting level of the opening tag
const openingLevel =
nestingLevelRegex.exec(opening)!.groups!.nestingLevel!.length;
// used as a stack to keep track of nested admonitions
const nestingLevels: number[] = [openingLevel];

let newValue = value;
// consume lines until a closing tag
Expand All @@ -88,12 +104,32 @@ const plugin: Plugin = function plugin(
next !== -1 ? newValue.slice(idx + 1, next) : newValue.slice(idx + 1);
food.push(line);
newValue = newValue.slice(idx + 1);
// the closing tag is NOT part of the content
if (line.startsWith(options.tag)) {
break;
const nesting = nestingLevelRegex.exec(line);
idx = newValue.indexOf(NEWLINE);
if (!nesting) {
content.push(line);
continue;
}
const tagLevel = nesting.groups!.nestingLevel!.length;
// first level
if (nestingLevels.length === 0) {
nestingLevels.push(tagLevel);
content.push(line);
continue;
}
const currentLevel = nestingLevels[nestingLevels.length - 1]!;
if (tagLevel < currentLevel) {
// entering a nested admonition block
nestingLevels.push(tagLevel);
} else if (tagLevel === currentLevel) {
// closing a nested admonition block
nestingLevels.pop();
// the closing tag is NOT part of the content
if (nestingLevels.length === 0) {
break;
}
}
content.push(line);
idx = newValue.indexOf(NEWLINE);
}

// consume the processed tag and replace escape sequences
Expand Down
6 changes: 3 additions & 3 deletions packages/docusaurus-migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docusaurus/migrate",
"version": "2.2.0",
"version": "2.3.0",
"description": "A CLI tool to migrate from older versions of Docusaurus.",
"license": "MIT",
"engines": {
Expand All @@ -24,8 +24,8 @@
"dependencies": {
"@babel/core": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@docusaurus/logger": "2.2.0",
"@docusaurus/utils": "2.2.0",
"@docusaurus/logger": "2.3.0",
"@docusaurus/utils": "2.3.0",
"@mapbox/hast-util-to-jsx": "^2.0.0",
"color": "^4.2.3",
"commander": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ exports[`migration CLI migrates complex website: write 1`] = `
]
}
],
"copyright": "Copyright © 2022 Facebook Inc.",
"copyright": "Copyright © 2023 Facebook Inc.",
"logo": {
"src": "img/docusaurus_monochrome.svg"
}
Expand Down Expand Up @@ -303,7 +303,7 @@ exports[`migration CLI migrates missing versions: write 1`] = `
]
}
],
"copyright": "Copyright © 2022 Facebook Inc.",
"copyright": "Copyright © 2023 Facebook Inc.",
"logo": {
"src": "img/docusaurus_monochrome.svg"
}
Expand Down Expand Up @@ -483,7 +483,7 @@ exports[`migration CLI migrates simple website: write 1`] = `
]
}
],
"copyright": "Copyright © 2022 Facebook Inc.",
"copyright": "Copyright © 2023 Facebook Inc.",
"logo": {
"src": "img/docusaurus_monochrome.svg"
}
Expand Down
Loading