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: link to execute JupyterLite full screen #2854

Merged
merged 6 commits into from
Nov 30, 2023
Merged

Conversation

zonca
Copy link
Collaborator

@zonca zonca commented Nov 29, 2023

I could not find a way to run JupyterLite at https://awkward-array.org/doc/main/getting-started/try-awkward-array.html#try-it full screen, if not it is too small to execute comfortably in my opinion.

Following https://jupyterlite-sphinx.readthedocs.io/en/latest/full.html, I think the easiest way is to provide a link to https://awkward-array.org/doc/main/lite/retro/notebooks/?path=what-is-an-awkward-array.ipynb

@zonca zonca changed the title docs: link to execute notebook full screen Link to execute JupyterLite full screen Nov 29, 2023
@zonca zonca changed the title Link to execute JupyterLite full screen docs: link to execute JupyterLite full screen Nov 29, 2023
@jpivarski
Copy link
Member

I'd be in favor of that. I've been wondering if we can eliminate the third column (table of contents for the current page) because it's irrelevant for this page. In general, the problem is that the whole JupyterLite environment is fitting within an area designed for text, but this page should be exceptional.

If you find a way to add a full-screen button, that's great! If you take another approach and make this page custom, maybe by defining a new HTML layout for it and having that layout apply only to this page somehow, that would be another way to do it. @agoose77 is the author and already-but-soon-to-be-even-more expert in JupyterBook, so he might have some suggestions and opinions.

It's valuable for the JupyterLite element to not (always) be the entire page, since a user/reader of documentation will want to navigate to other parts of the documentation.

This "Try it!" page differs from NumPy's (https://numpy.org/, scroll down) so that it can guide the user with an example. But that means that there's no place for generic exploration, as NumPy has. But as you can see, NumPy's has less JupyterLite decoration around the edges, at the expense of not having cells that interleave input and output.

@agoose77
Copy link
Collaborator

agoose77 commented Nov 29, 2023

Hi @zonca, thanks for opening this PR!

There is a UI option to open the JupyterLab environment:
image

Or "zen-mode" fullscreen:
image

However, it's not self-evident (I had to hunt around for this myself the other day). Another approach to making this full-screen is to use a commandlink button in the notebook that enters "zen mode":

<center>
<button data-commandLinker-command="application:toggle-zen" href="#">Go fullscreen! <i class="fa-solid fa-expand"></i></button>
</center>

If you create a Markdown cell at the top of the notebook and run this, what do you think?
image

@zonca zonca marked this pull request as draft November 30, 2023 03:17
@zonca
Copy link
Collaborator Author

zonca commented Nov 30, 2023

I agree those are hard to find, I think the button at the top of the notebook is best,
I'll test and mark PR ready when it looks good.

@zonca zonca marked this pull request as ready for review November 30, 2023 06:23
@zonca
Copy link
Collaborator Author

zonca commented Nov 30, 2023

ok @agoose77 I named it "Toggle" and I removed the icon because the icon only works within sphinx, if someone downloads the notebook or does "Open JupyterLab", the icon breaks.

http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/jupyterlite_fullscreen/getting-started/try-awkward-array.html

@zonca zonca requested a review from agoose77 November 30, 2023 06:25
@agoose77
Copy link
Collaborator

I don't think we need to worry about the icon breaking if someone downloads the notebook; the notebook as-is only works in pyodide due to the use of piplite. With that in mind, could we restore the icon? I think it helps confer the purpose of the button.

@agoose77 agoose77 enabled auto-merge (squash) November 30, 2023 10:14
@agoose77
Copy link
Collaborator

Thanks @zonca! This is a useful change :)

@agoose77 agoose77 merged commit 7f69758 into main Nov 30, 2023
18 checks passed
@agoose77 agoose77 deleted the jupyterlite_fullscreen branch November 30, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants