Skip to content

Commit

Permalink
Merge pull request #73 from helloflask/add-rtd-config
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli authored Nov 27, 2023
2 parents b092220 + f03be93 commit e9dbb01
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 20 deletions.
25 changes: 19 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs_requirements.txt
- method: pip
path: .
sphinx:
builder: dirhtml
fail_on_warning: true
- requirements: requirements/docs.txt
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -84,9 +84,7 @@
# documentation.
#
html_theme_options = {
'github_user': 'helloflask',
'index_logo': 'flask-ckeditor.png',
'github_fork': 'helloflask/flask-ckeditor',
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
6 changes: 2 additions & 4 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ will be used, defaults to ``Upload failed.``. Here is the full example:
url = url_for('uploaded_files', filename=f.filename)
return upload_success(url, filename=f.filename) # return upload_success call
.. note:: The key passed to ``request.files.get()`` must be ``'upload'``,
it's defined by CKEditor and it's not the name of the view function.
.. note:: The key passed to ``request.files.get()`` must be ``'upload'``, it's defined by CKEditor and it's not the name of the view function.

In the template, you have to call ``ckeditor.config()`` to make the configuration work:

Expand Down Expand Up @@ -89,8 +88,7 @@ If the CKEditor version you use is below 4.5, you will need to use ``@ckeditor.u
You can use the configuration variable ``CKEDITOR_UPLOAD_ERROR_MESSAGE`` to customize the error message when the upload failed, it defaults to ``Upload failed.``

.. note:: The key passed to ``request.files.get()`` must be ``'upload'``,
it's defined by CKEditor and it's not the name of the view function.
.. note:: The key passed to ``request.files.get()`` must be ``'upload'``, it's defined by CKEditor and it's not the name of the view function.

In the template, you have to call ``ckeditor.config()`` to make the configuration work:

Expand Down
2 changes: 1 addition & 1 deletion flask_ckeditor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def upload():
:param filename: the filename of uploaded image, optional.
:param message: the warning message displayed to the user, optional.
.. veresionchanged:: 0.4.7
.. versionchanged:: 0.4.7
Add new parameter ``message``.
.. versionadded:: 0.4.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
-r docs.in
-r style.in
pip-compile-multi
tox
tox
2 changes: 1 addition & 1 deletion requirements/docs.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx
pallets-sphinx-themes
sphinxcontrib-log-cabinet
sphinxcontrib-log-cabinet
2 changes: 1 addition & 1 deletion requirements/example.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ flask-wtf
flask-ckeditor
flask-admin
flask-sqlalchemy
tablib
tablib
2 changes: 1 addition & 1 deletion requirements/style.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flake8
flake8
2 changes: 1 addition & 1 deletion requirements/tests.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ flask
flask-wtf
flask-admin
flask-sqlalchemy
tablib
tablib
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist = py37, py38, py39, py310, py311, docs
skip_missing_interpreters = true
skipsdist = true
# skipsdist = true

[testenv]
commands =
Expand All @@ -22,3 +22,7 @@ commands =
flake8 flask_ckeditor test_flask_ckeditor.py
deps =
flake8

[testenv:docs]
deps = -r requirements/docs.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html

0 comments on commit e9dbb01

Please sign in to comment.