-
Notifications
You must be signed in to change notification settings - Fork 6
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
Hide runtime info behind <details> #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
=======================================
Coverage 95.78% 95.78%
=======================================
Files 4 4
Lines 285 285
=======================================
Hits 273 273
Misses 12 12 Continue to review full report at Codecov.
|
Is it possible to use the same approach in the notebook output as well? The only unfortunate point, I think, is that it's quite easy to miss this information - not because it's collapsed but mainly because it seems it isn't shown as a heading anymore and just appears after the last sentence or plot. Maybe it would be a bit clearer if this collapsed info appears at the end of the setup section? Alternatively, since I guess it might be difficult to implement this in the pre-process function, maybe have still a separate section in the end of the example and then at the collapsed info in this section? |
I had skipped it for the notebooks because theo had looked into it and said it was buggy (see source code). I think it's sufficiently visible as is - anyone who is looking for it can see it - the point was to make it less visible because for most people most of the time it will just be unnecessary information. |
So the |
docs/literate.jl
Outdated
info_footer = """ | ||
#md # ```@raw html | ||
# <details> | ||
# <summary><h3>Click to expand package and system information</h3></summary> |
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.
I tried out putting a <h3>
inside the <summary>
, but it makes the formatting look weird in the docs.
# <summary><h3>Click to expand package and system information</h3></summary> | |
# <summary><strong>Package and system information (click to expand)</strong></summary> |
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.
@devmotion have you looked at the docs preview with this change?
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.
Yes, I did but it does not address my comments. I think it should be in a separate section, it doesn't belong in the last section of the example and is clearly enough separated visually: #104 (comment)
If the formatting's broken, I'd vote for just not hiding it in the nb |
I don't have a problem with collapsing it - I just don't like that the reduced version is not separated clearly from the rest anymore. Maybe just put it in a separate section in the end, as suggested above? I.e. something like ## Package and system information
```@raw html
<details>
...
</details>
``` |
…es/ApproximateGPs.jl into st/examples_details
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I've managed to fix it: ) @rossviljoen |
…es/ApproximateGPs.jl into st/examples_details
docs/literate.jl
Outdated
|
||
using Literate: Literate | ||
|
||
const MANIFEST_OUT = joinpath(EXAMPLE, "Manifest.toml") | ||
mkpath(joinpath(OUTDIR, EXAMPLE)) | ||
cp(joinpath(EXAMPLEPATH, "Manifest.toml"), joinpath(OUTDIR, MANIFEST_OUT); force=true) | ||
|
||
""" adapted from HttpCommon.jl """ |
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.
to avoid an extra dependency (which at this point every example would have to add) for just for one function
manifest_status = sprint() do io | ||
Pkg.status(; io=io, mode=Pkg.PKGMODE_MANIFEST) | ||
end |
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.
wasn't used anywhere
docs/literate.jl
Outdated
#nb <a href="$(MANIFEST_OUT)">download the full Manifest.toml</a>. | ||
#md [download the full Manifest.toml]($(MANIFEST_OUT)). |
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.
Nbviewer needs the HTML link as it does not parse markdown within HTML.
Documenter treats the markdown-style link slightly differently from the HTML link, and the latter would point to the wrong path.
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.
One weird formatting issue but otherwise lgtm
I'm happy with how it all looks now, and everything is working in both the docs and nbviewer. |
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.
I appreciate your efforts @st-- but unfortunately I don't have anything new to add. It seems @theogf and I would both prefer a separate section with a heading and some collapsed details. I am convinced this improves discoverability and helps those interested in such information while keeping the distraction and amount of additional information for those not interested minimal. I made inline suggestions that you should be able to accept without additional manual changes.
* Fix file size of notebook * Fix format Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Change comment Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* CompatHelper: bump compat for "GPLikelihoods" to "0.3" * Reorder Gamma parametrization * Update project versions * Missing one Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Théo Galy-Fajou <[email protected]>
* Fix outdated `literate.jl` script * Fix format
* stab at submodules * move approx_lml to API * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * clean up imports * remove unused imports * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docfix * missing import * test: remove submodules from api docs * subpages in docs * hide private API docstrings * mention types in api/index.md * qualify * remove extra line * minor bump# * change docs/ compat * update test compat * explicitly `@reexport` to avoid exporting the submodules! * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add likelihood imports * add import * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * add import * Update src/SparseVariationalApproximationModule.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…eGPs.jl into st/examples_details
Was it decided in a meeting that the PR should be merged in its current state? I'm a bit surprised since it seems @theogf's and my comments were not addressed and I don't think we had a vote on this design question (IIRC it was only suggested on Slack a while ago). |
resolves #100