pax_global_header00006660000000000000000000000064143551110410014505gustar00rootroot0000000000000052 comment=e009ab92fa75c6eb77363344385bac8feb87be44 sphinxext-opengraph-0.7.5/000077500000000000000000000000001435511104100155315ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/.github/000077500000000000000000000000001435511104100170715ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/.github/workflows/000077500000000000000000000000001435511104100211265ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/.github/workflows/workflow.yml000066400000000000000000000077131435511104100235330ustar00rootroot00000000000000name: Test and Deploy on: pull_request: branches: - main push: env: FORCE_COLOR: 1 jobs: check: runs-on: ubuntu-latest # We want to run on external PRs, but not on our own internal PRs as they'll be run # by the push to the branch. if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: '3.x' cache: pip cache-dependency-path: .github/workflows/workflow.yml - name: Black run: | pip install black black --check --exclude /docs --diff . build-wheel: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.7" cache: pip cache-dependency-path: | .github/workflows/workflow.yml dev-requirements.txt - name: Install dependencies run: | set -xe python -VV python -m site python -m pip install --upgrade pip setuptools wheel python -m pip install -r dev-requirements.txt - name: Install package run: | python -m pip install . - name: Build wheel run: | python -m pip install build python -m build - name: Upload sdist and wheel artifacts uses: actions/upload-artifact@v3 with: name: my-dist path: dist/* test: needs: build-wheel runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.8'] sphinx-version: ['>=4,<5', '>=5,<6', '>=6a0,<7'] os: [windows-latest, macos-latest, ubuntu-latest] exclude: # Sphinx 6 supports 3.8+ - { python-version: '3.7', sphinx-version: '>=6a0,<7' } steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | .github/workflows/workflow.yml dev-requirements.txt - name: Install dependencies run: | python -VV python -m site python -m pip install --upgrade pip setuptools wheel python -m pip install -r dev-requirements.txt python -m pip install "sphinx${{ matrix.sphinx-version }}" - name: Download sdist and wheel artifacts uses: actions/download-artifact@v3 with: name: my-dist path: dist - name: Install downloaded wheel run: | python -m pip install --only-binary=:all: --no-index --find-links=dist sphinxext-opengraph - name: Run tests for ${{ matrix.python-version }} run: | python -m pytest -vv build-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.x' cache: pip cache-dependency-path: docs/requirements.txt - name: Install dependencies run: | pip install -r docs/requirements.txt - name: Build documentation run: | cd docs make html pypi-release: needs: test runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/') && github.repository_owner == 'wpilibsuite' steps: - name: Download sdist and wheel artifacts uses: actions/download-artifact@v3 with: name: my-dist path: dist - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi_password }} sphinxext-opengraph-0.7.5/.gitignore000066400000000000000000000116731435511104100175310ustar00rootroot00000000000000 # Created by https://www.toptal.com/developers/gitignore/api/windows,linux,python,pycharm,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=windows,linux,python,pycharm,visualstudiocode ### Linux ### *~ # temporary files which can be created if a process still has a handle open of a deleted file .fuse_hidden* # KDE directory preferences .directory # Linux trash folder which might appear on any partition or disk .Trash-* # .nfs files are created when an open file is removed but is still being accessed .nfs* ### PyCharm ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml .idea/**/usage.statistics.xml .idea/**/dictionaries .idea/**/shelf # Generated files .idea/**/contentModel.xml # Sensitive or high-churn files .idea/**/dataSources/ .idea/**/dataSources.ids .idea/**/dataSources.local.xml .idea/**/sqlDataSources.xml .idea/**/dynamic.xml .idea/**/uiDesigner.xml .idea/**/dbnavigator.xml # Gradle .idea/**/gradle.xml .idea/**/libraries # Gradle and Maven with auto-import # When using Gradle or Maven with auto-import, you should exclude module files, # since they will be recreated, and may cause churn. Uncomment if using # auto-import. # .idea/artifacts # .idea/compiler.xml # .idea/jarRepositories.xml # .idea/modules.xml # .idea/*.iml # .idea/modules # *.iml # *.ipr # CMake cmake-build-*/ # Mongo Explorer plugin .idea/**/mongoSettings.xml # File-based project format *.iws # IntelliJ out/ # mpeltonen/sbt-idea plugin .idea_modules/ # JIRA plugin atlassian-ide-plugin.xml # Cursive Clojure plugin .idea/replstate.xml # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties # Editor-based Rest Client .idea/httpRequests # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser ### PyCharm Patch ### # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 # *.iml # modules.xml # .idea/misc.xml # *.ipr # Sonarlint plugin .idea/**/sonarlint/ # SonarQube Plugin .idea/**/sonarIssues.xml # Markdown Navigator plugin .idea/**/markdown-navigator.xml .idea/**/markdown-navigator-enh.xml .idea/**/markdown-navigator/ # Cache file creation bug # See https://youtrack.jetbrains.com/issue/JBR-2257 .idea/$CACHE_FILE$ ### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ docs/build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # PEP 582; used by e.g. github.com/David-OConnor/pyflow __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # pytype static type analyzer .pytype/ ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace ### VisualStudioCode Patch ### # Ignore all local history of files .history ### Windows ### # Windows thumbnail cache files Thumbs.db Thumbs.db:encryptable ehthumbs.db ehthumbs_vista.db # Dump file *.stackdump # Folder config file [Dd]esktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msix *.msm *.msp # Windows shortcuts *.lnk # End of https://www.toptal.com/developers/gitignore/api/windows,linux,python,pycharm,visualstudiocodesphinxext-opengraph-0.7.5/.readthedocs.yml000066400000000000000000000003311435511104100206140ustar00rootroot00000000000000version: 2 python: version: 3 install: - method: pip path: . extra_requirements: - rtd - requirements: docs/requirements.txt sphinx: builder: html fail_on_warning: true sphinxext-opengraph-0.7.5/LICENSE.md000066400000000000000000000027051435511104100171410ustar00rootroot00000000000000Copyright (c) 2020 FIRST All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the FIRST nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.sphinxext-opengraph-0.7.5/README.md000066400000000000000000000115611435511104100170140ustar00rootroot00000000000000# sphinxext-opengraph [![Build](https://github.com/wpilibsuite/sphinxext-opengraph/workflows/Test%20and%20Deploy/badge.svg)](https://github.com/wpilibsuite/sphinxext-opengraph/actions) [![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black) Sphinx extension to generate [Open Graph metadata](https://ogp.me/). ## Installation ```sh python -m pip install sphinxext-opengraph ``` ## Usage Just add `sphinxext.opengraph` to your extensions list in your `conf.py` ```python extensions = [ "sphinxext.opengraph", ] ``` ## Options These values are placed in the `conf.py` of your Sphinx project. Users hosting documentation on Read The Docs *do not* need to set any of the following unless custom configuration is wanted. The extension will automatically retrieve your site URL. * `ogp_site_url` * This config option is very important, set it to the URL the site is being hosted on. * `ogp_description_length` * Configure the amount of characters taken from a page. The default of 200 is probably good for most people. If something other than a number is used, it defaults back to 200. * `ogp_site_name` * This is not required. Name of the site. This is displayed above the title. Defaults to the Sphinx [`project`](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-project) config value. Set to `False` to unset and use no default. * `ogp_image` * This is not required. Link to image to show. Note that all relative paths are converted to be relative to the root of the html output as defined by `ogp_site_url`. * `ogp_image_alt` * This is not required. Alt text for image. Defaults to using `ogp_site_name` or the document's title as alt text, if available. Set to `False` if you want to turn off alt text completely. * `ogp_use_first_image` * This is not required. Set to `True` to use each page's first image, if available. If set to `True` but no image is found, Sphinx will use `ogp_image` instead. * `ogp_type` * This sets the ogp type attribute, for more information on the types available please take a look at [https://ogp.me/#types](https://ogp.me/#types). By default it is set to `website`, which should be fine for most use cases. * `ogp_custom_meta_tags` * This is not required. List of custom html snippets to insert. * `ogp_enable_meta_description` * This is not required. When `True`, generates `` from the page. ## Example Config ### Simple Config ```python ogp_site_url = "http://example.org/" ogp_image = "http://example.org/image.png" ``` ### Advanced Config ```python ogp_site_url = "http://example.org/" ogp_image = "http://example.org/image.png" ogp_description_length = 300 ogp_type = "article" ogp_custom_meta_tags = [ '', ] ogp_enable_meta_description = True ``` ## Per Page Overrides [Field lists](https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html) are used to allow you to override certain settings on each page and set unsupported arbitrary Open Graph tags. Make sure you place the fields at the very start of the document such that Sphinx will pick them up and also won't build them into the html. ### Overrides These are some overrides that can be used on individual pages, you can actually override any tag and field lists will always take priority. * `:ogp_description_length:` * Configure the amount of characters to grab for the description of the page. If the value isn't a number it will fall back to `ogp_description_length`. Note the slightly different syntax because this isn't directly an Open Graph tag. * `:og:description:` * Lets you override the description of the page. * `:description:` or `.. meta::\n :description:` * Sets the `` description. * `:og:title:` * Lets you override the title of the page. * `:og:type:` * Override the type of the page, for the list of available types take a look at https://ogp.me/#types. * `:og:image:` * Set the image for the page.[^1] * `:og:image:alt:` * Sets the alt text. Will be ignored if there is no image set. ### Example Remember that the fields **must** be placed at the very start of the file. You can verify Sphinx has picked up the fields if they aren't shown in the final html file. ```rst :og:description: New description :og:image: http://example.org/image.png :og:image:alt: Example Image Page contents ============= ``` ### Arbitrary Tags[^1] Additionally, you can use field lists to add any arbitrary Open Graph tag not supported by the extension. The syntax for arbitrary tags is the same with `:og:tag: content`. For example: ```rst :og:video: http://example.org/video.mp4 Page contents ============= ``` [^1]: Note: Relative file paths for images, videos and audio are currently **not** supported when using field lists. Please use an absolute path instead. sphinxext-opengraph-0.7.5/dev-requirements.txt000066400000000000000000000001141435511104100215650ustar00rootroot00000000000000sphinx wheel==0.37.1 pytest==7.1.3 beautifulsoup4==4.11.1 setuptools==65.4.1sphinxext-opengraph-0.7.5/docs/000077500000000000000000000000001435511104100164615ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/docs/Makefile000066400000000000000000000011761435511104100201260ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) sphinxext-opengraph-0.7.5/docs/make.bat000066400000000000000000000013741435511104100200730ustar00rootroot00000000000000@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source set BUILDDIR=build if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd sphinxext-opengraph-0.7.5/docs/requirements.txt000066400000000000000000000000651435511104100217460ustar00rootroot00000000000000myst-parser==0.18.1 furo==2022.9.29 sphinx==5.2.3 ./ sphinxext-opengraph-0.7.5/docs/source/000077500000000000000000000000001435511104100177615ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/docs/source/conf.py000066400000000000000000000032011435511104100212540ustar00rootroot00000000000000# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path.insert(0, os.path.abspath("../..")) # -- Project information ----------------------------------------------------- project = "sphinxext-opengraph" copyright = "2020, FIRST" author = "WPILib" # The full version, including alpha/beta/rc tags release = "1.0" # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "myst_parser", "sphinxext.opengraph", ] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = "furo" sphinxext-opengraph-0.7.5/docs/source/index.md000066400000000000000000000000631435511104100214110ustar00rootroot00000000000000```{include} ../../README.md :relative-images: ``` sphinxext-opengraph-0.7.5/setup.py000066400000000000000000000027341435511104100172510ustar00rootroot00000000000000import setuptools with open("README.md", encoding="utf-8") as readme: long_description = readme.read() setuptools.setup( name="sphinxext-opengraph", use_scm_version=True, setup_requires=["setuptools_scm"], author="Itay Ziv", author_email="itay220204@gmail.com", description="Sphinx Extension to enable OGP support", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/wpilibsuite/sphinxext-opengraph", license="LICENSE.md", install_requires=["sphinx>=4.0"], packages=["sphinxext/opengraph"], classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Environment :: Web Environment", "Framework :: Sphinx :: Extension", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python", "Topic :: Documentation :: Sphinx", "Topic :: Documentation", "Topic :: Software Development :: Documentation", "Topic :: Text Processing", "Topic :: Utilities", ], python_requires=">=3.7", ) sphinxext-opengraph-0.7.5/sphinxext/000077500000000000000000000000001435511104100175635ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/sphinxext/opengraph/000077500000000000000000000000001435511104100215465ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/sphinxext/opengraph/__init__.py000066400000000000000000000151061435511104100236620ustar00rootroot00000000000000from typing import Any, Dict from urllib.parse import urljoin, urlparse, urlunparse from pathlib import Path import docutils.nodes as nodes from sphinx.application import Sphinx from .descriptionparser import get_description from .metaparser import get_meta_description from .titleparser import get_title import os DEFAULT_DESCRIPTION_LENGTH = 200 # A selection from https://www.iana.org/assignments/media-types/media-types.xhtml#image IMAGE_MIME_TYPES = { "gif": "image/gif", "apng": "image/apng", "webp": "image/webp", "jpeg": "image/jpeg", "jpg": "image/jpeg", "png": "image/png", "bmp": "image/bmp", "heic": "image/heic", "heif": "image/heif", "tiff": "image/tiff", } def make_tag(property: str, content: str, type_: str = "property") -> str: # Parse quotation, so they won't break html tags if smart quotes are disabled content = content.replace('"', """) return f'' def get_tags( app: Sphinx, context: Dict[str, Any], doctree: nodes.document, config: Dict[str, Any], ) -> str: # Get field lists for per-page overrides fields = context["meta"] if fields is None: fields = {} tags = {} meta_tags = {} # For non-og meta tags # Set length of description try: desc_len = int( fields.get("ogp_description_length", config["ogp_description_length"]) ) except ValueError: desc_len = DEFAULT_DESCRIPTION_LENGTH # Get the title and parse any html in it title = get_title(context["title"], skip_html_tags=False) title_excluding_html = get_title(context["title"], skip_html_tags=True) # Parse/walk doctree for metadata (tag/description) description = get_description(doctree, desc_len, [title, title_excluding_html]) # title tag tags["og:title"] = title # type tag tags["og:type"] = config["ogp_type"] if os.getenv("READTHEDOCS") and not config["ogp_site_url"]: # readthedocs uses html_baseurl for sphinx > 1.8 parse_result = urlparse(config["html_baseurl"]) if config["html_baseurl"] is None: raise OSError("ReadTheDocs did not provide a valid canonical URL!") # Grab root url from canonical url config["ogp_site_url"] = urlunparse( ( parse_result.scheme, parse_result.netloc, parse_result.path, "", "", "", ) ) # url tag # Get the URL of the specific page page_url = urljoin( config["ogp_site_url"], app.builder.get_target_uri(context["pagename"]) ) tags["og:url"] = page_url # site name tag, False disables, default to project if ogp_site_name not # set. if config["ogp_site_name"] is False: site_name = None elif config["ogp_site_name"] is None: site_name = config["project"] else: site_name = config["ogp_site_name"] if site_name: tags["og:site_name"] = site_name # description tag if description: tags["og:description"] = description if config["ogp_enable_meta_description"] and not get_meta_description( context["metatags"] ): meta_tags["description"] = description # image tag # Get basic values from config if "og:image" in fields: image_url = fields["og:image"] ogp_use_first_image = False ogp_image_alt = fields.get("og:image:alt") fields.pop("og:image", None) else: image_url = config["ogp_image"] ogp_use_first_image = config["ogp_use_first_image"] ogp_image_alt = fields.get("og:image:alt", config["ogp_image_alt"]) fields.pop("og:image:alt", None) first_image = None if ogp_use_first_image: first_image = doctree.next_node(nodes.image) if ( first_image and Path(first_image.get("uri", "")).suffix[1:].lower() in IMAGE_MIME_TYPES ): image_url = first_image["uri"] ogp_image_alt = first_image.get("alt", None) else: first_image = None if image_url: # temporarily disable relative image paths with field lists if "og:image" not in fields: image_url_parsed = urlparse(image_url) if not image_url_parsed.scheme: # Relative image path detected, relative to the source. Make absolute. if first_image: root = page_url else: # ogp_image is set # ogp_image is defined as being relative to the site root. # This workaround is to keep that functionality from breaking. root = config["ogp_site_url"] image_url = urljoin(root, image_url_parsed.path) tags["og:image"] = image_url # Add image alt text (either provided by config or from site_name) if isinstance(ogp_image_alt, str): tags["og:image:alt"] = ogp_image_alt elif ogp_image_alt is None and site_name: tags["og:image:alt"] = site_name elif ogp_image_alt is None and title: tags["og:image:alt"] = title # arbitrary tags and overrides tags.update({k: v for k, v in fields.items() if k.startswith("og:")}) return ( "\n".join( [make_tag(p, c) for p, c in tags.items()] + [make_tag(p, c, "name") for p, c in meta_tags.items()] + config["ogp_custom_meta_tags"] ) + "\n" ) def html_page_context( app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: nodes.document, ) -> None: if doctree: context["metatags"] += get_tags(app, context, doctree, app.config) def setup(app: Sphinx) -> Dict[str, Any]: # ogp_site_url="" allows relative by default, even though it's not # officially supported by OGP. app.add_config_value("ogp_site_url", "", "html") app.add_config_value("ogp_description_length", DEFAULT_DESCRIPTION_LENGTH, "html") app.add_config_value("ogp_image", None, "html") app.add_config_value("ogp_image_alt", None, "html") app.add_config_value("ogp_use_first_image", False, "html") app.add_config_value("ogp_type", "website", "html") app.add_config_value("ogp_site_name", None, "html") app.add_config_value("ogp_custom_meta_tags", [], "html") app.add_config_value("ogp_enable_meta_description", True, "html") app.connect("html-page-context", html_page_context) return { "parallel_read_safe": True, "parallel_write_safe": True, } sphinxext-opengraph-0.7.5/sphinxext/opengraph/descriptionparser.py000066400000000000000000000075121435511104100256650ustar00rootroot00000000000000import string from typing import Iterable import docutils.nodes as nodes class DescriptionParser(nodes.NodeVisitor): """ Finds the title and creates a description from a doctree """ def __init__( self, desc_len: int, known_titles: Iterable[str] = None, document: nodes.document = None, ): # Hack to prevent requirement for the doctree to be passed in. # It's only used by doctree.walk(...) to print debug messages. if document is None: class document_cls: class reporter: @staticmethod def debug(*args, **kwaargs): pass document = document_cls() if known_titles == None: known_titles = [] super().__init__(document) self.description = "" self.desc_len = desc_len self.list_level = 0 self.known_titles = known_titles self.first_title_found = False # Exceptions can't be raised from dispatch_departure() # This is used to loop the stop call back to the next dispatch_visit() self.stop = False def dispatch_visit(self, node: nodes.Element) -> None: if self.stop: raise nodes.StopTraversal # Skip comments if isinstance(node, nodes.Invisible): raise nodes.SkipNode # Skip all admonitions if isinstance(node, nodes.Admonition): raise nodes.SkipNode # Mark start of nested lists if isinstance(node, nodes.Sequential): self.list_level += 1 if self.list_level > 1: self.description += "-" # Skip the first title if it's the title of the page if not self.first_title_found and isinstance(node, nodes.title): self.first_title_found = True if node.astext() in self.known_titles: raise nodes.SkipNode if isinstance(node, nodes.raw) or isinstance(node.parent, nodes.literal_block): raise nodes.SkipNode # Only include leaf nodes in the description if len(node.children) == 0: text = node.astext().replace("\r", "").replace("\n", " ").strip() # Remove double spaces while text.find(" ") != -1: text = text.replace(" ", " ") # Put a space between elements if one does not already exist. if ( len(self.description) > 0 and len(text) > 0 and self.description[-1] not in string.whitespace and text[0] not in string.whitespace + string.punctuation ): self.description += " " self.description += text def dispatch_departure(self, node: nodes.Element) -> None: # Separate title from text if isinstance(node, nodes.title): self.description += ":" # Separate list elements if isinstance(node, nodes.Part): self.description += "," # Separate end of list from text if isinstance(node, nodes.Sequential): if self.description and self.description[-1] == ",": self.description = self.description[:-1] self.description += "." self.list_level -= 1 # Check for length if len(self.description) > self.desc_len: self.description = self.description[: self.desc_len] if self.desc_len >= 3: self.description = self.description[:-3] + "..." self.stop = True def get_description( doctree: nodes.document, description_length: int, known_titles: Iterable[str] = None, document: nodes.document = None, ): mcv = DescriptionParser(description_length, known_titles, document) doctree.walkabout(mcv) return mcv.description sphinxext-opengraph-0.7.5/sphinxext/opengraph/metaparser.py000066400000000000000000000013541435511104100242660ustar00rootroot00000000000000from html.parser import HTMLParser class HTMLTextParser(HTMLParser): """ Parse HTML into text """ def __init__(self): super().__init__() self.meta_description = None def handle_starttag(self, tag, attrs) -> None: # For example: # attrs = [("content", "My manual description"), ("name", "description")] if ("name", "description") in attrs: self.meta_description = True for name, value in attrs: if name == "content": self.meta_description = value break def get_meta_description(meta_tags: str) -> bool: htp = HTMLTextParser() htp.feed(meta_tags) htp.close() return htp.meta_description sphinxext-opengraph-0.7.5/sphinxext/opengraph/titleparser.py000066400000000000000000000014531435511104100244610ustar00rootroot00000000000000from html.parser import HTMLParser class HTMLTextParser(HTMLParser): """ Parse HTML into text """ def __init__(self): super().__init__() # All text found self.text = "" # Only text outside of html tags self.text_outside_tags = "" self.level = 0 def handle_starttag(self, tag, attrs) -> None: self.level += 1 def handle_endtag(self, tag) -> None: self.level -= 1 def handle_data(self, data) -> None: self.text += data if self.level == 0: self.text_outside_tags += data def get_title(title: str, skip_html_tags: bool = False): htp = HTMLTextParser() htp.feed(title) htp.close() if skip_html_tags: return htp.text_outside_tags else: return htp.text sphinxext-opengraph-0.7.5/tests/000077500000000000000000000000001435511104100166735ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/conftest.py000066400000000000000000000023021435511104100210670ustar00rootroot00000000000000import pytest from bs4 import BeautifulSoup from sphinx.testing.path import path from sphinx.application import Sphinx pytest_plugins = "sphinx.testing.fixtures" @pytest.fixture(scope="session") def rootdir(): return path(__file__).parent.abspath() / "roots" @pytest.fixture() def content(app): app.build() yield app def _meta_tags(content, subdir=None): if subdir is None: c = (content.outdir / "index.html").read_text() else: c = (content.outdir / subdir / "index.html").read_text() return BeautifulSoup(c, "html.parser").find_all("meta") def _og_meta_tags(content): return [ tag for tag in _meta_tags(content) if tag.get("property", "").startswith("og:") ] @pytest.fixture() def meta_tags(content): return _meta_tags(content) @pytest.fixture() def og_meta_tags(content): return [ tag for tag in _meta_tags(content) if tag.get("property", "").startswith("og:") ] @pytest.fixture() def og_meta_tags_sub(content): return [ tag for tag in _meta_tags(content, "sub") if tag.get("property", "").startswith("og:") ] def pytest_configure(config): config.addinivalue_line("markers", "sphinx") sphinxext-opengraph-0.7.5/tests/roots/000077500000000000000000000000001435511104100200415ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-arbitrary-tags/000077500000000000000000000000001435511104100237515ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-arbitrary-tags/conf.py000066400000000000000000000002371435511104100252520ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-arbitrary-tags/index.rst000066400000000000000000000005121435511104100256100ustar00rootroot00000000000000:og:video: http://example.org/en/latest/video.mp4 :og:video:type: video/mp4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-custom-tags/000077500000000000000000000000001435511104100232645ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-custom-tags/conf.py000066400000000000000000000003711435511104100245640ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_custom_meta_tags = [ '', ] sphinxext-opengraph-0.7.5/tests/roots/test-custom-tags/index.rst000066400000000000000000000003721435511104100251270ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-description-length/000077500000000000000000000000001435511104100246205ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-description-length/conf.py000066400000000000000000000002731435511104100261210ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_description_length = 50 sphinxext-opengraph-0.7.5/tests/roots/test-description-length/index.rst000066400000000000000000000003721435511104100264630ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-double-spacing/000077500000000000000000000000001435511104100237125ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-double-spacing/conf.py000066400000000000000000000002371435511104100252130ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-double-spacing/index.rst000066400000000000000000000000501435511104100255460ustar00rootroot00000000000000Example sentence 1. Example sentence 2.sphinxext-opengraph-0.7.5/tests/roots/test-first-image-no-image/000077500000000000000000000000001435511104100247175ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-first-image-no-image/conf.py000066400000000000000000000004521435511104100262170ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "http://example.org/en/latest/image33.png" ogp_image_alt = "TEST" ogp_use_first_image = True sphinxext-opengraph-0.7.5/tests/roots/test-first-image-no-image/index.rst000066400000000000000000000000121435511104100265510ustar00rootroot00000000000000Title Onlysphinxext-opengraph-0.7.5/tests/roots/test-first-image/000077500000000000000000000000001435511104100232255ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-first-image/conf.py000066400000000000000000000004521435511104100245250ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "http://example.org/en/latest/image33.png" ogp_image_alt = "TEST" ogp_use_first_image = True sphinxext-opengraph-0.7.5/tests/roots/test-first-image/index.rst000066400000000000000000000001171435511104100250650ustar00rootroot00000000000000.. image:: http://example.org/en/latest/image2.png :alt: Test image alt textsphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/000077500000000000000000000000001435511104100237755ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/conf.py000066400000000000000000000003761435511104100253020ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "_static/image33.png" ogp_use_first_image = True sphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/img/000077500000000000000000000000001435511104100245515ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/img/sample.jpg000066400000000000000000000202711435511104100265360ustar00rootroot00000000000000ÿØÿàJFIFÀÀÿÛC      ÿÛC  ÿÀÈÈ"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?¯ÿCÿ‚!ü)ÿ‚”þÊ^ ñ׎¼Añ JÕ´¯\è0àßYÁlÐGge:³,Ö²¶ý× ñIûþ!9ýèsøÕÿƒ}3ÿ•ôÁ§?òޝÿÙG¾ÿÓf—_§Õçá°Ô¥J2”u?Zã^5Ï0™æ' †ÄÊ0Œ¬’Ù#óþ!9ýèsøÕÿƒ}3ÿ•ôÄ'?³¯ý¿ðo¦ò¾¿O¨­þ©GùO–ÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?Ãüçïþ yÿCøSÿÖý”¼?ã¯øƒâ««j¾,¶Ðf‡^¾³žÙ`’ÎöveXmbmû­ÐXŒã$WØßðv7ü£«ÁŸöQìôÙªQ^&:…^X«#úSà Ó˜dqÄãfç>i+¿ ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯oüŸÍ~ ÿÉG‹ÿ肊(®“り( Š( Š( Š( Š( Š( Š( Š( Š( Š( Ìø;þQÕàÏû(ö?úlÕ(£þÆÿ”ux3þÊ=þ›5J+ç³ãÖ¾É9ñÏóø4çþQÕã?û(÷ßúlÒëôú¿0àÓŸùGWŒÿì£ßé³K¯Óêö0Á‰ü÷âü”x¿ñþˆ(¢Šé>8(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢ŠüÁÿƒ±¿å^ ÿ²cÿ¦ÍRŠ?àìoùGWƒ?ì£Øÿé³T¢¾{1þ1ýkà÷ü“‘ÿÿ0ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯cüŸÏ~ ÿÉG‹ÿ肊(®“り( Š( Š( Š( Š( Š( Š( Š( Š( Š( Ìø;þQÕàÏû(ö?úlÕ(£þÆÿ”ux3þÊ=þ›5J+ç³ãÖ¾É9ñÏóø4çþQÕã?û(÷ßúlÒëôú¿0àÓŸùGWŒÿì£ßé³K¯Óêö0Á‰ü÷âü”x¿ñþˆ(¢Šé>8(¢Šü¨ÿ‚ÉÿÁǯì9ûKÛüøðÐüWøÂðE%âL—ÚtÒ¢Ë ¬v–ÃÏ»™¡;Ø#Æ2rä²§Ìþÿƒ®hïÙ‡â¶aû[~ÌÒxÂþ!˜ª]YøwVðåüP©Q$ðè<¢ëËÜ "²}áó׫ÿ‚ÝÿÁ!ÿi߇_ðQ‡ý±¿dÛË­[Ä×ñ>£§X‹i5]&x¬þÈòCop WpK(1aäÞíˆÙy_žþJø‡¢x›Gøû|~ɾñÖ‰c$wqÁ®ø,éÚÅ”›]ðYjJöò¾ÖÚ<´·à·ÍÎ+< ¯¹µÏ}T´OÉy[®Ÿ}Ù®1jÔ¹efµw¶·¿ŸM};ÿG^ñ^ãÏ išæwþ“¬ÚE}cuù.`•Ç"û2°#ëZ5ð×ü;á‰?oßø%v‡ìÅñ›Ãü#«évš¥¶ª‘>™cs¢ |Çd.`em> ß²6;c1ºŸÁ¿ø)Ÿì¡û;ÿÁ0¼à~Í?µ®±ã¿I©"kÒxÄ–÷q*4.ÒÝ[Ïcû8*©ŠiäfŽ»XÖ•§u§§¤¢–ò×­´Ûg¶Ï¡•(Êta8´Û‹}£t¯k¾ý7ù½ë&Šüÿƒ›>/jÿ´üoöGñψ$Yõß^hºÎ£*¢ –æãAžY[j€£.Ìp<+Èÿà¡?ðGïøKþïáÛÆß~(ø“ã¾—¡ë&+»äM7J´¾–†ÎѶíÜGó$‚2Q±‚0Væ£:ª¦Ôª*m®ín¾‚½ú/Þª^Ïâ©4Ÿ—N¿ðïæJ”Wó‡ü#ÆßðSßø"n­û\ürø÷ñ;Å<7á­GXðŽ˜÷P N³ÒĪKŒ³O?ÙYšxÚ7%Õ¤ós7Ô?ðI_ÚŸÆßµGüÿñÚçÇzåÿ‰5OxoÅþµÔoçiîç´I3D²ÈÙg)ç²Ĉƒµù¨ÇÍñQ3]Õìµèﺳ¶ºé«Ã¯mR„WÃV\‰ö’ÕéÕvw×M5ÓönŠþbàßø#Ïü×öKñXø‘ñWÇþø3á?Ëi¤ø_ÃWpÀ/5‡‚ÞYï&Ç$d$fÝFèË®Ho¢¿àˆ_¾%Á.?àµþ1ý…üOãMKÇ¥Šãþ϶9UÓ¥[5Ô`šv&’ØÈ²CÚd!‡BOG°ýú÷ï8¹¯D”šõ³ºÞú^ÚÛkû—]+¨»?-mD÷ÚÞz_ëø&÷ü›â—íƒÿ¢øñû9ø—Að‚~péWÚeÜZ­ÇØuH,âóä’åâlÇ+Ùe€#hàþ×à7üÑü¿ø:göÂcÐ/‹‰ÿ†ξRñ§í·ðgþ ûw|Nñí‘û@øïáWÂÜ´𧇴ûË­Ñù’"0òí.¡‰Ö(Õ¦y"ß+βªm´§Í†Â%ñJ—4›vûR_{èºÙö;+ÓQÄbŸÙ…NT’¾éYy-îúvíýSQ_ϧü·ÿ à¿ük_ý˜¼ñƒYøÕû=ø®ÖæjºÔV·:|ðÛ}³lq\¢IØ."‘*;Ʋ¨PH?Ð]o:iB#{M]]YîÕšïtrÆwœ©½âìíªÙ;§Û_¾ë QE‘aEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQE~ ÁK>3~Ù¿ðEoø*7ˆþ8é—>1þÍþ&žk¨´]G^¿¾Ðt¨îB´¶oéO’³äIåìÙµW9’1óŸüþ ŸñWþø?eðáwìÁ$7Úž«ky<öºŒž#½·1È<·ŽAko’n8’y QpY“_Ó•*1öq£[ÞŒmnGu®·³5©YóÊ­/vRߪÕY»t¿[|¬=ÿð__Ø?ãgì¿ÿ=ý—~éßÛ~#ð§Ãd_ˆñi,÷6ðÞÕ,uïx€hv–:lËYAn“Û“ö¦2^12HVVáŒ`#úš¢®­êºŽn|ÿ=¯»WJÉíeÒéçJÔ£J4ÿåÜ\=bÿ^—×N‡ó•ÿÌñž›ãÏø6ƒö!¾Ò®¢¼µ‰´kxÜ0Y­ô;›yàýä–'R:‚¤kíoø-üªÁmÿb_ƒ?ôv›_«ôUâß·úÇOkR5=9zyß¾ž„ásSSe[´ïå¶ÚŸ‘°·ü©ÿªÿÙ.ñgþÔkÄÿàÿò«ßíGÿ^þ2ÿÓ 5ûÁ^Oûxü4Öþ3þÃÿ¼á«/í/x«Á:Α¥ÚyÑÃö««‹¢Š=ò2¢îwQ¹˜(ÎIšÏ2ªæ±•¢µ­[v´œ¾wÛ¡¾YÂxJRvTªs_½ÒÊÛÜþyÿàÝïø,-çüoöDñ¥ÿÄ?…_|QðGÄ~)•­ðOüáû}üXпjÙ¢Œ|isæx?Ä·°×„1¤³<Ù¯Býâ”$ñ cuhÃi?Ó½ÁM:p¡=iÃÙ¾ÒWnöèÕôÕÛ^úwVš«:î[Tšžf¶Wê»è®~[ÿÁÿj?€ß·Ç=CÄ ÿa+oƒúw‡VYô/ˆéàO‚HÙ {EÄQÆñÏ"»©ŽÙ§IÜáZ¿R(¢µ”“I.ˆçŒZm¾¯î]‚Š(¨,(¢ŠüÁÿƒ±¿å^ ÿ²cÿ¦ÍRŠ?àìoùGWƒ?ì£Øÿé³T¢¾{1þ1ýkà÷ü“‘ÿÿ0ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯cüŸÏ~ ÿÉG‹ÿ肊(®“り( ®ÿà´ß l¿àªq~ÈM øüüJ˜]HXÚaŒé§Ræ_´ùÿêFßõŽŸ5}{_€úÿü¯cÿ\ÓÿPã[´·ügöÄðŸüÏâ'ìëð’û@ñŽ¡q‰á/ ëšu¾Ÿ£M&Ÿku%ô×B·R$(.d*Ót=j¡T_=?*¼êBRõå•­å}-Ó»HÓJ¬úB*ŸþOÛôVoò¹û»E>^:ÿ‚ÍÁA?à–·Ô>3¿øûâOØÀ¾Óôëx4ëY.o¤x,ž ˆmm•nWcÇ:e•X"Q½ûHÁUoÿø#÷í£ðÄþÒ~#øg㿇ß.|ÆÐü9§B¶ºu¸š$¹† Å´7+q Ì…|×™#æ~Hª+ÚÊœaÿ/*}9–ñõ_wÌj·N3”–°\ÍuåÓÞô××G¡ûßE|7ÿ¬ý¦¿jÿ‚ü¤þÊŸ ߯:׋¯¾Ç©ø™íã¾ÃJì‰ÛRá²ÌåšyQ …#mÀîÊ~r~ÓðS¿ø(wüûãÇÃ)ÿi/ü4øÃைå¬ôÍ6ÞŽ($„]"Ϥ±Ü*L…IY£ù‡ ‚( ½­HÓÛš\ªý_çójÅÍ8Þ>öœÖZ»]ßú+óOþÿ‚Ôx§þ »àÿxái®|aø¸ÎšCÝ[›ˆô˜7¤K*ÁÀšy%$HĨ(Å•€ß#þן¶ü3þ kûjÞ:ø»â/‡ž1ÓüQ ½¤:Þ“g`u‡7²¼~_Ú"K(í&GÃÄFÉ×{®%_—v^Õ{9U |·ï.ËÎúvOFÑJÒŒbîä¹½#üÏÊÚ÷kT™ûÉE~YþÌŸð[üÿƒu»k¶Ú“I:Œ£¼›J=]›^WÒýôÜýᢾoÿ‚OÿÁCôŸø*ìGáo‹vœt[ëó.Ÿ­i{Ë®¨@BÍ7ñFr²!ë²DÎ }!UV”©ÍÂ[ÿZú=Ñ:‘©hÿ]Š(¬Ë (¢€ (¢€?0àìoùGWƒ?ì£Øÿé³T¢ø;þQÕàÏû(ö?úlÕ(¯žÌŒZø=ÿ$äÇ?Ì?àÓŸùGWŒÿì£ßé³K¯ÓêüÁÿƒNå^3ÿ²}ÿ¦Í.¿O«ØÁÿ'ó߈?òQâÿÇú ¢Š+¤øà¢Š(ð_ÿ•áìëšêiß³ì 7üÇãÒè¬cŠñ°ÎÓÿä##Ðò:ýx¸ÿ‚^| ºý¸“ö‘çãD`ñöΡÀaÿ_?ì¿ñïòªÿkï|Ô¾ÿ‚_ü ð§í³¨~Ñvò>2jŠëuâíA¼ÐöËlßèÍ9¶…UxˆtÏ^j°oØûoùwN¤¬ö·—ɆcþÑÏÉÕÑßþü_OÆÇäOüÏþV£ý’ÜðÇþžnê_ø='þJÇì©ÿ_zÇþŽÓkõÇãoüÿàgíûTøKãgŒ¼ý±ñ;À¢ÔhzÏöΡoö³LóÃûˆ§Hl’;|ñ¶sƒ¥ý´¿à˜ࡺ·…/¾0ø#þû¯<Òh¯ý³¨iÿbiLM!ŬñɆ?¾xÆNV÷Qé˺Өý$ôKÏî^eW|õ«T[N”`½TZ×Ë__#óSþKÿ‚ üPýœ¿kß<;ãý[à¿ÃoYÙê-ñ¶‘]J+Y¯šÚo&m¥âû&ø÷âø »ºñ5¯ÉâÙ®QÚÜZ@nC`˲áŠÂ ãðý2þÙðO/‚ÿðPoiÞøÅà #ƺv+M§´òMmw`Í´?“sÇ0üYK>öâîÕî¬á†îÞêh­ækË»¦Böè¥B„aØ¡k&•\<ð´ï$ª9$—½ïI6¤»i{«Ú>nêðÉЫGQÙ¨F-ý•Ȭ¤¼×X»]®Çªü[ø¯|dÿƒ1þꤷ«àÝø“RŽ(ÚG[5Õ5ki$vCt®Ç UbxÅþÇßðL¯ø&WÅ¿Øs¿¾#~Óþ5ðo‹L‡þÿÂS¤Ã}c¨( p–ú{iÒ]É™’…L¡1Á5û¥ÿlýõ/ØËþ eð§áWŒl"]oOÑe“^Óæ):Cq{4·SÛ> #„iÚ3‚Tí8à׬ÿÁ¸_±6»ñOÍðé©K?ÚZ}SR¶Óƒz îÔ'û ¾ÕߌVÆâlã9ÞýS^îi_Ôã¡'<=&îœT´ò”œ•û4ߟo3sþ“û%ü ý‘cË3öwø«|Pøyâ=v}iuký^ÓRh®Z(!’khaXˆP˜Ù7†fÏPØ5‹ðëáLJþøLðÏ…tM'Ã~Ñ Öf™h–¶–Q‰H¨äðs[UªsÊ÷¾Ë^ÉY~t¡Ë?ÃÏVQEdhQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ˜Á§?òޝÿÙG¾ÿÓf—_§ÕùƒÿœÿÊ:¼gÿeûÿMš]~ŸW±ƒþ Oç¿ä£ÅÿôAEWIñÁEPEPEPEPEPEPEPEPEPEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQEQEQEQEQEQEQEQEQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ˜Á§?òޝÿÙG¾ÿÓf—_§ÕùƒÿœÿÊ:¼gÿeûÿMš]~ŸW±ƒþ Oç¿ä£ÅÿôAEWIñÁEPEPEPEPEPEPEPEPEPEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQEQEQEQEQEQEQEQEQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ™ñÏüþ yð§þ ­û)xƒÀ¾:ðÿÄ-WVÕ|Ys¯C6ƒcg=²Á%” ¬Ó]DÛ÷[¹ )+ÎIìoø‹öuÿ¡3ãWþ 4ÏþXQED1ÕaìC4ðÃ#Ì1sÆâc.y»»JÊáÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEÚ5?þ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿaÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEhÖøƒÜ9ü³ÿÀØÄXß³¯ý Ÿ¿ðQ¦òÂø‹öuÿ¡3ãWþ 4ÏþXQEÚ5ƒþ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿaÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEhÖøƒÜ9ü³ÿÀØÄXß³¯ý Ÿ¿ðQ¦òÂø‹öuÿ¡3ãWþ 4ÏþXQEÚ5ƒþ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿgÇ?ð[Ïø-çŸø)Oì¥áÿøÃÿ´­[Jñe¶½4ÚõœÍvw°2«Cu+oÝp„ `79Š+–­YT—4·>ç!Èp™>`°I¨&Þ®ûŸÿÙsphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/index.rst000066400000000000000000000000671435511104100256410ustar00rootroot00000000000000.. image:: img/sample.jpg :alt: Test image alt text sphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/sub/000077500000000000000000000000001435511104100245665ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-image-rel-paths/sub/index.rst000066400000000000000000000001261435511104100264260ustar00rootroot00000000000000======== Sub Page ======== .. image:: ../img/sample.jpg :alt: Test image alt text sphinxext-opengraph-0.7.5/tests/roots/test-image/000077500000000000000000000000001435511104100221005ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-image/conf.py000066400000000000000000000003661435511104100234040ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "http://example.org/en/latest/image.png" sphinxext-opengraph-0.7.5/tests/roots/test-image/index.rst000066400000000000000000000000001435511104100237270ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-list/000077500000000000000000000000001435511104100217715ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-list/conf.py000066400000000000000000000002371435511104100232720ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-list/index.rst000066400000000000000000000000431435511104100236270ustar00rootroot00000000000000* Item 1 * Item 2 * Item 3 * Item 4sphinxext-opengraph-0.7.5/tests/roots/test-local-image/000077500000000000000000000000001435511104100231705ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-local-image/_static/000077500000000000000000000000001435511104100246165ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-local-image/_static/sample.jpg000066400000000000000000000202711435511104100266030ustar00rootroot00000000000000ÿØÿàJFIFÀÀÿÛC      ÿÛC  ÿÀÈÈ"ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?¯ÿCÿ‚!ü)ÿ‚”þÊ^ ñ׎¼Añ JÕ´¯\è0àßYÁlÐGge:³,Ö²¶ý× ñIûþ!9ýèsøÕÿƒ}3ÿ•ôÁ§?òޝÿÙG¾ÿÓf—_§Õçá°Ô¥J2”u?Zã^5Ï0™æ' †ÄÊ0Œ¬’Ù#óþ!9ýèsøÕÿƒ}3ÿ•ôÄ'?³¯ý¿ðo¦ò¾¿O¨­þ©GùO–ÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?ÃüÌø„çöuÿ¡ÏãWþ ôÏþWÑÿœþοô9üjÿÁ¾™ÿÊúý>¢ªQþPÿˆƒÄô?Ãüçïþ yÿCøSÿÖý”¼?ã¯øƒâ««j¾,¶Ðf‡^¾³žÙ`’ÎöveXmbmû­ÐXŒã$WØßðv7ü£«ÁŸöQìôÙªQ^&:…^X«#úSà Ó˜dqÄãfç>i+¿ ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯oüŸÍ~ ÿÉG‹ÿ肊(®“り( Š( Š( Š( Š( Š( Š( Š( Š( Š( Ìø;þQÕàÏû(ö?úlÕ(£þÆÿ”ux3þÊ=þ›5J+ç³ãÖ¾É9ñÏóø4çþQÕã?û(÷ßúlÒëôú¿0àÓŸùGWŒÿì£ßé³K¯Óêö0Á‰ü÷âü”x¿ñþˆ(¢Šé>8(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢ŠüÁÿƒ±¿å^ ÿ²cÿ¦ÍRŠ?àìoùGWƒ?ì£Øÿé³T¢¾{1þ1ýkà÷ü“‘ÿÿ0ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯cüŸÏ~ ÿÉG‹ÿ肊(®“り( Š( Š( Š( Š( Š( Š( Š( Š( Š( Ìø;þQÕàÏû(ö?úlÕ(£þÆÿ”ux3þÊ=þ›5J+ç³ãÖ¾É9ñÏóø4çþQÕã?û(÷ßúlÒëôú¿0àÓŸùGWŒÿì£ßé³K¯Óêö0Á‰ü÷âü”x¿ñþˆ(¢Šé>8(¢Šü¨ÿ‚ÉÿÁǯì9ûKÛüøðÐüWøÂðE%âL—ÚtÒ¢Ë ¬v–ÃÏ»™¡;Ø#Æ2rä²§Ìþÿƒ®hïÙ‡â¶aû[~ÌÒxÂþ!˜ª]YøwVðåüP©Q$ðè<¢ëËÜ "²}áó׫ÿ‚ÝÿÁ!ÿi߇_ðQ‡ý±¿dÛË­[Ä×ñ>£§X‹i5]&x¬þÈòCop WpK(1aäÞíˆÙy_žþJø‡¢x›Gøû|~ɾñÖ‰c$wqÁ®ø,éÚÅ”›]ðYjJöò¾ÖÚ<´·à·ÍÎ+< ¯¹µÏ}T´OÉy[®Ÿ}Ù®1jÔ¹efµw¶·¿ŸM};ÿG^ñ^ãÏ išæwþ“¬ÚE}cuù.`•Ç"û2°#ëZ5ð×ü;á‰?oßø%v‡ìÅñ›Ãü#«évš¥¶ª‘>™cs¢ |Çd.`em> ß²6;c1ºŸÁ¿ø)Ÿì¡û;ÿÁ0¼à~Í?µ®±ã¿I©"kÒxÄ–÷q*4.ÒÝ[Ïcû8*©ŠiäfŽ»XÖ•§u§§¤¢–ò×­´Ûg¶Ï¡•(Êta8´Û‹}£t¯k¾ý7ù½ë&Šüÿƒ›>/jÿ´üoöGñψ$Yõß^hºÎ£*¢ –æãAžY[j€£.Ìp<+Èÿà¡?ðGïøKþïáÛÆß~(ø“ã¾—¡ë&+»äM7J´¾–†ÎѶíÜGó$‚2Q±‚0Væ£:ª¦Ôª*m®ín¾‚½ú/Þª^Ïâ©4Ÿ—N¿ðïæJ”Wó‡ü#ÆßðSßø"n­û\ürø÷ñ;Å<7á­GXðŽ˜÷P N³ÒĪKŒ³O?ÙYšxÚ7%Õ¤ós7Ô?ðI_ÚŸÆßµGüÿñÚçÇzåÿ‰5OxoÅþµÔoçiîç´I3D²ÈÙg)ç²Ĉƒµù¨ÇÍñQ3]Õìµèﺳ¶ºé«Ã¯mR„WÃV\‰ö’ÕéÕvw×M5ÓönŠþbàßø#Ïü×öKñXø‘ñWÇþø3á?Ëi¤ø_ÃWpÀ/5‡‚ÞYï&Ç$d$fÝFèË®Ho¢¿àˆ_¾%Á.?àµþ1ý…üOãMKÇ¥Šãþ϶9UÓ¥[5Ô`šv&’ØÈ²CÚd!‡BOG°ýú÷ï8¹¯D”šõ³ºÞú^ÚÛkû—]+¨»?-mD÷ÚÞz_ëø&÷ü›â—íƒÿ¢øñû9ø—Að‚~péWÚeÜZ­ÇØuH,âóä’åâlÇ+Ùe€#hàþ×à7üÑü¿ø:göÂcÐ/‹‰ÿ†ξRñ§í·ðgþ ûw|Nñí‘û@øïáWÂÜ´𧇴ûË­Ñù’"0òí.¡‰Ö(Õ¦y"ß+βªm´§Í†Â%ñJ—4›vûR_{èºÙö;+ÓQÄbŸÙ…NT’¾éYy-îúvíýSQ_ϧü·ÿ à¿ük_ý˜¼ñƒYøÕû=ø®ÖæjºÔV·:|ðÛ}³lq\¢IØ."‘*;Ʋ¨PH?Ð]o:iB#{M]]YîÕšïtrÆwœ©½âìíªÙ;§Û_¾ë QE‘aEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQE~ ÁK>3~Ù¿ðEoø*7ˆþ8é—>1þÍþ&žk¨´]G^¿¾Ðt¨îB´¶oéO’³äIåìÙµW9’1óŸüþ ŸñWþø?eðáwìÁ$7Úž«ky<öºŒž#½·1È<·ŽAko’n8’y QpY“_Ó•*1öq£[ÞŒmnGu®·³5©YóÊ­/vRߪÕY»t¿[|¬=ÿð__Ø?ãgì¿ÿ=ý—~éßÛ~#ð§Ãd_ˆñi,÷6ðÞÕ,uïx€hv–:lËYAn“Û“ö¦2^12HVVáŒ`#úš¢®­êºŽn|ÿ=¯»WJÉíeÒéçJÔ£J4ÿåÜ\=bÿ^—×N‡ó•ÿÌñž›ãÏø6ƒö!¾Ò®¢¼µ‰´kxÜ0Y­ô;›yàýä–'R:‚¤kíoø-üªÁmÿb_ƒ?ôv›_«ôUâß·úÇOkR5=9zyß¾ž„ásSSe[´ïå¶ÚŸ‘°·ü©ÿªÿÙ.ñgþÔkÄÿàÿò«ßíGÿ^þ2ÿÓ 5ûÁ^Oûxü4Öþ3þÃÿ¼á«/í/x«Á:Α¥ÚyÑÃö««‹¢Š=ò2¢îwQ¹˜(ÎIšÏ2ªæ±•¢µ­[v´œ¾wÛ¡¾YÂxJRvTªs_½ÒÊÛÜþyÿàÝïø,-çüoöDñ¥ÿÄ?…_|QðGÄ~)•­ðOüáû}üXпjÙ¢Œ|isæx?Ä·°×„1¤³<Ù¯Býâ”$ñ cuhÃi?Ó½ÁM:p¡=iÃÙ¾ÒWnöèÕôÕÛ^úwVš«:î[Tšžf¶Wê»è®~[ÿÁÿj?€ß·Ç=CÄ ÿa+oƒúw‡VYô/ˆéàO‚HÙ {EÄQÆñÏ"»©ŽÙ§IÜáZ¿R(¢µ”“I.ˆçŒZm¾¯î]‚Š(¨,(¢ŠüÁÿƒ±¿å^ ÿ²cÿ¦ÍRŠ?àìoùGWƒ?ì£Øÿé³T¢¾{1þ1ýkà÷ü“‘ÿÿ0ÿƒNå^3ÿ²}ÿ¦Í.¿O«óþ 9ÿ”uxÏþÊ=÷þ›4ºý>¯cüŸÏ~ ÿÉG‹ÿ肊(®“り( ®ÿà´ß l¿àªq~ÈM øüüJ˜]HXÚaŒé§Ræ_´ùÿêFßõŽŸ5}{_€úÿü¯cÿ\ÓÿPã[´·ügöÄðŸüÏâ'ìëð’û@ñŽ¡q‰á/ ëšu¾Ÿ£M&Ÿku%ô×B·R$(.d*Ót=j¡T_=?*¼êBRõå•­å}-Ó»HÓJ¬úB*ŸþOÛôVoò¹û»E>^:ÿ‚ÍÁA?à–·Ô>3¿øûâOØÀ¾Óôëx4ëY.o¤x,ž ˆmm•nWcÇ:e•X"Q½ûHÁUoÿø#÷í£ðÄþÒ~#øg㿇ß.|ÆÐü9§B¶ºu¸š$¹† Å´7+q Ì…|×™#æ~Hª+ÚÊœaÿ/*}9–ñõ_wÌj·N3”–°\ÍuåÓÞô××G¡ûßE|7ÿ¬ý¦¿jÿ‚ü¤þÊŸ ߯:׋¯¾Ç©ø™íã¾ÃJì‰ÛRá²ÌåšyQ …#mÀîÊ~r~ÓðS¿ø(wüûãÇÃ)ÿi/ü4øÃைå¬ôÍ6ÞŽ($„]"Ϥ±Ü*L…IY£ù‡ ‚( ½­HÓÛš\ªý_çójÅÍ8Þ>öœÖZ»]ßú+óOþÿ‚Ôx§þ »àÿxái®|aø¸ÎšCÝ[›ˆô˜7¤K*ÁÀšy%$HĨ(Å•€ß#þן¶ü3þ kûjÞ:ø»â/‡ž1ÓüQ ½¤:Þ“g`u‡7²¼~_Ú"K(í&GÃÄFÉ×{®%_—v^Õ{9U |·ï.ËÎúvOFÑJÒŒbîä¹½#üÏÊÚ÷kT™ûÉE~YþÌŸð[üÿƒu»k¶Ú“I:Œ£¼›J=]›^WÒýôÜýᢾoÿ‚OÿÁCôŸø*ìGáo‹vœt[ëó.Ÿ­i{Ë®¨@BÍ7ñFr²!ë²DÎ }!UV”©ÍÂ[ÿZú=Ñ:‘©hÿ]Š(¬Ë (¢€ (¢€?0àìoùGWƒ?ì£Øÿé³T¢ø;þQÕàÏû(ö?úlÕ(¯žÌŒZø=ÿ$äÇ?Ì?àÓŸùGWŒÿì£ßé³K¯ÓêüÁÿƒNå^3ÿ²}ÿ¦Í.¿O«ØÁÿ'ó߈?òQâÿÇú ¢Š+¤øà¢Š(ð_ÿ•áìëšêiß³ì 7üÇãÒè¬cŠñ°ÎÓÿä##Ðò:ýx¸ÿ‚^| ºý¸“ö‘çãD`ñöΡÀaÿ_?ì¿ñïòªÿkï|Ô¾ÿ‚_ü ð§í³¨~Ñvò>2jŠëuâíA¼ÐöËlßèÍ9¶…UxˆtÏ^j°oØûoùwN¤¬ö·—ɆcþÑÏÉÕÑßþü_OÆÇäOüÏþV£ý’ÜðÇþžnê_ø='þJÇì©ÿ_zÇþŽÓkõÇãoüÿàgíûTøKãgŒ¼ý±ñ;À¢ÔhzÏöΡoö³LóÃûˆ§Hl’;|ñ¶sƒ¥ý´¿à˜ࡺ·…/¾0ø#þû¯<Òh¯ý³¨iÿbiLM!ŬñɆ?¾xÆNV÷Qé˺Өý$ôKÏî^eW|õ«T[N”`½TZ×Ë__#óSþKÿ‚ üPýœ¿kß<;ãý[à¿ÃoYÙê-ñ¶‘]J+Y¯šÚo&m¥âû&ø÷âø »ºñ5¯ÉâÙ®QÚÜZ@nC`˲áŠÂ ãðý2þÙðO/‚ÿðPoiÞøÅà #ƺv+M§´òMmw`Í´?“sÇ0üYK>öâîÕî¬á†îÞêh­ækË»¦Böè¥B„aØ¡k&•\<ð´ï$ª9$—½ïI6¤»i{«Ú>nêðÉЫGQÙ¨F-ý•Ȭ¤¼×X»]®Çªü[ø¯|dÿƒ1þꤷ«àÝø“RŽ(ÚG[5Õ5ki$vCt®Ç UbxÅþÇßðL¯ø&WÅ¿Øs¿¾#~Óþ5ðo‹L‡þÿÂS¤Ã}c¨( p–ú{iÒ]É™’…L¡1Á5û¥ÿlýõ/ØËþ eð§áWŒl"]oOÑe“^Óæ):Cq{4·SÛ> #„iÚ3‚Tí8à׬ÿÁ¸_±6»ñOÍðé©K?ÚZ}SR¶Óƒz îÔ'û ¾ÕߌVÆâlã9ÞýS^îi_Ôã¡'<=&îœT´ò”œ•û4ߟo3sþ“û%ü ý‘cË3öwø«|Pøyâ=v}iuký^ÓRh®Z(!’khaXˆP˜Ù7†fÏPØ5‹ðëáLJþøLðÏ…tM'Ã~Ñ Öf™h–¶–Q‰H¨äðs[UªsÊ÷¾Ë^ÉY~t¡Ë?ÃÏVQEdhQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ˜Á§?òޝÿÙG¾ÿÓf—_§ÕùƒÿœÿÊ:¼gÿeûÿMš]~ŸW±ƒþ Oç¿ä£ÅÿôAEWIñÁEPEPEPEPEPEPEPEPEPEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQEQEQEQEQEQEQEQEQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ˜Á§?òޝÿÙG¾ÿÓf—_§ÕùƒÿœÿÊ:¼gÿeûÿMš]~ŸW±ƒþ Oç¿ä£ÅÿôAEWIñÁEPEPEPEPEPEPEPEPEPEPæüÿ(êðgý”{ý6j”QÿcÊ:¼ÿeÇÿMš¥óÙñë_¿äœøçù‡üsÿ(êñŸý”{ïý6iuú}_˜?ðiÏü£«ÆöQï¿ôÙ¥×éõ{?àÄþ{ñþJ<_øÿDQEtŸQEQEQEQEQEQEQEQEQEQE~`ÿÁØßòޝÙG±ÿÓf©Eðv7ü£«ÁŸöQìôÙªQ_=˜ÿþµð{þIÈÿŽ™ñÏüþ yð§þ ­û)xƒÀ¾:ðÿÄ-WVÕ|Ys¯C6ƒcg=²Á%” ¬Ó]DÛ÷[¹ )+ÎIìoø‹öuÿ¡3ãWþ 4ÏþXQED1ÕaìC4ðÃ#Ì1sÆâc.y»»JÊáÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEÚ5?þ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿaÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEhÖøƒÜ9ü³ÿÀØÄXß³¯ý Ÿ¿ðQ¦òÂø‹öuÿ¡3ãWþ 4ÏþXQEÚ5ƒþ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿaÿc~οô&|jÿÁF™ÿË ?â,oÙ×þ„Ï_ø(Ó?ùaEhÖøƒÜ9ü³ÿÀØÄXß³¯ý Ÿ¿ðQ¦òÂø‹öuÿ¡3ãWþ 4ÏþXQEÚ5ƒþ ÷,ÿð6ñ7ìëÿBgƯüiŸü°£þ"ÆýèLøÕÿ‚3ÿ–QGö`ÿˆ=ßË?ü ‡üEû:ÿЙñ«ÿgÿ,(ÿˆ±¿g_ú>5à£Lÿå…Qý£X?âpçòÏÿgÇ?ð[Ïø-çŸø)Oì¥áÿøÃÿ´­[Jñe¶½4ÚõœÍvw°2«Cu+oÝp„ `79Š+–­YT—4·>ç!Èp™>`°I¨&Þ®ûŸÿÙsphinxext-opengraph-0.7.5/tests/roots/test-local-image/conf.py000066400000000000000000000003421435511104100244660ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "_static/sample.jpg" sphinxext-opengraph-0.7.5/tests/roots/test-local-image/index.rst000066400000000000000000000000001435511104100250170ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/000077500000000000000000000000001435511104100307775ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/conf.py000066400000000000000000000003031435511104100322720ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_enable_meta_description = True sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-description/index.rst000066400000000000000000000004541435511104100326430ustar00rootroot00000000000000.. meta:: :description: My manual description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/000077500000000000000000000000001435511104100314025ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/conf.py000066400000000000000000000003031435511104100326750ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_enable_meta_description = True sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description-manual-og-description/index.rst000066400000000000000000000004451435511104100332460ustar00rootroot00000000000000:og:description: My manual og:description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/000077500000000000000000000000001435511104100252035ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/conf.py000066400000000000000000000002771435511104100265100ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" enable_meta_description = True sphinxext-opengraph-0.7.5/tests/roots/test-meta-name-description/index.rst000066400000000000000000000003721435511104100270460ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-nested-lists/000077500000000000000000000000001435511104100234345ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-nested-lists/conf.py000066400000000000000000000002371435511104100247350ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-nested-lists/index.rst000066400000000000000000000001211435511104100252670ustar00rootroot00000000000000* Item 1 * Item 2 * Nested Item 1 * Nested Item 2 * Item 3 * Item 4sphinxext-opengraph-0.7.5/tests/roots/test-overrides-complex/000077500000000000000000000000001435511104100244655ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-overrides-complex/conf.py000066400000000000000000000003441435511104100257650ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image_alt = "Example Alt Text" sphinxext-opengraph-0.7.5/tests/roots/test-overrides-complex/index.rst000066400000000000000000000005641435511104100263330ustar00rootroot00000000000000:ogp_description_length: 10 :og:image: img/sample.jpg :og:image:alt: Overridden Alt Text Lorem Ipsum =========== Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris. sphinxext-opengraph-0.7.5/tests/roots/test-overrides-simple/000077500000000000000000000000001435511104100243075ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-overrides-simple/conf.py000066400000000000000000000004101435511104100256010ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_name = "Example's Docs!" ogp_site_url = "http://example.org/en/latest/" ogp_image = "http://example.org/en/latest/image.png" ogp_type = "book" sphinxext-opengraph-0.7.5/tests/roots/test-overrides-simple/index.rst000066400000000000000000000006571435511104100261600ustar00rootroot00000000000000:og:description: Overridden description :og:title: Overridden Title :og:type: article :og:image: http://example.org/en/latest/overridden-image.png Lorem Ipsum =========== Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris. sphinxext-opengraph-0.7.5/tests/roots/test-quotation-marks/000077500000000000000000000000001435511104100241545ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-quotation-marks/conf.py000066400000000000000000000002641435511104100254550ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" smartquotes = False ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-quotation-marks/index.rst000066400000000000000000000002031435511104100260100ustar00rootroot00000000000000"This text should appear in escaped quotation marks" This text should still appear as well "while this is once again in quotations"sphinxext-opengraph-0.7.5/tests/roots/test-rtd-default/000077500000000000000000000000001435511104100232315ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-rtd-default/conf.py000066400000000000000000000001571435511104100245330ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" sphinxext-opengraph-0.7.5/tests/roots/test-rtd-default/index.rst000066400000000000000000000001211435511104100250640ustar00rootroot00000000000000* Item 1 * Item 2 * Nested Item 1 * Nested Item 2 * Item 3 * Item 4sphinxext-opengraph-0.7.5/tests/roots/test-rtd-invalid/000077500000000000000000000000001435511104100232335ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-rtd-invalid/conf.py000066400000000000000000000001571435511104100245350ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" sphinxext-opengraph-0.7.5/tests/roots/test-rtd-invalid/index.rst000066400000000000000000000001211435511104100250660ustar00rootroot00000000000000* Item 1 * Item 2 * Nested Item 1 * Nested Item 2 * Item 3 * Item 4sphinxext-opengraph-0.7.5/tests/roots/test-simple/000077500000000000000000000000001435511104100223075ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-simple/conf.py000066400000000000000000000002371435511104100236100ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-simple/index.rst000066400000000000000000000003721435511104100241520ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/000077500000000000000000000000001435511104100252305ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/conf.py000066400000000000000000000002701435511104100265260ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] project = "Project name" master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-sitename-from-project/index.rst000066400000000000000000000003721435511104100270730ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-sitename/000077500000000000000000000000001435511104100226235ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-sitename/conf.py000066400000000000000000000003011435511104100241140ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_site_name = "Example's Docs!" sphinxext-opengraph-0.7.5/tests/roots/test-sitename/index.rst000066400000000000000000000003721435511104100244660ustar00rootroot00000000000000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci varius natoque penatibus et magnis dis parturient mauris.sphinxext-opengraph-0.7.5/tests/roots/test-skip-admonitions/000077500000000000000000000000001435511104100243065ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-skip-admonitions/conf.py000066400000000000000000000002371435511104100256070ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-skip-admonitions/index.rst000066400000000000000000000005031435511104100261450ustar00rootroot00000000000000.. attention:: This is a attention. .. caution:: This is a caution. .. danger:: This is a danger. .. error:: This is a error. .. important:: This is a important. .. note:: This is a note. .. tip:: This is a tip. .. hint:: This is a hint. .. warning:: This is a warning. .. admonition:: This is a admonition. This is text.sphinxext-opengraph-0.7.5/tests/roots/test-skip-code-block/000077500000000000000000000000001435511104100237645ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-skip-code-block/conf.py000066400000000000000000000002741435511104100252660ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_description_length = 100 sphinxext-opengraph-0.7.5/tests/roots/test-skip-code-block/index.rst000066400000000000000000000002031435511104100256200ustar00rootroot00000000000000This text should be included. .. code-block:: html

