Sphinx integration

OGPy provide Sphinx-extension for integration.

Set up

It requires Sphinx.

extension = [
    ...,  # Other extensions
    "ogpy.adapters.sphinx",
]

Usage

.. ogp:image::

Fetch content from URL, and render image with link.

.. ogp:figure::

Fetch content from URL, and render image with link. This directive inherit figure instead of image.

Configurations

ogp_use_browser
Type:
bool
Default:
False

If this value is True, extension runs as Browser mode when fetching metadata from websites.

ogp_browser_name
Type:
str
Default:
"chromium"

Settings for what browser does it use when ogp_use_browser is True.

Demo

.. ogp:image:: https://github.com/attakei-lab/OGPy
   :scale: 50%
   :align: center
.. ogp:image:: https://dev.to/attakei/hosting-presentation-on-read-the-docs-3lkc
   :width: 80%
   :align: center
.. ogp:figure:: https://github.com/attakei-lab/OGPy
   :scale: 50%
   :align: center
.. ogp:figure:: https://dev.to/attakei/hosting-presentation-on-read-the-docs-3lkc
   :width: 80%
   :align: center