nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

Added the hide_input option

Open gpagliuca opened this issue 8 years ago • 13 comments

This partially covers #81 and #6. With "hide_input": true as cell metadata the cell input is hidden but not the output.

This solution is not very elegant since the "Out[10]" is still there untitled

gpagliuca avatar Dec 21 '16 08:12 gpagliuca

Thanks for the PR. Did you try to set nbsphinx_prompt_width to zero? There is also a CSS class named prompt, which you can probably use. Note that those won't affect LaTeX output.

BTW, what HTML theme are you using? The prompts are not supposed to have a scrollbar. But probably this should somehow be disabled with CSS?

About your PR: I think it's better to wait a bit to see how the "hiding" discussion in Jupyter turns out.

You should join the discussion!

There is some discussion in #65, which has links to more discussions in the Jupyter repos.

mgeier avatar Dec 23 '16 11:12 mgeier

Sorry for the late reply, I was offline.

The theme is alabaster and what you see in the image is a pandas dataframe (not sure if this matters)

gpagliuca avatar Jan 06 '17 12:01 gpagliuca

Thanks for the update! I've changed the CSS in 51ca141e089227d5647a3a3f8a84918fccf2d118, can you please show how it looks like when you use the master branch?

mgeier avatar Jan 10 '17 16:01 mgeier

Better, thanks!

untitled

Is it possible to remove also the "Out[10]" and maybe align to the left (or center)?

gpagliuca avatar Jan 11 '17 13:01 gpagliuca

Thanks for trying it again, but could you please try it with a two-digit execution count?

Is it possible to remove also the "Out[10]" and maybe align to the left (or center)?

Sure, everything is possible. But I don't know yet what's the best way to do that. I'd have to look into that, but I don't know when I'll have time for that.

If someone else wants to give it a shot, go ahead!

mgeier avatar Jan 12 '17 20:01 mgeier

could you please try it with a two-digit execution count?

untitled

I'd have to look into that, but I don't know when I'll have time for that.

Thant's OK, thank you for your help :-)

gpagliuca avatar Jan 13 '17 08:01 gpagliuca

Thanks. So the scrollbar is still there ... are you sure you were using the master branch?

mgeier avatar Jan 15 '17 13:01 mgeier

are you sure you were using the master branch?

I think so...

untitled

gpagliuca avatar Jan 16 '17 12:01 gpagliuca

Can you please check if you have this CSS in the output HTML file?

div.nbinput div.prompt pre,
div.nboutput div.prompt pre {
    overflow: hidden;
}

mgeier avatar Jan 16 '17 15:01 mgeier

Can you please check if you have this CSS in the output HTML file?

div.nbinput div.prompt pre,
div.nboutput div.prompt pre {
    overflow: hidden;
}

This is not present.

An interesting thing: in my test case I have essentially only 1 notebook called "preprocessor". Because of that my index points only at the preprocessor.html file. Now, in the picture below on the right side there is the preprocessor.html open directly with the browser, on the left side the same file open from the index:

screenshot_2017-01-18_10-47-11

the horizontal scroll bar is present only on the left.

Here the 2 html files and the original notebook

gpagliuca avatar Jan 18 '17 10:01 gpagliuca

If the mentioned CSS is not present, you are not using the master branch.

In the screenshot you show two files with the same name (preprocessor.html) but different paths. Are they supposed to be the same file?

The right one seems to be missing the external CSS (it only has the one from nbsphinx, which is embedded in the HTML). You should check for error messages in the Chromium Developer Tools.

mgeier avatar Jan 18 '17 20:01 mgeier

Q: 'nbsphinx_prompt_width' in the conf.py from sphinx or where to set?

rddaz2013 avatar Apr 26 '18 09:04 rddaz2013

A: yes

mgeier avatar Apr 26 '18 10:04 mgeier