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

Make template gallery #499

Merged
merged 39 commits into from Feb 16, 2020
Merged
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
08af336
add template file
mariaschuld Jan 30, 2020
f750ac4
Merge branch 'master' of github.com:XanaduAI/pennylane
mariaschuld Jan 30, 2020
e120d80
Merge branch 'master' of github.com:XanaduAI/pennylane
mariaschuld Feb 5, 2020
3c470ce
design gallery
mariaschuld Feb 5, 2020
3862ff6
use custom directive and add more pics
mariaschuld Feb 6, 2020
c3b3bc8
add overview links
mariaschuld Feb 6, 2020
dbc2955
remove unnecessary files
mariaschuld Feb 6, 2020
6ea7c0f
delete a <div>
mariaschuld Feb 6, 2020
183f518
Merge branch 'master' into make_template_gallery
mariaschuld Feb 6, 2020
01c731f
Merge branch 'master' of github.com:XanaduAI/pennylane
mariaschuld Feb 6, 2020
b9e2026
add sphinx_gallery to requirements
mariaschuld Feb 6, 2020
75a4f07
Merge branch 'make_template_gallery' of github.com:XanaduAI/pennylane…
mariaschuld Feb 6, 2020
8385dfc
fix css clashes
josh146 Feb 6, 2020
66dc128
remove sphinx gallery
josh146 Feb 6, 2020
204fac7
Merge branch 'master' into make_template_gallery
antalszava Feb 7, 2020
0ba8536
Merge branch 'master' into make_template_gallery
co9olguy Feb 7, 2020
2255460
Merge branch 'master' into make_template_gallery
antalszava Feb 7, 2020
d9edb9e
Merge branch 'master' into make_template_gallery
josh146 Feb 7, 2020
fcd89d4
Merge branch 'master' of github.com:XanaduAI/pennylane
mariaschuld Feb 10, 2020
f683c99
Merge branch 'master' into make_template_gallery
mariaschuld Feb 10, 2020
38ef542
delete commented out lines
mariaschuld Feb 10, 2020
961be7a
add item to changelog
mariaschuld Feb 10, 2020
10df45d
remove tooltip
mariaschuld Feb 10, 2020
9a00945
Update doc/introduction/templates.rst
mariaschuld Feb 10, 2020
3353bc0
Update doc/_static/xanadu_gallery.css
mariaschuld Feb 10, 2020
a4aebce
fix merge conflict
mariaschuld Feb 10, 2020
10f6c1b
Merge branch 'make_template_gallery' of github.com:XanaduAI/pennylane…
mariaschuld Feb 10, 2020
9e261cc
polish text
mariaschuld Feb 10, 2020
c82fef4
make gallery items bigger
mariaschuld Feb 10, 2020
2b0226c
fix path problem
mariaschuld Feb 10, 2020
465feb7
revert some unecessary changes
mariaschuld Feb 10, 2020
671192c
fix CSS and directives
josh146 Feb 10, 2020
43b6276
use cards for gallery
mariaschuld Feb 10, 2020
a1e939c
make cards look nice
mariaschuld Feb 10, 2020
d6f13ac
fix conflict
mariaschuld Feb 10, 2020
e62ffa8
Merge branch 'master' into make_template_gallery
josh146 Feb 13, 2020
9ef87a8
fix size problem
mariaschuld Feb 14, 2020
712b05b
Merge branch 'make_template_gallery' of github.com:XanaduAI/pennylane…
mariaschuld Feb 14, 2020
d41f18c
Merge branch 'master' into make_template_gallery
josh146 Feb 16, 2020
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
11 changes: 2 additions & 9 deletions doc/directives.py
Expand Up @@ -57,9 +57,9 @@ def run(self):
GALLERY_TEMPLATE = """
.. raw:: html

<div class="card" style="width: 13rem; float:left; margin: 10px">
<div class="card" style="width: 13rem; float:left; margin: 10px;">
<a href={link}>
<img class="card-img-top" src={thumbnail} alt="image not found">
<img class="card-img-top" src={thumbnail} alt="image not found" style="width: 13rem; height: 6rem;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

<div class="card-body">
<p class="card-text"> {description} </p>
</div>
Expand Down Expand Up @@ -89,7 +89,6 @@ class CustomGalleryItemDirective(Directive):
final_argument_whitespace = True
option_spec = {'figure': directives.unchanged,
'description': directives.unchanged,
'width': directives.unchanged,
'link': directives.unchanged}

has_content = False
Expand All @@ -107,11 +106,6 @@ def run(self):
else:
raise ValueError('description not found')

if 'width' in self.options:
width = self.options['width']
else:
width = "18rem"

if 'link' in self.options:
link = self.options['link']
else:
Expand All @@ -127,7 +121,6 @@ def run(self):

thumbnail_rst = GALLERY_TEMPLATE.format(thumbnail=thumbnail,
description=description,
width=width,
link=link)
thumbnail = StringList(thumbnail_rst.split('\n'))
thumb = nodes.paragraph()
Expand Down