diff --git a/.gitignore b/.gitignore index 8a566da..0dca42a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ docs/_build *.ipynb_checkpoints docs/contributing.md .vscode/ +docs/gallery.txt \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 4290ac0..091caa5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,6 +31,7 @@ # ablog configuration import ablog + fontawesome_included = True blog_path = "updates" blog_title = "EBP Updates" @@ -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") \ No newline at end of file + app.add_css_file("custom.css") diff --git a/docs/examples.md b/docs/examples.md deleted file mode 100644 index 64ee885..0000000 --- a/docs/examples.md +++ /dev/null @@ -1,18 +0,0 @@ -# Examples - -Below are examples of books that have been generated with the EBP toolchain. - -```{panels} -:card: shadow -:header: text-center -:body: text-center -[The Jupyter Book documentation](https://jupyterbook.org) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -![](https://jupyterbook.org/_static/logo.png) - ---- -[QuantEcon](https://executablebooks.github.io/quantecon-example/docs/index.html) -^^^^^^^^^ -![](https://executablebooks.github.io/quantecon-example/_static/qe-logo-large.png) - -``` diff --git a/docs/gallery.md b/docs/gallery.md new file mode 100644 index 0000000..305e0a0 --- /dev/null +++ b/docs/gallery.md @@ -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 +``` diff --git a/docs/gallery.yml b/docs/gallery.yml new file mode 100644 index 0000000..08a334d --- /dev/null +++ b/docs/gallery.yml @@ -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: \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 0d7ebbe..e68368d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -77,5 +77,5 @@ developer.md team.md updates.md feature-vote.md -examples.md +gallery.md ``` diff --git a/docs/team_panels_code.txt b/docs/team_panels_code.txt index 6ebc0f7..3b486da 100644 --- a/docs/team_panels_code.txt +++ b/docs/team_panels_code.txt @@ -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)