sphinx-watermark


Namesphinx-watermark JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/JoKneeMo/sphinx-watermark
SummaryA Sphinx extension that enables watermarks for HTML output.
upload_time2024-03-10 10:38:31
maintainer
docs_urlNone
authorJoKneeMo <https://github.com/JoKneeMo>
requires_python>=3
licenseGPLv3
keywords python3 sphinx extension watermark
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
Sphinx Watermark
================
.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
   :target: https://www.gnu.org/licenses/gpl-3.0
   :alt: GPL3 License

.. image:: https://api.codeclimate.com/v1/badges/d689b89f5ae6836ad88c/maintainability
   :target: https://codeclimate.com/github/JoKneeMo/sphinx-watermark/maintainability
   :alt: Maintainability

.. image:: https://img.shields.io/pypi/status/sphinx-watermark.svg?style=flat
   :target: https://pypi.python.org/pypi/sphinx-watermark
   :alt: Project Status

.. image:: https://img.shields.io/pypi/v/sphinx-watermark.svg?style=flat
   :target: https://pypi.python.org/pypi/sphinx-watermark
   :alt: Package Version


**sphinx-watermark** is an extension for Sphinx that enables watermarks for
HTML output.

Full documentation: https://jokneemo.github.io/sphinx-watermark


***********
Why a Fork?
***********
Forked from `kallimachos/sphinxmark <https://github.com/kallimachos/sphinxmark/tree/0762fdef2eabead5edf99e393becc2cd5a926f11>`_

This fork was created primarily to remove the dependency on bottle, and to
support updates to Sphinx v7, Docutils, and Pillow.

Some themes perform differently in newer version of Docutils.
The main issues faced are html elements are changed between div, section,
article, etc.

Sphinxmark only supported div elements and the configuration changes I made to
support it were too expansive for a simple pull request. See below for all of
the enhancements added.


What's Different?
~~~~~~~~~~~~~~~~~
- Removed bottle dependency
- HTML element selection
- Static png name to support spaces in text
- Collection of fonts

  - See the `fonts directory <https://github.com/JoKneeMo/sphinx-watermark/tree/main/sphinx_watermark/fonts>`_.

- Customizable border


************
Installation
************

Install sphinx-watermark using pip:

.. code-block:: bash

   $ pip3 install sphinx-watermark


Usage
~~~~~

#. Add sphinx-watermark to the list of extensions in ``conf.py``:

   .. code-block:: python

      extensions = ['sphinx_watermark']

#. Enable and configure sphinx-watermark in ``conf.py``.
   You only have to include the values you want to change from default.

   Below is the bare-minimum config for an ``Internal Draft`` watermark:

   .. code-block:: python

      watermark = {
         'enabled': False,
         'text': 'Internal\nDraft'
      }


   Below are the defaults for all options:
   (Notice that watermarks are disabled by default.)

   .. code-block:: python

      watermark = {
         'enabled': False,
         'selector': {
            'type': 'div',
            'class': 'body'
         },
         'position': {
            'margin': None,
            'repeat': True,
            'fixed': False
         },
         'image': None,
         'text': {
            'content': None,
            'align': 'center',
            'font': 'RubikDistressed',
            'color': (255, 0, 0),
            'opacity': 40,
            'size': 100,
            'rotation': 0,
            'width': 816,
            'spacing': 400,
            'border': {
                  'outline': (255, 0, 0),
                  'fill': None,
                  'width': 10,
                  'padding': 30,
                  'radius': 20,
            }
         }
      }

