All Projects → manuelgeek → vuejs-medium-editor

manuelgeek / vuejs-medium-editor

Licence: MIT license
A medium like text editor for vue js WYSIWYG

Programming Languages

Vue
7211 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to vuejs-medium-editor

typester
✒️ A WYSIWYG that gives you predictable and clean HTML
Stars: ✭ 29 (-74.11%)
Mutual labels:  wysiwyg, medium-editor
Dante
Just another Medium wysiwyg editor clone
Stars: ✭ 1,647 (+1370.54%)
Mutual labels:  wysiwyg, medium-editor
Medium Editor
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.
Stars: ✭ 15,421 (+13668.75%)
Mutual labels:  wysiwyg, medium-editor
Img2poem
Stars: ✭ 238 (+112.5%)
Mutual labels:  code
Hackide
hackIDE is an online code editor, compiler and interpreter based on Django, powered by HackerEarth API! Go, hack it!
Stars: ✭ 242 (+116.07%)
Mutual labels:  code
tryhackme-ctf
TryHackMe CTFs writeups, notes, drafts, scrabbles, files and solutions.
Stars: ✭ 140 (+25%)
Mutual labels:  code
writer
A small, modern WYSIWYG editor for inline formats – by the team of Kirby CMS
Stars: ✭ 45 (-59.82%)
Mutual labels:  wysiwyg
Awesome Spn
A structured list of resources about Sum-Product Networks (SPNs)
Stars: ✭ 228 (+103.57%)
Mutual labels:  code
ggshield
Find and fix 360+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
Stars: ✭ 1,272 (+1035.71%)
Mutual labels:  code
vicopo
API HTTP et Script pour trouver les villes à partir d'un code postal et code postaux à partir d'une ville
Stars: ✭ 27 (-75.89%)
Mutual labels:  code
wysiwyg-editor-python-sdk
Python SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 20 (-82.14%)
Mutual labels:  wysiwyg
Awesome Carla
👉 CARLA resources such as tutorial, blog, code and etc https://github.com/carla-simulator/carla
Stars: ✭ 246 (+119.64%)
Mutual labels:  code
medium-editor-handsontable
📊 Handsontable extension for MediumEditor
Stars: ✭ 50 (-55.36%)
Mutual labels:  medium-editor
Axocover
Nice and free .Net code coverage support for Visual Studio with OpenCover.
Stars: ✭ 237 (+111.61%)
Mutual labels:  code
Code-Life
The marathon continues though.
Stars: ✭ 27 (-75.89%)
Mutual labels:  code
Codeprinter
🖨️ Print out code easily
Stars: ✭ 233 (+108.04%)
Mutual labels:  code
tryceratops
A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).
Stars: ✭ 381 (+240.18%)
Mutual labels:  code
Pwc
Papers with code. Sorted by stars. Updated weekly.
Stars: ✭ 15,288 (+13550%)
Mutual labels:  code
Change Detection Review
A review of change detection methods, including codes and open data sets for deep learning. From paper: change detection based on artificial intelligence: state-of-the-art and challenges.
Stars: ✭ 248 (+121.43%)
Mutual labels:  code
Dashi
💯 Get a notification in Slack every time someone asks you to check some code on Github or Bitbucket.
Stars: ✭ 29 (-74.11%)
Mutual labels:  code

npm version npm version npm version

VueJs Medium Editor

Vue 2 and 3 Js component for Medium Editor wrapper with https://github.com/yabwe/medium-editor But all plugins are re-writing in Vue.js All Medium Editor configs are supported

Demo

Demo

Features

  • Medium like editor
  • Image uploader and description
    • Image width configable width for normal / expand / full screen sizing
    • Imgur uploading
  • Embed Gist
  • Inline code syntax highlighting
  • Embed video
    • Youtube video and shorts
    • Vimeo video
    • Loom video

Usage

Installation

yarn add vuejs-medium-editor

# Vue 3
yarn add vuejs-medium-editor@next

OR

npm install vuejs-medium-editor

# Vue 3
npm install vuejs-medium-editor@next

Usage

add to global component in Vue 2

import Vue from 'vue'
import MediumEditor from 'vuejs-medium-editor'

Vue.component('medium-editor', MediumEditor)

OR Vue 3

import { createApp } from 'vue'
import MediumEditor from 'vuejs-medium-editor'
import App from './App.vue'

const app = createApp(App)

app.component('medium-editor', MediumEditor)
app.mount('#app')

Don't forget to include css file in your project For Vue 2

