arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
715 stars 123 forks source link

Add static docs #182

Closed arnaudmiribel closed 10 months ago

arnaudmiribel commented 11 months ago

Summary

Solves https://github.com/arnaudmiribel/streamlit-extras/issues/173

Our gallery is down sometimes, it'd be great to have a static docs backup at least, or maybe even turn that into the default. This PR introduces new static docs [preview] based off material-mkdocs

image image

Content

  1. General config for mkdocs-material. Includes a set of plugins to easily annotate docstrings or highlight, color code blocks
  2. A GitHub action to make it possible to publish and update docs after every PR
  3. A workflow to publish preview docs into Netlify
  4. A few edits of our extras docstrings so they can be parsed properly with mkdocstrings
  5. Embedded stlite iframes
  6. Auto-resize of those iframes

How does mkdocs work?

Locally

  1. Install docs requirements

    pip install -r docs/requirements.txt
  2. Now serve the docs! It should load in http://127.0.0.1:8000

    mkdocs serve

Publishing

With the following command (use with caution), the docs will get published at https://arnaudmiribel.github.io/streamlit-extras/ - automatically building in the gh-deploy branch and reading from there, which is the default GitHub pages looks into.

mkdocs gh-deploy --force
blackary commented 11 months ago

You should indeed add that you need to do pip install -r docs/requirements.txt, because otherwise mkdocs serve fails, even after pip installing mkdocs -- it apparently doesn't auto-install extensions

netlify[bot] commented 10 months ago

Deploy Preview for phenomenal-crepe-0effec ready!

Name Link
Latest commit 2b5b9b174924133a880b4a0581addb4eb20af652
Latest deploy log https://app.netlify.com/sites/phenomenal-crepe-0effec/deploys/6526ad1fe56ecb0008d05ebc
Deploy Preview https://deploy-preview-182--phenomenal-crepe-0effec.netlify.app/extras/camera_input_live
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.