This text should be skipped.

This text should also be included. sphinxext-opengraph-0.7.5/tests/roots/test-skip-comments/000077500000000000000000000000001435511104100236075ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-skip-comments/conf.py000066400000000000000000000002371435511104100251100ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-skip-comments/index.rst000066400000000000000000000001011435511104100254400ustar00rootroot00000000000000.. This is a comment. This is still a comment. This is text. sphinxext-opengraph-0.7.5/tests/roots/test-skip-raw/000077500000000000000000000000001435511104100225535ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-skip-raw/conf.py000066400000000000000000000002741435511104100240550ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_description_length = 100 sphinxext-opengraph-0.7.5/tests/roots/test-skip-raw/index.rst000066400000000000000000000001741435511104100244160ustar00rootroot00000000000000This text should be included. .. raw:: html

This text should be skipped.

This text should also be included. sphinxext-opengraph-0.7.5/tests/roots/test-skip-title/000077500000000000000000000000001435511104100231035ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-skip-title/conf.py000066400000000000000000000002371435511104100244040ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" sphinxext-opengraph-0.7.5/tests/roots/test-skip-title/index.rst000066400000000000000000000001201435511104100247350ustar00rootroot00000000000000A Title ======= Example text. Another Title ============= More example text. sphinxext-opengraph-0.7.5/tests/roots/test-type/000077500000000000000000000000001435511104100217775ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/roots/test-type/conf.py000066400000000000000000000002641435511104100233000ustar00rootroot00000000000000extensions = ["sphinxext.opengraph"] master_doc = "index" exclude_patterns = ["_build"] html_theme = "basic" ogp_site_url = "http://example.org/en/latest/" ogp_type = "article" sphinxext-opengraph-0.7.5/tests/roots/test-type/index.rst000066400000000000000000000000001435511104100236260ustar00rootroot00000000000000sphinxext-opengraph-0.7.5/tests/test_options.py000066400000000000000000000234531435511104100220060ustar00rootroot00000000000000import pytest from sphinx.application import Sphinx import conftest def get_tag(tags, tag_type): return [tag for tag in tags if tag.get("property") == f"og:{tag_type}"][0] def get_tag_content(tags, tag_type): # Gets the content of a specific ogp tag return get_tag(tags, tag_type).get("content", "") def get_meta_description(tags): return [tag for tag in tags if tag.get("name") == "description"][0].get( "content", "" ) @pytest.mark.sphinx("html", testroot="simple") def test_simple(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert len(og_meta_tags) > 0 assert get_tag_content(og_meta_tags, "type") == "website" assert len(description) == 200 assert ( description == "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at lorem ornare, fringilla massa nec, venenatis mi. Donec erat sapien, tincidunt nec rhoncus nec, scelerisque id diam. Orci vari..." ) @pytest.mark.sphinx("html", testroot="meta-name-description") def test_meta_name_description(meta_tags): og_description = get_tag_content(meta_tags, "description") description = get_meta_description(meta_tags) assert description == og_description @pytest.mark.sphinx("html", testroot="meta-name-description-manual-description") def test_meta_name_description(meta_tags): og_description = get_tag_content(meta_tags, "description") description = get_meta_description(meta_tags) assert description != og_description assert description == "My manual description" @pytest.mark.sphinx("html", testroot="meta-name-description-manual-og-description") def test_meta_name_description(meta_tags): og_description = get_tag_content(meta_tags, "description") description = get_meta_description(meta_tags) assert og_description != description assert og_description == "My manual og:description" @pytest.mark.sphinx("html", testroot="simple") def test_site_url(og_meta_tags): # Uses the same directory as simple, because it already contains url for a minimal config assert ( get_tag_content(og_meta_tags, "url") == "http://example.org/en/latest/index.html" ) @pytest.mark.sphinx("dirhtml", testroot="simple") def test_dirhtml_url(og_meta_tags): assert get_tag_content(og_meta_tags, "url") == "http://example.org/en/latest/" @pytest.mark.sphinx("html", testroot="image") def test_image(og_meta_tags): assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/image.png" ) @pytest.mark.sphinx("html", testroot="local-image") def test_local_image(og_meta_tags): assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/_static/sample.jpg" ) @pytest.mark.sphinx("html", testroot="image") def test_image_alt(og_meta_tags): assert get_tag_content(og_meta_tags, "image:alt") == "Example's Docs!" @pytest.mark.sphinx("html", testroot="type") def test_type(og_meta_tags): assert get_tag_content(og_meta_tags, "type") == "article" @pytest.mark.sphinx("html", testroot="description-length") def test_description_length(og_meta_tags): assert len(get_tag_content(og_meta_tags, "description")) == 50 @pytest.mark.sphinx("html", testroot="sitename") def test_site_name(og_meta_tags): assert get_tag_content(og_meta_tags, "site_name") == "Example's Docs!" @pytest.mark.sphinx("html", testroot="sitename-from-project") def test_site_name_project(og_meta_tags): assert get_tag_content(og_meta_tags, "site_name") == "Project name" @pytest.mark.sphinx("html", testroot="first-image") def test_first_image(og_meta_tags): assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/image2.png" ) assert get_tag_content(og_meta_tags, "image:alt") == "Test image alt text" @pytest.mark.sphinx("html", testroot="first-image-no-image") def test_first_image_no_image(og_meta_tags): assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/image33.png" ) assert get_tag_content(og_meta_tags, "image:alt") == "TEST" @pytest.mark.sphinx("html", testroot="image-rel-paths") def test_image_rel_paths(og_meta_tags, og_meta_tags_sub): assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/_images/sample.jpg" ) assert ( get_tag_content(og_meta_tags_sub, "image") == "http://example.org/en/latest/_images/sample.jpg" ) @pytest.mark.sphinx("html", testroot="skip-admonitions") def test_skip_admonitions(og_meta_tags): assert get_tag_content(og_meta_tags, "description") == "This is text." @pytest.mark.sphinx("html", testroot="skip-title") def test_skip_first_title(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert "A Title" not in description assert "Another Title" in description @pytest.mark.sphinx("html", testroot="skip-title") def test_skip_title_punctuation(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert "Another Title:" in description @pytest.mark.sphinx("html", testroot="double-spacing") def test_remove_double_spacing(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert " " not in description @pytest.mark.sphinx("html", testroot="list") def test_list_punctuation(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert description == "Item 1, Item 2, Item 3, Item 4." @pytest.mark.sphinx("html", testroot="nested-lists") def test_nested_list_punctuation(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert ( description == "Item 1, Item 2- Nested Item 1, Nested Item 2., Item 3, Item 4." ) @pytest.mark.sphinx("html", testroot="skip-comments") def test_skip_comments(og_meta_tags): assert get_tag_content(og_meta_tags, "description") == "This is text." @pytest.mark.sphinx("html", testroot="custom-tags") def test_custom_tags(og_meta_tags): assert get_tag_content(og_meta_tags, "ignore_canonical") == "true" @pytest.mark.sphinx("html", testroot="skip-raw") def test_skip_raw(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert "

" not in description assert ( description == "This text should be included. This text should also be included." ) @pytest.mark.sphinx("html", testroot="skip-code-block") def test_skip_code_block(og_meta_tags): description = get_tag_content(og_meta_tags, "description") assert "

" not in description assert ( description == "This text should be included. This text should also be included." ) @pytest.mark.sphinx("html", testroot="quotation-marks") def test_quotation_marks(og_meta_tags): # If smart quotes are disabled and the quotes aren't properly escaped, bs4 will fail to parse the tag and the content will be a empty string description = get_tag_content(og_meta_tags, "description") assert ( description == '"This text should appear in escaped quotation marks" This text should still appear as well "while this is once again in quotations"' ) @pytest.mark.sphinx("html", testroot="overrides-simple") def test_overrides_simple(og_meta_tags): assert get_tag_content(og_meta_tags, "description") == "Overridden description" assert get_tag_content(og_meta_tags, "title") == "Overridden Title" assert get_tag_content(og_meta_tags, "type") == "article" assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/overridden-image.png" ) # Make sure alt text still works even when overriding the image assert get_tag_content(og_meta_tags, "image:alt") == "Example's Docs!" @pytest.mark.sphinx("html", testroot="overrides-complex") def test_overrides_complex(og_meta_tags): assert len(get_tag_content(og_meta_tags, "description")) == 10 assert ( get_tag_content(og_meta_tags, "image") == "http://example.org/en/latest/img/sample.jpg" ) assert get_tag_content(og_meta_tags, "image:alt") == "Overridden Alt Text" @pytest.mark.sphinx("html", testroot="arbitrary-tags") def test_arbitrary_tags(og_meta_tags): assert ( get_tag_content(og_meta_tags, "video") == "http://example.org/en/latest/video.mp4" ) assert get_tag_content(og_meta_tags, "video:type") == "video/mp4" # use same as simple, as configuration is identical to overriden @pytest.mark.sphinx("html", testroot="simple") def test_rtd_override(app: Sphinx, monkeypatch): monkeypatch.setenv("READTHEDOCS", "True") app.config.html_baseurl = "https://failure.com/en/latest/" app.build() tags = conftest._og_meta_tags(app) assert get_tag_content(tags, "url") == "http://example.org/en/latest/index.html" @pytest.mark.sphinx("html", testroot="rtd-default") def test_rtd_valid(app: Sphinx, monkeypatch): monkeypatch.setenv("READTHEDOCS", "True") app.config.html_baseurl = "https://failure.com/en/latest/" app.build() tags = conftest._og_meta_tags(app) assert get_tag_content(tags, "url") == "https://failure.com/en/latest/index.html" # use rtd-default, as we are not changing configuration, but RTD variables @pytest.mark.sphinx("html", testroot="rtd-invalid") def test_rtd_invalid(app: Sphinx, monkeypatch): monkeypatch.setenv("READTHEDOCS", "True") app.config.html_baseurl = None with pytest.raises(Exception): app.build() # Test no breakage with no configuration @pytest.mark.sphinx("html", testroot="rtd-default") def test_no_configuration_html(og_meta_tags): assert get_tag_content(og_meta_tags, "type") == "website" # Test no breakage with no configuration @pytest.mark.sphinx("dirhtml", testroot="rtd-default") def test_no_configuration_dirhtml(og_meta_tags): assert get_tag_content(og_meta_tags, "type") == "website"