Skip to content

Commit

Permalink
Update README and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Dec 4, 2017
1 parent 5bef7c9 commit ab778d0
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ the image icon, then you will find a `Upload` tab.

## Code Snippet Highlight

The bulit-in CKEditor package include a [code snippet plugin](ckeditor.com/addon/codesnippet). 【】
The bulit-in CKEditor package include a [Code Snippet](ckeditor.com/addon/codesnippet)plugin.
You can set the code theme through configuration option `CKEDITOR_CODE_THEME`. The default theme was
`monikai-sublime`. See all available themes [here](https://highlightjs.org/static/demo/).
`monokai_sublime`. See all available themes at [Highlight.js's demo page](https://highlightjs.org/static/demo/).
The list of valid theme string can be find on this [page](https://sdk.ckeditor.com/samples/codesnippet.html).

Another step was load code theme resources in the page you want to display the text:

Expand Down
4 changes: 2 additions & 2 deletions examples/basic/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

app = Flask(__name__)
app.config['CKEDITOR_SERVE_LOCAL'] = True
app.config['CKEDITOR_HEIGHT'] = 500
app.config['CKEDITOR_HEIGHT'] = 400

app.secret_key = 'secret string'

ckeditor = CKEditor(app)

class PostForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
title = StringField('Title')
body = CKEditorField('Body', validators=[DataRequired()])
submit = SubmitField('Submit')

Expand Down
2 changes: 1 addition & 1 deletion examples/basic/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<div class="warpper" style="width: 700px; margin: auto">
<h1>Flask-CKEditor Demo</h1>
<h1>Flask-CKEditor Demo: Basic</h1>
<form method="post">
{{ form.csrf_token }}
{{ form.title.label }}<br>
Expand Down
4 changes: 2 additions & 2 deletions examples/image-upload/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

app = Flask(__name__)
app.config['CKEDITOR_SERVE_LOCAL'] = True
app.config['CKEDITOR_HEIGHT'] = 500
app.config['CKEDITOR_HEIGHT'] = 400

app.config['CKEDITOR_FILE_UPLOAD_URL'] = '/upload'
app.config['UPLOADED_PATH'] = os.getcwd() + '/uploads'
Expand All @@ -20,7 +20,7 @@
ckeditor = CKEditor(app)

class PostForm(FlaskForm):
title = StringField('Title', validators=[DataRequired()])
title = StringField('Title')
body = CKEditorField('Body', validators=[DataRequired()])
submit = SubmitField('Submit')

Expand Down
2 changes: 1 addition & 1 deletion examples/image-upload/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>
<div class="warpper" style="width: 700px; margin: auto">
<h1>Flask-CKEditor Demo</h1>
<h1>Flask-CKEditor Demo: Image Upload</h1>
<form method="post">
{{ form.csrf_token }}
{{ form.title.label }}<br>
Expand Down
1 change: 1 addition & 0 deletions examples/image-upload/templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<body>
<div class="warpper" style="width: 700px; margin: auto">
<h1>{{ title }}</h1>
<hr>
<p>{{ body|safe }}</p>
<hr>
<a href="{{ url_for('index') }}">Back Home</a>
Expand Down
2 changes: 1 addition & 1 deletion examples/without-flask-wtf/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

app = Flask(__name__)
app.config['CKEDITOR_SERVE_LOCAL'] = True
app.config['CKEDITOR_HEIGHT'] = 500
app.config['CKEDITOR_HEIGHT'] = 400

app.secret_key = 'secret string'

Expand Down
8 changes: 4 additions & 4 deletions examples/without-flask-wtf/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flask-CKEditor Demo: Without Flask-WTF</title>
<title>Flask-CKEditor Demo</title>
{{ ckeditor.load() }}
</head>
<body>
<div class="warpper" style="width: 700px; margin: auto">
<h1>Flask-CKEditor Demo</h1>
<h1>Flask-CKEditor Demo: Without Flask-WTF</h1>
<form method="post">
<label for="title">Title</label>
<br><br>
<br>
<input type="text" name="title">
<br>
<br><br>
<label for="ckeditor">Body</label>
{{ ckeditor.create() }}
<br>
Expand Down
1 change: 1 addition & 0 deletions examples/without-flask-wtf/templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<body>
<div class="warpper" style="width: 700px; margin: auto">
<h1>{{ title }}</h1>
<hr>
<p>{{ body|safe }}</p>
<hr>
<a href="{{ url_for('index') }}">Back Home</a>
Expand Down

0 comments on commit ab778d0

Please sign in to comment.