feat: code editor

This commit is contained in:
Jannat Patel
2024-04-19 14:59:40 +05:30
parent 44b36599c3
commit f15fdcc42e
6 changed files with 1114 additions and 1182 deletions

View File

@@ -6,6 +6,7 @@ import { Upload } from '@/utils/upload'
import Header from '@editorjs/header'
import Paragraph from '@editorjs/paragraph'
import Embed from '@editorjs/embed'
import { CodeBox } from '@/utils/code'
import NestedList from '@editorjs/nested-list'
import InlineCode from '@editorjs/inline-code'
import { watch } from 'vue'
@@ -131,6 +132,15 @@ export function getEditorTools() {
class: Paragraph,
inlineToolbar: true,
},
codeBox: {
class: CodeBox,
config: {
themeURL:
'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.1/build/styles/dracula.min.css', // Optional
themeName: 'atom-one-dark', // Optional
useDefaultTheme: 'dark', // Optional. This also determines the background color of the language select drop-down
},
},
list: {
class: NestedList,
config: {