<commit_before>Flask-CKEditor
===
a [flask](https://github.com/mitsuhiko/flask) module for [CKEditor](http://ckeditor.com) integration

### Flask-CKEditor Demo
#### demo => http://172.16.31.10:520/appDemo/
#### code => https://github.com/neo1218/flask-ckeditor-demo

### Situation 1: Basic Usage
#### Step1: Clone the [CKEditor](https://github.com/neo1218/Configured-CKEditor) I Have Configured.
#### Step2: Writing Forms(In Flask-WTF Case)

    from flask_wtf import Form
    from wtforms import TextAreaField, SubmitField, StringField

    class CKEditorForm(Form):
        title =  StringField()
        ckdemo = TextAreaField()
        submit = SubmitField('submit')

#### Step3: Replace the Form to CKEditor

    <script src="/static/ckeditor/ckeditor.js" type="text/javascript"></script>

    <form method="POST">
        {{ form.hidden_tag() }}
        {{ form.title }}
        {{ form.ckdemo(class='ckeditor') }}
        {{ form.submit }}
    </form>

### Situation 2: Open (file/img)Upload Interface
#### Step1: Upload Class Inheritance

    from flask_wtf import Form
    from wtforms import TextAreaField, SubmitField, StringField
    from flaskckeditor import CKEditor

    class CKEditorForm(Form, CKEditor):
        title =  StringField()
        ckdemo = TextAreaField()
        submit = SubmitField('submit')

#### Step2: Write Upload View Function

    from "forms_module" import CKEditorForm

    @app.route("/ckupload/")
    def ckupload():
        form = CKEditor()
        res = form.upload(endpoint=app)
        return res

### Situation 3: Use Blueprint

1. 配置蓝图的static_folder
2. 修改上传路由

### API
#### :class: CKEditor
#### :func: gen_rnd_file()
#### :func: upload()

### LICENSE
MIT: check [LICENSE](https://github.com/neo1218/flask-ckeditor/blob/master/LICENSE) for more detail

### Thanks
<commit_msg>update step1<commit_after>Flask-CKEditor
===
a [flask](https://github.com/mitsuhiko/flask) module for [CKEditor](http://ckeditor.com) integration

### Flask-CKEditor Demo
#### demo => http://172.16.31.10:520/appDemo/
#### code => https://github.com/neo1218/flask-ckeditor-demo

### Situation 1: Basic Usage
#### Step1: Clone the [CKEditor](https://github.com/neo1218/Configured-CKEditor) I Have Configured and Put it Under Static Folder
#### Step2: Writing Forms(In Flask-WTF Case)

    from flask_wtf import Form
    from wtforms import TextAreaField, SubmitField, StringField

    class CKEditorForm(Form):
        title =  StringField()
        ckdemo = TextAreaField()
        submit = SubmitField('submit')

#### Step3: Replace the Form to CKEditor

    <script src="/static/ckeditor/ckeditor.js" type="text/javascript"></script>

    <form method="POST">
        {{ form.hidden_tag() }}
        {{ form.title }}
        {{ form.ckdemo(class='ckeditor') }}
        {{ form.submit }}
    </form>

### Situation 2: Open (file/img)Upload Interface
#### Step1: Upload Class Inheritance

    from flask_wtf import Form
    from wtforms import TextAreaField, SubmitField, StringField
    from flaskckeditor import CKEditor

    class CKEditorForm(Form, CKEditor):
        title =  StringField()
        ckdemo = TextAreaField()
        submit = SubmitField('submit')

#### Step2: Write Upload View Function

    from "forms_module" import CKEditorForm

    @app.route("/ckupload/")
    def ckupload():
        form = CKEditor()
        res = form.upload(endpoint=app)
        return res

### Situation 3: Use Blueprint

1. 配置蓝图的static_folder
2. 修改上传路由

### API
#### :class: CKEditor
#### :func: gen_rnd_file()
#### :func: upload()

### LICENSE
MIT: check [LICENSE](https://github.com/neo1218/flask-ckeditor/blob/master/LICENSE) for more detail

### Thanks

{'fraction_non_alphanumeric': 0.14425427872860636, 'fraction_numerical': 0.018744906275468622, 'mean_word_length': 3.484774665042631, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '547449', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1158, 'n_words': 279}