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

📚 DOCS: adding a gallery #181

Merged
merged 3 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/_build
*.ipynb_checkpoints
docs/contributing.md
.vscode/
docs/gallery.txt
50 changes: 47 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

# ablog configuration
import ablog

fontawesome_included = True
blog_path = "updates"
blog_title = "EBP Updates"
Expand Down Expand Up @@ -65,14 +66,57 @@
from subprocess import run
from pathlib import Path
import requests
import yaml
from textwrap import dedent

# Update the team page from github membership
run(f"python {Path(__file__).parent.joinpath('update_team.py')}".split())
# Grab the latest contributing docs
url_contributing = "https://raw.githubusercontent.com/executablebooks/.github/master/CONTRIBUTING.md"
url_contributing = (
"https://raw.githubusercontent.com/executablebooks/.github/master/CONTRIBUTING.md"
)
resp = requests.get(url_contributing, allow_redirects=True)
Path('contributing.md').write_bytes(resp.content)
Path("contributing.md").write_bytes(resp.content)

# Build the gallery file
panels_body = []
for item in yaml.safe_load(Path("gallery.yml").read_text()):
if not item.get("image"):
item["image"] = "https://jupyterbook.org/_static/logo.png"

if item["repository"]:
repo_text = f'{{link-badge}}`{item["repository"]},"repository",cls=badge-secondary text-white float-left p-2 mr-1,tooltip={item["name"]}`'
else:
repo_text = ''

panels_body.append(
f"""\
---
:img-top: {item["image"]}

+++
**{item["name"]}**

{{link-badge}}`{item["website"]},"website",cls=badge-secondary text-white float-left p-2 mr-1,tooltip={item["name"]}`
{repo_text}
"""
)
panels_body = "\n".join(panels_body)

panels = f"""
````{{panels}}
:container: full-width
:column: text-center col-6 col-lg-4
:card: +my-2
:img-top-cls: w-75 m-auto p-2
:body: d-none

{dedent(panels_body)}
````
"""

Path("gallery.txt").write_text(panels)


def setup(app):
app.add_css_file("custom.css")
app.add_css_file("custom.css")
18 changes: 0 additions & 18 deletions docs/examples.md

This file was deleted.

7 changes: 7 additions & 0 deletions docs/gallery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Gallery of Jupyter Books

This is a gallery of Jupyter Books built from across the community.
If you'd like to add your book to this list, simply [add an entry to this `gallery.yml` file](https://github.com/executablebooks/meta/edit/master/docs/gallery.yml) and open a Pull Request to add it.

```{include} gallery.txt
```
35 changes: 35 additions & 0 deletions docs/gallery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- name: Algorithms for Automated Driving
image: https://thomasfermi.github.io/Algorithms-for-Automated-Driving/_static/car_sketch_wide.png
website: https://thomasfermi.github.io/Algorithms-for-Automated-Driving/Introduction/intro.html
repository: https://github.com/thomasfermi/Algorithms-for-Automated-Driving
- name: Solving Partial Differential Equations
image: https://aquaulb.github.io/book_solving_pde_mooc/_static/logo.png
website: https://aquaulb.github.io/book_solving_pde_mooc/solving_pde_mooc/notebooks/01_Introduction/01_00_Preface.html
repository: https://github.com/aquaULB/solving_pde_mooc
- name: Quantitative Economics with Python
website: https://executablebooks.github.io/quantecon-example/docs/index.html
repository: https://github.com/executablebooks/quantecon-example
image: https://executablebooks.github.io/quantecon-example/_static/qe-logo-large.png
- name: Intro to Cultural Analytics
website: https://melaniewalsh.github.io/Intro-Cultural-Analytics/welcome.html
repository: https://github.com/melaniewalsh/Intro-Cultural-Analytics
image: https://melaniewalsh.github.io/Intro-Cultural-Analytics/_static/favicon.ico
- name: Computational and Inferential Thinking
website: https://www.inferentialthinking.com
repository: https://github.com/data-8/textbook
image: https://www.inferentialthinking.com/favicon.png
- name: Python Packages
website: https://py-pkgs.org/
repository: https://github.com/UBC-MDS/py-pkgs
image: https://d33wubrfki0l68.cloudfront.net/6b7f66b16d59652f8693c91e7a985e457d841a49/20ff1/_static/py-pkgs-hex.png
- name: Geographic Data Science with Python
website: https://geographicdata.science/book/intro
repository:
image: https://geographicdata.science/book/_static/logo.png
- name: Continuous Time Markov Chains
website: https://jstac.github.io/continuous_time_mcs/intro.html
repository: http://github.com/jstac/continuous_time_mcs
- name: Statistics and Data Science
website: https://cranmer.github.io/stats-ds-book/intro.html
repository: https://github.com/cranmer/stats-ds-book
image:
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ developer.md
team.md
updates.md
feature-vote.md
examples.md
gallery.md
```
5 changes: 5 additions & 0 deletions docs/team_panels_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ card: text-center
[@chrisjsewell](https://github.com/chrisjsewell)
---

![avatar](https://avatars3.githubusercontent.com/u/3275109?v=4)
++++++++++++++
[@hukkinj1](https://github.com/hukkinj1)
---

![avatar](https://avatars0.githubusercontent.com/u/3887684?v=4)
++++++++++++++
[@jstac](https://github.com/jstac)
Expand Down