-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add theme options for cheatsheet (#346)
Co-authored-by: Jorge Martínez <[email protected]> Co-authored-by: Kerry McAdams <[email protected]> Co-authored-by: Kathy Pippert <[email protected]>
- Loading branch information
1 parent
360711d
commit b842223
Showing
8 changed files
with
210 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ link_code_library | |
link_code_source | ||
link_code_branch | ||
html_context | ||
HTML | ||
(?!)HTML | ||
CSS | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/cheatsheet_sidebar.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% if theme_cheatsheet %} | ||
{% set theme_cheatsheet_title = theme_cheatsheet.get('title', 'Cheatsheet') %} | ||
<div class="sidebar-cheatsheets"> | ||
<h4>{{ theme_cheatsheet_title }}</h4> | ||
{% if theme_cheatsheet.get('needs_download') == true %} | ||
{% set static_path = cheatsheet_static_path + '/' | default('') %} | ||
{% set theme_cheatsheet_url = theme_cheatsheet.get('url').split('/')[-1] %} | ||
{% set theme_cheatsheet_thumbnail = theme_cheatsheet.get('thumbnail').split('/')[-1] %} | ||
{% set theme_cheatsheet_thumbnail = pathto(static_path ~ theme_cheatsheet_thumbnail, 1) %} | ||
{% set theme_cheatsheet_url = pathto(static_path ~ theme_cheatsheet_url, 1) %} | ||
{% else %} | ||
{% set theme_cheatsheet_url = theme_cheatsheet.get('url') %} | ||
{% set theme_cheatsheet_thumbnail = theme_cheatsheet.get('thumbnail') %} | ||
{% endif %} | ||
<a href="{{ theme_cheatsheet_url }}"> | ||
<img src="{{ theme_cheatsheet_thumbnail }}" alt="{{ theme_cheatsheet_title }}" /> | ||
</a> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters