Set the SEO information of the PyWebIO application (web page information provided when indexed by search engines) :param str title: Application title :param str description: Application description :param callable app: PyWebIO task function If ``seo()`` is not used, the `docstring
(title, description=None, app=None)
| 178 | |
| 179 | |
| 180 | def seo(title, description=None, app=None): |
| 181 | """Set the SEO information of the PyWebIO application (web page information provided when indexed by search engines) |
| 182 | |
| 183 | :param str title: Application title |
| 184 | :param str description: Application description |
| 185 | :param callable app: PyWebIO task function |
| 186 | |
| 187 | If ``seo()`` is not used, the `docstring <https://www.python.org/dev/peps/pep-0257/>`_ of the task function will be regarded as SEO information by default. |
| 188 | |
| 189 | ``seo()`` can be used in 2 ways: direct call and decorator:: |
| 190 | |
| 191 | @seo("title", "description") |
| 192 | def foo(): |
| 193 | pass |
| 194 | |
| 195 | def bar(): |
| 196 | pass |
| 197 | |
| 198 | def hello(): |
| 199 | \"""Application title |
| 200 | |
| 201 | Application description... |
| 202 | (A empty line is used to separate the description and title) |
| 203 | \""" |
| 204 | |
| 205 | start_server([ |
| 206 | foo, |
| 207 | hello, |
| 208 | seo("title", "description", bar), |
| 209 | ]) |
| 210 | |
| 211 | .. versionadded:: 1.1 |
| 212 | .. deprecated:: 1.4 |
| 213 | Use :func:`pywebio.config` instead. |
| 214 | """ |
| 215 | import warnings |
| 216 | warnings.warn("`pywebio.platform.seo()` is deprecated since v1.4 and will remove in the future version, " |
| 217 | "use `pywebio.config` instead", DeprecationWarning, stacklevel=2) |
| 218 | |
| 219 | if app is not None: |
| 220 | return config(title=title, description=description)(app) |
| 221 | |
| 222 | return config(title=title, description=description) |
| 223 | |
| 224 | |
| 225 | def manifest_tag(base_url, meta: AppMeta): |