-
Notifications
You must be signed in to change notification settings - Fork 44
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
neither button nor command working to hide code #29
Comments
Try starting jupyter with Edit: fixed typo |
I tried
and got
And now the icons for html and pdf etc have gone missing from the toolbar. |
You have a typo here |
sorry about that. |
I tried the same in Windows 10 and I confirm that the export to html or pdf is not hiding the code. |
Can you post pip's output when installing hide_code and the first 5-10 lines console lines when jupyter's console? |
I ran pip install hide_code again. This is the output:
Here is the output from starting jupyter notebook --NotebookApp.server_extensions="['hide_code.hide_code']"
|
I don't see the hide_code's server extension getting loaded. You should this in the consoles first few lines.
Would you post the jupyter and notebook versions your using |
Jupyter is 1.0.0 and notebook is 4.3.1. |
I killed all running jupyter kernels and notebook processes. I restarted a jupyter notebook using
Here is the output and it seems the hide_code's server extension is getting loaded fine. But I don't see any of the icons for hiding code, export to html or pdf.
|
Run
If you don't see any export buttons on the toolbar the |
Thanks again. Yes, you are right, I ran and Custom JS contents is indeed blank. How come it is missing and how can I get it back? |
Try running |
I am sorry, still no luck. Here is the output from running
I checked and Custom.js is showing in the /home/kaushik/.jupyter/custom folder. |
hide_code is installing itself in |
I am providing the output of What can I do?
|
Basically what's happening is the pip installer isn't installing hide_code into your conda environment. Running |
Thanks! Yes your suggestion now brings back the icons for hide code, export to html and pdf back. But now back to the original problem. Hide code button works. But the export to html and pdf gives Page 404 error. Bummer! |
Did you start juypter using |
OK, I did |
Did you save the workbook before exporting? |
Yes, I did save. |
Would you post the output from Juypter's console when the 404 error happens? |
|
any resolution on this yet? |
I'm another Anaconda user with the same issues - I followed all the advice here and got the buttons to show up, but no "hide code" selections are being respected with regards to the output. |
Same issue as coljac. If I hide code via the cell toolbar or via the buttons on the main toolbar and then diff the output html with the html generated when the code was showing there are no differences. The buttons do function as expected on screen though. It seems to be just a problem with the exported data files (html and both pdf forms). |
+1 for the "code gone on screen, but not in output" issue. Python 3.5.1, Jupyter 4.2.1. Added |
@coljac @MikeHigginbottom @npyoung would you post the version of nbconvert you're using? |
Also, this extension prints some stuff in Jupyter's console during the export process. Do you see any error messages?
|
No error messages on jupyter notebook start.
|
4.2.0 with no errors:
|
That's helpful. Please check the metadata for your notebook. Select "Edit Metadata" as the cell toolbar, pick a cell with the code hidden, then click on the "Edit Metadata" button. Do you see JSON similar to this:
|
With the code hidden there is no Edit Metadata button showing. With the code showing the JSON is empty. |
It doesn't look like you can see the "Edit Metadata" buttons on hidden cells. Unhidden code cells have {
"trusted": true,
"collapsed": false
} I also tried hiding the code, saving, and looking at the raw notebook json - no "hideCode" key in the metadata there either. |
Good, making some progress. What version of notebook are you running? |
|
Tested with notebook 4.3.1, and not seeing any issues. Not sure why this is happening. The cell metadata isn't being written for some reason on your setup. Exporting depends on the metadata to render correctly. Are there any error messages in the console? |
I'm gonna take a stab in the wild dark then and suggest it might be a path issue (it's always a path issue). Can you give us a rough idea of what is supposed to live where? No errors in the console by the way. |
I've got the next version ready on the dev branch. Maybe that will take care of these issues. The dev version uses nbextension installation instead of bootstrapping custom.js and jupyter config files. To install:
Note: add |
Followed those steps (I think step 5 should be |
Thanks, fixed the typo. Still not sure what caused the first issue. Sounds like either hide_code or notebook JS is corrupting/mangling the cell metadata. When upgrading hide_code, Jupyter and its dependencies is also upgraded to the latest version. Hopefully, that cleans up everything. Anyhow, glad this is resolved. @kmallick2000 @npyoung @coljac do the instructions above fix your issue too? |
I performed the following steps:
At this point, the toolbar was there, and the edit metadata button persists when I hide the code, with
Everything looks like it's working now. |
Sorry, checking in late. |
Confirming (finally) that the fix works for me, using v0.4.0 now. |
Thanks for writing the very useful code.
I am using 4.1.36-44 kernel on Leap 42.1. I can get the code to hide within Jupyter, but cannot get the code to hide in the output to html or pdf, either through command prompt or using the buttons. I get the error:
404 : Not Found
You are requesting a page that does not exist!
I tried putting the notebook file in the root directory of Jupyter and that did not help either. I have conda updated, I am using python 2.7 and nbconvert is ver. 4.2.0.
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: