Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] doc gallery: save images as SVG (instead of PNG) #65

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

import pygsp
from sphinx_gallery.scrapers import matplotlib_scraper

extensions = [
'sphinx.ext.viewcode',
Expand Down Expand Up @@ -41,6 +42,14 @@
from pygsp import graphs, filters, utils, plotting
"""

class matplotlib_svg_scraper(object):

def __repr__(self):
return self.__class__.__name__

def __call__(self, *args, **kwargs):
return matplotlib_scraper(*args, format='svg', **kwargs)

extensions.append('sphinx_gallery.gen_gallery')
sphinx_gallery_conf = {
'examples_dirs': '../examples',
Expand All @@ -50,6 +59,7 @@
'backreferences_dir': 'backrefs',
'doc_module': 'pygsp',
'show_memory': True,
'image_scrapers': matplotlib_svg_scraper(),
}

exclude_patterns = ['_build']
Expand Down