#. Build your docs as normal. The defined watermark should appear behind the text.

   .. note::

      Some Sphinx themes place body content in different CSS divs.
      See the `sphinx-watermark documentation <https://jokneemo.github.io/sphinx-watermark/>`_
      for full configuration details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JoKneeMo/sphinx-watermark",
    "name": "sphinx-watermark",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": "",
    "keywords": "Python3,Sphinx,Extension,watermark",
    "author": "JoKneeMo <https://github.com/JoKneeMo>",
    "author_email": "421625+JoKneeMo@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/3e/c9/ca281b73ac90caf6fae2e473cb4dec7ea5f19c74b0b851fb8c92550076d7/sphinx-watermark-2.0.0.tar.gz",
    "platform": "any",
    "description": "================\nSphinx Watermark\n================\n.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg\n   :target: https://www.gnu.org/licenses/gpl-3.0\n   :alt: GPL3 License\n\n.. image:: https://api.codeclimate.com/v1/badges/d689b89f5ae6836ad88c/maintainability\n   :target: https://codeclimate.com/github/JoKneeMo/sphinx-watermark/maintainability\n   :alt: Maintainability\n\n.. image:: https://img.shields.io/pypi/status/sphinx-watermark.svg?style=flat\n   :target: https://pypi.python.org/pypi/sphinx-watermark\n   :alt: Project Status\n\n.. image:: https://img.shields.io/pypi/v/sphinx-watermark.svg?style=flat\n   :target: https://pypi.python.org/pypi/sphinx-watermark\n   :alt: Package Version\n\n\n**sphinx-watermark** is an extension for Sphinx that enables watermarks for\nHTML output.\n\nFull documentation: https://jokneemo.github.io/sphinx-watermark\n\n\n***********\nWhy a Fork?\n***********\nForked from `kallimachos/sphinxmark <https://github.com/kallimachos/sphinxmark/tree/0762fdef2eabead5edf99e393becc2cd5a926f11>`_\n\nThis fork was created primarily to remove the dependency on bottle, and to\nsupport updates to Sphinx v7, Docutils, and Pillow.\n\nSome themes perform differently in newer version of Docutils.\nThe main issues faced are html elements are changed between div, section,\narticle, etc.\n\nSphinxmark only supported div elements and the configuration changes I made to\nsupport it were too expansive for a simple pull request. See below for all of\nthe enhancements added.\n\n\nWhat's Different?\n~~~~~~~~~~~~~~~~~\n- Removed bottle dependency\n- HTML element selection\n- Static png name to support spaces in text\n- Collection of fonts\n\n  - See the `fonts directory <https://github.com/JoKneeMo/sphinx-watermark/tree/main/sphinx_watermark/fonts>`_.\n\n- Customizable border\n\n\n************\nInstallation\n************\n\nInstall sphinx-watermark using pip:\n\n.. code-block:: bash\n\n   $ pip3 install sphinx-watermark\n\n\nUsage\n~~~~~\n\n#. Add sphinx-watermark to the list of extensions in ``conf.py``:\n\n   .. code-block:: python\n\n      extensions = ['sphinx_watermark']\n\n#. Enable and configure sphinx-watermark in ``conf.py``.\n   You only have to include the values you want to change from default.\n\n   Below is the bare-minimum config for an ``Internal Draft`` watermark:\n\n   .. code-block:: python\n\n      watermark = {\n         'enabled': False,\n         'text': 'Internal\\nDraft'\n      }\n\n\n   Below are the defaults for all options:\n   (Notice that watermarks are disabled by default.)\n\n   .. code-block:: python\n\n      watermark = {\n         'enabled': False,\n         'selector': {\n            'type': 'div',\n            'class': 'body'\n         },\n         'position': {\n            'margin': None,\n            'repeat': True,\n            'fixed': False\n         },\n         'image': None,\n         'text': {\n            'content': None,\n            'align': 'center',\n            'font': 'RubikDistressed',\n            'color': (255, 0, 0),\n            'opacity': 40,\n            'size': 100,\n            'rotation': 0,\n            'width': 816,\n            'spacing': 400,\n            'border': {\n                  'outline': (255, 0, 0),\n                  'fill': None,\n                  'width': 10,\n                  'padding': 30,\n                  'radius': 20,\n            }\n         }\n      }\n\n#. Build your docs as normal. The defined watermark should appear behind the text.\n\n   .. note::\n\n      Some Sphinx themes place body content in different CSS divs.\n      See the `sphinx-watermark documentation <https://jokneemo.github.io/sphinx-watermark/>`_\n      for full configuration details.\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "A Sphinx extension that enables watermarks for HTML output.",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/JoKneeMo/sphinx-watermark",
        "documentation": "https://jokneemo.github.io/sphinx-watermark",
        "homepage": "https://jokneemo.github.io/sphinx-watermark",
        "issues": "https://github.com/JoKneeMo/sphinx-watermark/issues",
        "repository": "https://github.com/JoKneeMo/sphinx-watermark"
    },
    "split_keywords": [
        "python3",
        "sphinx",
        "extension",
        "watermark"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99605176fd1d4ed9ccbfe4cc741e93c396499d265a25e6d549c44e718c5d21cf",
                "md5": "29e466a1ff6f66b37a3c6783f2a9f442",
                "sha256": "5ad45f4d0383b6c4e4e5a94238fc628504666b5a95eb7095d686b65043dd0225"
            },
            "downloads": -1,
            "filename": "sphinx_watermark-2.0.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "29e466a1ff6f66b37a3c6783f2a9f442",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3",
            "size": 986273,
            "upload_time": "2024-03-10T10:38:29",
            "upload_time_iso_8601": "2024-03-10T10:38:29.387840Z",
            "url": "https://files.pythonhosted.org/packages/99/60/5176fd1d4ed9ccbfe4cc741e93c396499d265a25e6d549c44e718c5d21cf/sphinx_watermark-2.0.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ec9ca281b73ac90caf6fae2e473cb4dec7ea5f19c74b0b851fb8c92550076d7",
                "md5": "32312fbc5125c8546fc1ecadcc7dcee0",
                "sha256": "e5bbe1e1d5b3afee6df86209131fe6966cbca254537c135130f186e25d29039d"
            },
            "downloads": -1,
            "filename": "sphinx-watermark-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "32312fbc5125c8546fc1ecadcc7dcee0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 987468,
            "upload_time": "2024-03-10T10:38:31",
            "upload_time_iso_8601": "2024-03-10T10:38:31.715529Z",
            "url": "https://files.pythonhosted.org/packages/3e/c9/ca281b73ac90caf6fae2e473cb4dec7ea5f19c74b0b851fb8c92550076d7/sphinx-watermark-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-10 10:38:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JoKneeMo",
    "github_project": "sphinx-watermark",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sphinx-watermark"
}
        
Elapsed time: 0.19891s