-
Notifications
You must be signed in to change notification settings - Fork 146
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] Add py.cafe to the docs examples #569
Conversation
for more information, see https://pre-commit.ci
This is fantastic: the future is here! I would definitely like to see the code included, and the idea of single source code sounds best of course. Looking forward to seeing this progress 🚀 |
@maxschulz-COL Now I've returned, do you want me to pick this up in the coming sprint? |
Yes that would be amazing! I have a few new ideas here - so we should probably sync mid-week to get this done. But definitely worthwhile scheduling some time in this sprint |
for more information, see https://pre-commit.ci
…izro into docs/pycafe_embedding
What does not work as expected? |
You're keeping tabs on us :) It's the issue with annotations in the code. Let me link you to the thread... |
I couldn't find it so I've recreated it here. We use annotations in some of our code snippets. This page is a good example: https://vizro.readthedocs.io/en/stable/pages/user-guides/data and here's a screenshot: But when the plugin is activated for pycafe, this doesnt work and the comments render as specified: @maxschulz-COL has investigated but we haven't put too much time in as most of our examples look fine without the annotation (and the data manager examples don't use py.cafe at present for another, different reason). But what do you think? Any ideas on how to enable the mkdocs annotation plus pycafe plugin together? |
I raised an issue in the repo: py-cafe/mkdocs-pycafe#3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Pre-approval assuming we come up with some conclusion on the code annotations. Have a general question whether we should actually store the py.cafe doc examples in a vizro py.cafe profile, as otherwise we'll have a collection of examples living in several profiles. Might be better to have one profile to which everyone has access to and can edit it 👍
I think that is a great idea - could we even create one with our vizro email? |
Yes, that was what I was thinking :) Use our vizro service account email 👍 |
Co-authored-by: Li Nguyen <[email protected]>
…izro into docs/pycafe_embedding
See my comment here. It's a great idea but too late for implementation (by me) this time. Can we do this when we next update example code? |
Code annotations should work now: py-cafe/mkdocs-pycafe#5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot approve my own PR, but just wanted to say: Absolutely amazing rework. 🚀 ⭐ 🙏
I left minor comments that we can also ignore for now, but that can serve as a reminder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving for @maxschulz-COL after final commit on those comments.
Phew, that was a mammoth PR! Thanks @huong-li-nguyen @maartenbreddels and @maxschulz-COL for getting it over the line. Here's the follow up issue and feel free to add anything else I've forgotten! #630 |
READY FOR REVIEW!
Description
There's a PR against the plugin to make the link to py.cafe more visible (bold text, maybe add an icon)
Where images are used in dashboard examples, we need to link to their locations with absolute URLs. We currently have them hard-coded to an
assets
folder but that doesn't work for py.cafe since everything is uploaded to projects in a single root folder. Some of the commentary around the example needs changing to accommodate the new link location too:explore-components.md
I need to replace relative links tocollections.svg
andfeatures.svg
: where are these files?vizro-internal
and added them to this PR so we can use the raw GitHub hosted URLcard-button.md
I need to replace relative links toafrica.svg
andhypotheses.svg
: where are they?assets
folder so I made projects to host these and linked through to them. The assets are stored in GitHub too in case we ever need them again.I don't think it works to put the
iframe
inside the tabbed code block. We could include the embed below perhaps, but I suggest we remove it except for the simplest case in the quickstart dashboard, which is OK.The code links in
figure.md
"How to use figures" are hard to spot because there are some footnotes that come below them. There's possibly a better way to structure these notes, though I appreciate they only apply to the pydantic code so can't be placed below the entire block.In
navigation.md
there are snippets of code in the examples except the first (see here) and I'm wondering if we should add an extra tab to these to share them as complete examples...or leave as an exercise for the reader?snippet.py
and addedapp.py
for each)I didn't make changes to
assets.md
code snippets because this relies on having access to theassets
folder which doesn't work on py.cafe.Same for
data.md
which loadsiris.csv
but this I resolved this by generating the data aspx.data.iris()
Chain actions example on
actions.md
doesn't work here -- error inpy.cafe
:ModuleNotFoundError: You must install either openpyxl or xlsxwriter to export to xlsx format.
The above error also occurs in the first example in
custom_actions.md
In
custom_components.md
there are line number highlights and expanders in the code example, see here which don't work with the mkdocs plugin. @maxschulz-COL is going to take a look at this one.In
custom_components.md
there is an image needed for the carousel hereFinal example on
custom_figures
doesn't look like the screenshotUpdates needed for screenshots:
pages.md
is now blue throughout -- no red colourOriginal POC description
This is a first POC of how we could integrate py.cafe into the docs. Atm the PR just contains two implementation version, but there will be more added later on:Other future options will be:
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":