Code Listing

A Sphinx extension that enables watermarks for HTML output.

https://github.com/kallimachos/sphinxmark

Copyright 2021 Brian Moss

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

__init__.buildcss(app: sphinx.application.Sphinx, buildpath: str, imagefile: str) str[source]

Create CSS file.

__init__.createimage(app: sphinx.application.Sphinx, srcdir: pathlib.Path, buildpath: pathlib.Path) str[source]

Create PNG image from string.

__init__.getimage(app: sphinx.application.Sphinx) tuple[source]

Get image file.

__init__.setup(app: sphinx.application.Sphinx) dict[source]

Configure setup for Sphinx extension.

Parameters

app – Sphinx application context.

__init__.watermark(app: sphinx.application.Sphinx, env: sphinx.environment.BuildEnvironment) None[source]

Add watermark.