Unverified Commit a4d8a4ea authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Update readme and index page (#4642)

parent a1621236
This diff is collapsed.
...@@ -47,7 +47,7 @@ CARD_TEMPLATE_LINK = """ ...@@ -47,7 +47,7 @@ CARD_TEMPLATE_LINK = """
.. raw:: html .. raw:: html
<div class="codesnippet-card-link"> <div class="codesnippet-card-link">
For a full tutorial, please go here. {seemore}
<span class="material-icons right">arrow_forward</span> <span class="material-icons right">arrow_forward</span>
</div> </div>
""" """
...@@ -58,6 +58,7 @@ class CodeSnippetCardDirective(Directive): ...@@ -58,6 +58,7 @@ class CodeSnippetCardDirective(Directive):
'icon': directives.unchanged, 'icon': directives.unchanged,
'title': directives.unchanged, 'title': directives.unchanged,
'link': directives.unchanged, 'link': directives.unchanged,
'seemore': directives.unchanged,
} }
has_content = True has_content = True
...@@ -69,6 +70,7 @@ class CodeSnippetCardDirective(Directive): ...@@ -69,6 +70,7 @@ class CodeSnippetCardDirective(Directive):
title = self.options['title'] title = self.options['title']
link = directives.uri(self.options['link']) link = directives.uri(self.options['link'])
icon = directives.uri(self.options['icon']) icon = directives.uri(self.options['icon'])
seemore = self.options.get('seemore', 'For a full tutorial, please go here.')
except ValueError as e: except ValueError as e:
print(e) print(e)
raise raise
...@@ -96,7 +98,7 @@ class CodeSnippetCardDirective(Directive): ...@@ -96,7 +98,7 @@ class CodeSnippetCardDirective(Directive):
refwarn=True, refwarn=True,
refkeepformat=True) refkeepformat=True)
# refkeepformat is handled in `patch_autodoc.py` # refkeepformat is handled in `patch_autodoc.py`
self.state.nested_parse(StringList(CARD_TEMPLATE_LINK.split('\n')), self.content_offset, link_node) self.state.nested_parse(StringList(CARD_TEMPLATE_LINK.format(seemore=seemore).split('\n')), self.content_offset, link_node)
anchor_node += link_node anchor_node += link_node
# close footer # close footer
......
This diff is collapsed.
.. 1d789e3c2bde22f1392654fde31a688a .. 7f1c1f76edfd4524c037b283d7520561
########################### ###########################
Neural Network Intelligence Neural Network Intelligence
......
...@@ -80,6 +80,12 @@ nav.md-tabs .md-tabs__item:not(:last-child) .md-tabs__link:after { ...@@ -80,6 +80,12 @@ nav.md-tabs .md-tabs__item:not(:last-child) .md-tabs__link:after {
padding-right: 1em; padding-right: 1em;
} }
/* for release icon, on home page */
.release-icon {
margin-left: 8px;
width: 40px;
}
/* Similar to cardlink, but used in codesnippet in index page. see sphinx_gallery.css */ /* Similar to cardlink, but used in codesnippet in index page. see sphinx_gallery.css */
.codesnippet-card-container { .codesnippet-card-container {
display: flex; display: flex;
...@@ -90,11 +96,16 @@ nav.md-tabs .md-tabs__item:not(:last-child) .md-tabs__link:after { ...@@ -90,11 +96,16 @@ nav.md-tabs .md-tabs__item:not(:last-child) .md-tabs__link:after {
border-left: 0; border-left: 0;
padding: 0; padding: 0;
margin: .5rem 1rem 1rem 0rem; margin: .5rem 1rem 1rem 0rem;
width: 100%;
}
/* Controlling the cards in containers only */
.codesnippet-card-container .codesnippet-card.admonition {
width: 47%; width: 47%;
} }
@media only screen and (max-width:59.9375em) { @media only screen and (max-width:59.9375em) {
.codesnippet-card.admonition { .codesnippet-card-container .codesnippet-card.admonition {
width: 100%; width: 100%;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment