@bend-corp/md-editor
v3.2.3
Published
Markdown editor and previewer components for Vue 2.
Downloads
557
Readme
@bend-corp/md-editor
Markdown editor and previewer components for Vue 2.
This repository is the v3 line of Bend Editor. The package is distributed as @bend-corp/md-editor v3.
Requirements
- Node.js 24 or later
- Vue 2.6
Installation
yarn add @bend-corp/md-editorUsage
VEditor
VEditor is the default library entry.
import VEditor from '@bend-corp/md-editor'
import '@bend-corp/md-editor/dist/VEditor/index.css'You can also import the built file directly.
import VEditor from '@bend-corp/md-editor/dist/VEditor/index.common'
import '@bend-corp/md-editor/dist/VEditor/index.css'Props
| name | type | v-model | sync |
| ---- | ---- | :-----: | :--: |
| value | string | yes | yes |
| width | string | number | | |
| height | string | number | | |
| options | Options | | |
| monacoOptions | monaco.editor.IStandaloneEditorConstructionOptions | | |
| error | boolean | | yes |
| errors | number | | yes |
type Options = {
sync?: boolean
preview?: boolean
}VPreviewer
import VPreviewer from '@bend-corp/md-editor/dist/VPreviewer/index.common'
import '@bend-corp/md-editor/dist/VPreviewer/index.css'Props
| name | type |
| ---- | ---- |
| value | string |
| components | Components |
| mdOptions | MarkdownIt.Options |
| mdDisableRules | string[] |
| mdPlugins | MarkdownIt.Plugin[] |
| trimBottomMargin | boolean |
| line | number |
type Components = {
type: string | RegExp
component: VueConstructor
}[]Development
Install dependencies.
yarn installStart the development server.
yarn serveBuild the package.
yarn buildRun unit tests.
yarn test:unitRelease
The package is published to npm as @bend-corp/md-editor.
Confirm that npm is logged in with an account that has publish access.
npm whoamiIf npm is not logged in, sign in before publishing.
npm loginyarn publishprepublishOnly runs yarn build before publishing.
If publishing fails with Couldn't publish package: ... Not found, the npm
login session may be missing or the current account may not have access to the
@bend-corp scope.
Official npm package: @bend-corp/md-editor
