https://github.com/asika32764/fongshen-editor
A highly customizable code-inserting editor for markdown or other languages
https://github.com/asika32764/fongshen-editor
ace ace-editor code-editor codemirror
Last synced: about 1 year ago
JSON representation
A highly customizable code-inserting editor for markdown or other languages
- Host: GitHub
- URL: https://github.com/asika32764/fongshen-editor
- Owner: asika32764
- License: gpl-2.0
- Created: 2014-08-10T16:38:09.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-12T08:44:55.000Z (about 11 years ago)
- Last Synced: 2025-03-26T22:45:41.299Z (about 1 year ago)
- Topics: ace, ace-editor, code-editor, codemirror
- Language: PHP
- Homepage: http://about.asika.tw/fongshen-editor/
- Size: 3.36 MB
- Stars: 36
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fongshen Editor
A highly customizable code-inserting editor.
## About
Fongshen is a code inserting editor, It can integrate and wrap many other text editors and provides multiple buttons sets.
Fongshen is based on well known [MarkItUp](http://markitup.jaysalvat.com/home/) editor but almost rewrite 80% codes.
The name: "Fongshen" in Chinese means the [god of wind](http://en.wikipedia.org/wiki/Fei_Lian).
Fongshen's brother is [ACE X Markdown Editor](https://github.com/asikart/ace-markdown-editor) in Joomla CMS.
## Screen Shot

## Getting Started
### Using ACE
``` html
jQuery(document).ready(function($)
{
var editor = $('#my-editor');
var options = {
id: 'foo',
namespace: 'bar',
previewAjaxPath: '../parser/markdown.php',
previewContainer: '#preview-container',
buttons: FongshenMarkdownButtons
};
var aceOptions = {
lang: 'markdown',
wrap: true
};
var Fongshen = editor.fongshen(new AceAdapter(aceOptions), options);
});
```
This will create the simple editor:

### Using CodeMirror
``` javascript
var editor = $('#my-editor');
var options = {
id: 'foo',
namespace: 'bar',
previewAjaxPath: '../parser/markdown.php',
previewContainer: '#preview-container',
resize: false
buttons: FongshenMarkdownButtons
};
var cmOptions = {
mode: 'markdown',
theme: 'elegant',
lineNumbers: true
};
var Fongshen = editor.fongshen(new CodemirrorAdapter(cmOptions), options);
```
### Dependency Injection
You can create your own editor object and inject it into adapter.
``` javascript
var ace = ace.edit('#my-editor');
var session = ace.getSession();
ace.setTheme("ace/theme/monokai");
session.setMode("ace/mode/markdown");
session.setUseWrapMode(true);
var Fongshen = editor.fongshen(new AceAdapter(ace), options);
```
Other tutorial please see [Examples](examples).
## TODO
### Add more button set
- Wiki
- BBCode
- reStructuredText
Please comment me if you need other languages.
### Add more themes
### More documentations, more anything~~~