sagecell input size

108 views
Skip to first unread message

David Guichard

unread,
Jul 31, 2020, 4:30:56 PM7/31/20
to sage-cell
I would like a sagecell input cell to show the entire initial contents. At present, I get about 7 lines of code and a vertical scroll bar. Can I do this? I've tried quite a few things with no luck, including overflow-y: visible for class CodeMirror-scroll.

Thanks,
David

Andrey Novoseltsev

unread,
Jul 31, 2020, 4:43:07 PM7/31/20
to sage-cell
You can use a button or keyboard to switch to full screen. If you want to do it in a script, here is how it is handled in the code:

Otherwise the editor is a CodeMirror instance, so in theory you should be able to set whatever properties you want on it, and our height indeed seems to be set for CodeMirror-scroll, e.g. https://github.com/sagemath/sagecell/blob/871feca21d0d522d726f7b31bd642172dcef4d3a/static/root.css#L43
Maybe Rob Beezer may have some more input on cell adjustments.

Best,
Andrey

David Guichard

unread,
Jul 31, 2020, 10:46:38 PM7/31/20
to sage-cell
Well, I think I figured this out. The file https://sagecell.sagemath.org/static/embedded_sagecell.js includes a lot of CSS, or code that generates CSS. Some of the CSS items are marked !important, which seems to mean I can't override them with local CSS code. One of these controls overflow in CodeMirror-scroll. (This seems to me to be a Very Bad Idea.) So I downloaded embedded_sagecell.js, modified it, and loaded the local version. Now the input cell works as I want...but the Evaluate button is now broken, because (I assume) it thinks my local server is also the sagecell server, so this is clearly not a solution. Did I mention that this design is a Very Bad Idea? Why shouldn't I be allowed to change the overflow policy with local CSS code?

And by the way, I would swear that my sagecells used to display the "full-screen" button, but it's missing. I don't care much, but is there an easy fix? I found some old posts talking about this, but it was allegedly fixed at that time. When I look at the page in the developer console, the "Inspector" thinks there is actually a button there (it outlines a reasonable size area on the page where the button should be) but no button image appears (and clicking where it supposedly is does nothing.)

-- David

David Farmer

unread,
Jul 31, 2020, 10:52:51 PM7/31/20
to sage-cell

I still see "full screen" buttons. Here, for example:

https://pretextbook.org/examples/sample-article/html/section-sage-cells.html

I keep threatening to submit a pull request to disable
(or at least not show by default) the full screen button,
as they serve no purpose in my universe.
> --
> You received this message because you are subscribed to the Google Groups "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/d11f00b8-7d25-445c-9e04-20908a059d89o%40googlegroups.com.
>
>

Andrey Novoseltsev

unread,
Jul 31, 2020, 10:59:46 PM7/31/20
to sage-cell
CSS has been there almost entirely from prehistoric times. If there are bad ideas, and especially if there are very bad ones, concrete suggestions, and especially pull requests are very welcome ;-)

Jorge Garcia

unread,
Aug 1, 2020, 12:32:14 AM8/1/20
to Andrey Novoseltsev, sage-cell
Well, my students use the full screen button all the time.
Regards,
A. Jorge García

On Fri, Jul 31, 2020, 22:59 Andrey Novoseltsev <novo...@gmail.com> wrote:
CSS has been there almost entirely from prehistoric times. If there are bad ideas, and especially if there are very bad ones, concrete suggestions, and especially pull requests are very welcome ;-)

--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.

David Guichard

unread,
Aug 1, 2020, 5:39:12 PM8/1/20
to sage-cell
Ah, never mind. It turns out that CSS precedence rules mean that if I set a value for overflow and mark it !important that overrides the !important in embedded_sagecell.js.

I'd still like to know what's going on with the full-screen button. I'm stumped.

David Guichard

unread,
Aug 1, 2020, 5:55:49 PM8/1/20
to sage-cell
Ah, oops. Well, a little more exploring with the browser code inspector solved the full-screen button: apparently at some point I decided I didn't want the full-screen, so I figured out how to turn it off with CSS. It was buried in an external css file. My bad.

David:

If you want to turn them off in your own docs, use:

.sagecell_fullScreen {
    visibility: hidden;
}

I gather that it is possible to set css values locally in the browser, but I haven't yet tried to learn how to do this.

-- David

Andrey Novoseltsev

unread,
Aug 2, 2020, 2:29:10 PM8/2/20
to sage-cell
So... Can we consider the issue here resolved without further actions? Given that !importan was used for a long time without complaints, I am hesitant to drop it for it may break some existing pages and it is hard to know if that happens.

Regarding hiding full screen button and other elements, there is an official way to do so:

ekwa...@gmail.com

unread,
Dec 15, 2021, 11:37:33 PM12/15/21
to sage-cell
For those visiting this thread for a solution of the problem of the original poster, this css rule works:

.sagecell_input .CodeMirror-scroll { /* show entire input lines */
    max-height: none;
}  

Reply all
Reply to author
Forward
0 new messages