diff --git a/.readthedocs.yml b/.readthedocs.yml index 19dfdc5..da85a79 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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 diff --git a/docs/conf.py b/docs/conf.py index 78c8b29..d6308f8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. @@ -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, diff --git a/docs/plugins.rst b/docs/plugins.rst index a8ed9f7..59cc2aa 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -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: @@ -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: diff --git a/flask_ckeditor/__init__.py b/flask_ckeditor/__init__.py index 5f04363..97f2c91 100644 --- a/flask_ckeditor/__init__.py +++ b/flask_ckeditor/__init__.py @@ -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 diff --git a/requirements/dev.in b/requirements/dev.in index 66d8212..8764833 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -2,4 +2,4 @@ -r docs.in -r style.in pip-compile-multi -tox \ No newline at end of file +tox diff --git a/requirements/docs.in b/requirements/docs.in index df86c10..695d3e0 100644 --- a/requirements/docs.in +++ b/requirements/docs.in @@ -1,3 +1,3 @@ sphinx pallets-sphinx-themes -sphinxcontrib-log-cabinet \ No newline at end of file +sphinxcontrib-log-cabinet diff --git a/requirements/example.in b/requirements/example.in index 6520b17..977adb1 100644 --- a/requirements/example.in +++ b/requirements/example.in @@ -3,4 +3,4 @@ flask-wtf flask-ckeditor flask-admin flask-sqlalchemy -tablib \ No newline at end of file +tablib diff --git a/requirements/style.in b/requirements/style.in index 1ae3ec6..3930480 100644 --- a/requirements/style.in +++ b/requirements/style.in @@ -1 +1 @@ -flake8 \ No newline at end of file +flake8 diff --git a/requirements/tests.in b/requirements/tests.in index 823c2f7..da0230e 100644 --- a/requirements/tests.in +++ b/requirements/tests.in @@ -4,4 +4,4 @@ flask flask-wtf flask-admin flask-sqlalchemy -tablib \ No newline at end of file +tablib diff --git a/tox.ini b/tox.ini index a089afd..642b196 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py37, py38, py39, py310, py311, docs skip_missing_interpreters = true -skipsdist = true +# skipsdist = true [testenv] commands = @@ -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