import 'medium-editor/dist/css/medium-editor.css'
import 'vuejs-medium-editor/src/themes/default.css'
// for the code highlighting
import 'highlight.js/styles/github.css'

OR in styles like below

<style lang="css">
@import "~medium-editor/dist/css/medium-editor.css";
@import "~vuejs-medium-editor/src/themes/default.css";
/*@import '~highlight.js/styles/github.css';*/
@import '~highlight.js/styles/github.css';
</style>

For for Vue 3

import 'medium-editor/dist/css/medium-editor.css'
import 'vuejs-medium-editor/dist/themes/default.css'
// for the code highlighting
import 'highlight.js/styles/github.css'

OR in styles like below

<style lang="css">
@import "medium-editor/dist/css/medium-editor.css";
@import "vuejs-medium-editor/dist/themes/default.css";
/*@import '~highlight.js/styles/github.css';*/
@import 'highlight.js/styles/github.css';
</style>

Example

<medium-editor
  v-model="content"
  :options="options"
  :onChange="onChange"
  v-on:uploaded="uploadCallback"
/>

<script>
import Editor from 'vuejs-medium-editor'

export default {
  data() {
    return {
      content: '',
      options: {},
    }
  },
  components: {
    'medium-editor': Editor,
  },
  methods: {
    onChange() {
      console.log(this.content)
    },
    uploadCallback(url) {
      console.log('uploaded url', url)
    },
  },
}
</script>

Available Props

  • prefill(string) - Pre filled editor value - default value,
  • readOnly(boolean) - make the editor read only. Default - false
  • options - used to pass editor options, see below
  • onChange - pass onchange event
  • hideImage - Hides image upload option (default -false)
  • hideGist - Hides gist code embed - default(false)
  • hideVideo - Hides video embed - default(false)

Events

  • uploaded - imgur image upload callback

Options

toolbar

you can customize the toolbar buttons too

options: {
  toolbar: {
    buttons: [
      'bold',
      'italic',
      'underline',
      'quote',
      'h1',
      'h2',
      'h3',
      'pre',
      'unorderedlist',
    ]
  }
}

available options: All options are available here You can also override options like in Medium Editor ;

options: {
  buttons: [
    'anchor',
    {
      name: 'pre',
      action: 'append-pre',
      aria: 'code highlight',
      tagNames: ['pre'],
      contentDefault: '<b><\\></b>',
      contentFA: '<i class="fa fa-code fa-lg"></i>',
    },
  ]
}

images

Using the image option in toolbar, Add image link, highlight to edit, then select image icon

buttons: [
  {
    name: 'image',
    action: 'image',
    aria: 'insert image from url',
    tagNames: ['img'],
    contentDefault: '<b>image</b>',
    contentFA: '<i class="fa fa-picture-o"></i>',
  },
]

Also, available option: thanks to ErgoFriend pull request on the original repo

 options: {
    uploadUrl: "https://api.imgur.com/3/image",
    uploadUrlHeader: {'Authorization': 'Client-ID a3tw6ve4wss3c'},
    file_input_name: "image",
    file_size: 1024 * 1024 * 10,
    imgur: true,
 }

code highlighting

  1. Code highlighting is inbuilt using highlight.js Add code snippet, highlight, then select code in toolbar(you need to add pre in toolbar, see options above)

You should include the highligh.js css file within the styles

<style>
    /*default css  */
    @import 'highlight.js/styles/default.css';
    /* github style */
    @import 'highlight.js/styles/github.css';
</style>

You can get more theme styles here

  1. Code highliting using gist, also inbuilt. Click + button, then click code(Add gist), then add gist URL, click Enter to finish

Read only example

<medium-editor :prefill="defaultValue" :read-only="true" />

Nuxt.js Usage

create a plugin file vuejs-medium-editor.js inside /plugins dir

import Vue from 'vue'
import MediumEditor from 'vuejs-medium-editor'

Vue.component('medium-editor', MediumEditor)

import a plugin in nuxt.config.js with disable ssr mode

plugins: [{ src: '~/plugins/vuejs-medium-editor', ssr: false }]

include a css file For Vue 2

css: [
  'medium-editor/dist/css/medium-editor.css',
  'vuejs-medium-editor/src/themes/default.css',
  'highlight.js/styles/github.css', //if using code highlight
]

For Vue 3

css: [
  'medium-editor/dist/css/medium-editor.css',
  'vuejs-medium-editor/dist/themes/default.css',
  'highlight.js/styles/github.css', //if using code highlight
]

About Me

Magak Emmanuel

License

MIT

license

Open Source Love

Happy coding, Star before Fork 😊💪💯

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].