1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 23:12:52 +02:00

Add syntax highlighting example to menu

This commit is contained in:
Sunny Hirai
2021-07-01 17:10:35 -07:00
parent ea5e3e4ebf
commit 506d9bce53
4 changed files with 20 additions and 1 deletions

16
.lintstagedrc.js Normal file
View File

@@ -0,0 +1,16 @@
const escape = require('shell-quote').quote
/**
* Need this to fix a bug where we can't commit `pages/examples/[example].tsx`
*
* <https://github.com/okonet/lint-staged/issues/676#issuecomment-574764713>
*/
module.exports = {
'*.{ts,tsx,js,json,css}': filenames => [
...filenames.map(filename => `prettier --check "${escape([filename])}"`),
...filenames.map(filename => `git add "${filename}"`),
],
'*.{ts,tsx,js}': ['eslint'],
'*.{ts,tsx,css}': ['stylelint'],
}

View File

@@ -98,6 +98,7 @@
"rollup-plugin-replace": "^2.2.0", "rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.0", "rollup-plugin-terser": "^7.0.0",
"rollup-plugin-typescript2": "^0.27.2", "rollup-plugin-typescript2": "^0.27.2",
"shell-quote": "^1.7.2",
"simple-git-hooks": ">=2.0.3", "simple-git-hooks": ">=2.0.3",
"slate": "*", "slate": "*",
"slate-history": "*", "slate-history": "*",

View File

@@ -8,6 +8,7 @@ import ErrorBoundary from 'react-error-boundary'
import { Icon } from '../../components' import { Icon } from '../../components'
import CheckLists from '../../examples/check-lists' import CheckLists from '../../examples/check-lists'
import CodeHighlighting from '../../examples/code-highlighting'
import EditableVoids from '../../examples/editable-voids' import EditableVoids from '../../examples/editable-voids'
import Embeds from '../../examples/embeds' import Embeds from '../../examples/embeds'
import ForcedLayout from '../../examples/forced-layout' import ForcedLayout from '../../examples/forced-layout'
@@ -35,6 +36,7 @@ const EXAMPLES = [
['Checklists', CheckLists, 'check-lists'], ['Checklists', CheckLists, 'check-lists'],
['Editable Voids', EditableVoids, 'editable-voids'], ['Editable Voids', EditableVoids, 'editable-voids'],
['Embeds', Embeds, 'embeds'], ['Embeds', Embeds, 'embeds'],
['Code Highlighting', CodeHighlighting, 'code-highlighting'],
['Forced Layout', ForcedLayout, 'forced-layout'], ['Forced Layout', ForcedLayout, 'forced-layout'],
['Hovering Toolbar', HoveringToolbar, 'hovering-toolbar'], ['Hovering Toolbar', HoveringToolbar, 'hovering-toolbar'],
['Huge Document', HugeDocument, 'huge-document'], ['Huge Document', HugeDocument, 'huge-document'],

View File

@@ -10423,7 +10423,7 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
shell-quote@1.7.2, shell-quote@^1.6.1: shell-quote@1.7.2, shell-quote@^1.6.1, shell-quote@^1.7.2:
version "1.7.2" version "1.7.2"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2"
integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==