Skip to content

venoel/summernote-equation-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

summernote-equation-plugin

Allows to include equations into the editable content see example or try it online summernote-equation-pligin

Installation:

  1. This plugin uses MathJax library. Install and configure it (sample works, but you may optimize parametres)
<link href="dist/main.css" rel="stylesheet">

<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<script type="text/x-mathjax-config">
        MathJax.Hub.Config({
          extensions: ["tex2jax.js"],
          jax: ["input/TeX", "output/HTML-CSS"],
          tex2jax: {
              inlineMath: [["$", "$"], ["\\(", "\\)"]]
              },
          "HTML-CSS": {
              linebreaks: { automatic: true }
              }
        });
  </script>
  1. Insert HTML
<div class="container">
   <button id="run">edit</button>	
   <div id='text'></div>
</div>
  1. Initialize summernote with params
<link href="dist/main.css" rel="stylesheet">
<script src="summernote-ext-equation.js"></script>
<script>
   $(document).ready(function() {
   	$('#run').on('click', function() {              
   		$('#texto').summernote({ 
   	      		toolbar: [
   		  		['insert', ['equation']]
   	       		],});
   	 });
   });
   </script>
  1. Remember to include css and js libraries (jQuery, Bootstrap, Summernote)
  2. You can see it here

P.S: This plug-in works but it have some problems. (stable in Mozilla in Crome some functions dose not work, need to rewrite it) If you want to use it in professional projects, you must improve it. Please write me if you want to make stable version.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 73.7%
  • HTML 26.3%