Skip to content

Commit

Permalink
update theme (Lightning-Universe#43)
Browse files Browse the repository at this point in the history
* updating theme

* updated styles
  • Loading branch information
williamFalcon authored and Borda committed Mar 30, 2022
1 parent b5843ca commit c25d30f
Show file tree
Hide file tree
Showing 13 changed files with 8,641 additions and 4,830 deletions.
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@
"devDependencies": {
"anchor-js": "^4.3.0",
"autoprefixer": "^9.8.6",
"bootstrap": "4.0.0",
"bootstrap": "^4.6.1",
"browserify": "^13.0.0",
"connect-livereload": "~0.6.0",
"grunt": "~1.0.1",
"grunt": "^1.4.1",
"grunt-banner": "^0.6.0",
"grunt-browserify": "^5.0.0",
"grunt-browserify": "^6.0.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-sass": "~1.0.0",
"grunt-contrib-uglify": "~3.3.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-exec": "~1.0.1",
"grunt-open": "0.2.3",
"grunt-open": "^0.2.4",
"grunt-postcss": "^0.9.0",
"matchdep": "~1.0.1",
"matchdep": "^2.0.0",
"popper.js": "^1.14.3"
},
"dependencies": {
"grunt-contrib-sass": "^2.0.0",
"grunt-sass": "^3.1.0",
"node-sass": "^7.0.1"
}
}
51 changes: 32 additions & 19 deletions pt_lightning_sphinx_theme/extensions/pytorch_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ def run(self):
.. raw:: html
<div class="col-md-12 tutorials-card-container" data-tags={tags}>
<div class="card tutorials-card">
<a href="{link}">
<div class="card-body">
<div class="card-title-container">
<h4>{header} {beta}</h4>
</div>
<p class="card-summary">{card_description}</p>
<p class="tags">{tags}</p>
<div class="tutorials-image">{image}</div>
</div>
</a>
</div>
<div class="card tutorials-card">
<a href="{link}">
<div class="card-body">
<div class="card-title-container">
<h4>{header} {beta}</h4>
</div>
<p class="card-summary">{card_description}</p>
<p class="tags">{tags}</p>
<div class="tutorials-image">{image}</div>
</div>
</a>
</div>
</div>
"""

Expand All @@ -131,6 +131,8 @@ class CustomCalloutItemDirective(Directive):
"description": directives.unchanged,
"button_link": directives.unchanged,
"button_text": directives.unchanged,
"col_css": directives.unchanged,
"card_style": directives.unchanged,
}

def run(self):
Expand All @@ -154,6 +156,16 @@ def run(self):
button_text = self.options["button_text"]
else:
button_text = ""

if "col_css" in self.options:
col_css = self.options["col_css"]
else:
col_css = "col-md-6"

if "card_style" in self.options:
card_style = self.options["card_style"]
else:
card_style = "text-container"

except FileNotFoundError as e:
print(e)
Expand All @@ -164,7 +176,7 @@ def run(self):
return []

callout_rst = CALLOUT_TEMPLATE.format(
description=description, header=header, button_link=button_link, button_text=button_text
description=description, header=header, button_link=button_link, button_text=button_text, col_css=col_css, card_style=card_style
)
callout_list = StringList(callout_rst.split("\n"))
callout = nodes.paragraph()
Expand All @@ -175,11 +187,12 @@ def run(self):
CALLOUT_TEMPLATE = """
.. raw:: html
<div class="col-md-6">
<div class="text-container">
<h3>{header}</h3>
<p class="body-paragraph">{description}</p>
<a class="btn with-right-arrow callout-button" href="{button_link}">{button_text}</a>
</div>
<div class="{col_css}">
<a href="{button_link}">
<div class="{card_style}">
<h3>{header}</h3>
<p class="body-paragraph">{description}</p>
</div>
</a>
</div>
"""
Loading

0 comments on commit c25d30f

Please sign in to comment.