Skip to content

tangruize/q2a-formatter

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 2 commits ahead, 15 commits behind GATEOverflow:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
js
 
 
 
 
 
 

Q2A Formatter

Question2answer Formatter

This plugin provides an option to add MathJax script, Prettify script and a Preview for CKEditor and enables them by default on all pages.

For editor support please use this modified ckeditor.

Download the ckeditor and place inside qa-plugin/wysiwyg-editor folder.

It seems that SnowFlat theme renders math font very small for mobile. SnowLight theme doesn't have this problem.

I also recommend you to install q2apro-warn-on-leave plugin, which warns the user that text area has been changed when he is leaving.

This is a beta code, use it at your own risk on a production environment.

Default Configuration

MathJax Configuration:

MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [ [\'$\',\'$\'], ["\\\\(","\\\\)"] ],
    config: ["MMLorHTML.js"],
    jax: ["input/TeX"],
    processEscapes: true
  }
});

MathJax.Hub.Config({
  "HTML-CSS": {
    linebreaks: {
      automatic: true
    }
  }
});

MathJax URL:

https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML

highlight.js URL:

https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js

highlight.js Style URL:

https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/default.min.css

More highlight.js and styles: https://cdnjs.com/libraries/highlight.js/

highlight.js demo: https://highlightjs.org/static/demo/

About

Enables MathJax, highlight.js and Ckeditor Preview for Q2A

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 92.6%
  • JavaScript 7.4%