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

Don't display hidden cells #123

Open
sschmidhuber opened this issue Jul 19, 2023 · 5 comments
Open

Don't display hidden cells #123

sschmidhuber opened this issue Jul 19, 2023 · 5 comments

Comments

@sschmidhuber
Copy link

Hello,
first of all, thank you for this great package.

To use Pluto and PlutoUI beyond the scope of education it would be great to if there is an option not to display hidden cells at all, currently they are shown as white space.
Here a random example outlining the issue:
grafik

The resulting reports / dashboards would look much better if hidden cells are not displayed at all.

BR Stefan

@jevalentini
Copy link

I guess, while there's no solution to this, you can mess with the html with the package HypertextLiteral. After running the cell, you'll need to right click inspect and erase the style tag to have it back to edit it though.

begin
  using HypertextLiteral
  
  @htl("""
  <script>
   var cell = currentScript.closest("pluto-cell")
   cell.style.display = "none"
  </script>
  """)
end
2023-07-20.19-12-29.mp4

@sschmidhuber
Copy link
Author

Hello @jevalentini ,
sure as a workaround this would be fine, but I was hoping this could become a default (in case there is no use case for having the white space, maybe I missing something) or get a flag, triggering this behavior, on PlutoSliderServer startup.

However, I understand that's probably not the most urgent issue / feature request 😉

@fonsp
Copy link
Member

fonsp commented Apr 24, 2024

Hey! Sorry for replying a year late!

Why don't you move the hidden cells to the bottom?

One problem I can see with hiding folded-and-empty cells is that some notebooks use empty cells on purpose, to create spacing between parts of the notebook.

@sschmidhuber
Copy link
Author

Hello,
yes that is a feasible workaround, which I applied myself as well. However, it makes changes and maintenance much harder, because you need to search the respective cells somewhere at the bottom of your notebook. Also for a non-technical reader of a notebook, it looks quite weird to have so much empty space at the bottom for no obvious reason.

I thought it could be an option to hide the input part of a folded cell, which would also be stored to the notebook. So when it is opened, it opens in "hide folded mode".

Creating vertical space in a notebook, while having "hide folded mode" active could be achieved by something like @htl"<br/><br/>".

@disberd
Copy link
Member

disberd commented Sep 2, 2024

Hey @sschmidhuber,

If you use a Table of Contents (or are fine with using one) for your notebooks you can check out this exteded ToC from my package PlutoExtras:
https://disberd.github.io/PlutoExtras.jl/dev/toc/#Extended-ToC

It is based on the PlutoUI one but add some additional features which include easily hiding sections of the notebook so that cells are completely hidden as you are asking.

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

No branches or pull requests

4 participants