Skip to content

Commit

Permalink
Merge branch 'tarngerine-lowlight-types'
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Sep 10, 2022
2 parents 06827dd + af3568f commit dd153e2
Show file tree
Hide file tree
Showing 7 changed files with 1,848 additions and 6,903 deletions.
1 change: 1 addition & 0 deletions demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@hocuspocus/provider": "^1.0.0-alpha.29",
"d3": "^7.3.0",
"fast-glob": "^3.2.11",
"highlight.js": "^11.6.0",
"lowlight": "^2.7.0",
"remixicon": "^2.5.0",
"shiki": "^0.10.0",
Expand Down
9 changes: 9 additions & 0 deletions demos/src/Examples/CodeBlockLanguage/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import { EditorContent, ReactNodeViewRenderer, useEditor } from '@tiptap/react'
import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
import React from 'react'

import CodeBlockComponent from './CodeBlockComponent'

lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)

const MenuBar = ({ editor }) => {
if (!editor) {
return null
Expand Down
9 changes: 9 additions & 0 deletions demos/src/Examples/CodeBlockLanguage/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@ import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import { Editor, EditorContent, VueNodeViewRenderer } from '@tiptap/vue-3'
import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
import CodeBlockComponent from './CodeBlockComponent.vue'
lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
// load specific languages only
// import { lowlight } from 'lowlight/lib/core'
// import javascript from 'highlight.js/lib/languages/javascript'
Expand Down
9 changes: 9 additions & 0 deletions demos/src/Nodes/CodeBlockLowlight/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import { EditorContent, useEditor } from '@tiptap/react'
import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
import React from 'react'

lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)

export default () => {
const editor = useEditor({
extensions: [
Expand Down
12 changes: 8 additions & 4 deletions demos/src/Nodes/CodeBlockLowlight/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import { Editor, EditorContent } from '@tiptap/vue-3'
import css from 'highlight.js/lib/languages/css'
import js from 'highlight.js/lib/languages/javascript'
import ts from 'highlight.js/lib/languages/typescript'
import html from 'highlight.js/lib/languages/xml'
// load all highlight.js languages
import { lowlight } from 'lowlight'
// load specific languages only
// import { lowlight } from 'lowlight/lib/core'
// import javascript from 'highlight.js/lib/languages/javascript'
// lowlight.registerLanguage('javascript', javascript)
lowlight.registerLanguage('html', html)
lowlight.registerLanguage('css', css)
lowlight.registerLanguage('js', js)
lowlight.registerLanguage('ts', ts)
export default {
components: {
Expand Down
Loading

0 comments on commit dd153e2

Please sign in to comment.