-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
autoexec-fragment ? #282
Comments
In fact I have implemented something to solve #254 for the JupyterCon talk but I have to put it in a PR now. Btw, thanks for posting your ideas! |
It's great to hear that you have a solution for #254 and I am eager to be able to use that :) as for how concretely marking a fragment for auto-execution, as I said I wrote the first idea that came to mind:) |
I am talking about this: jupyter/notebook#2048. |
OK, thanks for making this more clear Is there an easy way for me to benefit from the patch you made for jupytercon ? thanks ! |
The workaround is the following: Add this piece of code in main.js: // select the first cell from each slide
setTimeout(function(){
var current_cell_index = reveal_cell_index(Jupyter.notebook);
console.log(current_cell_index);
// select and focus on current cell
Jupyter.notebook.select(current_cell_index)
}, 500); after lines: https://github.com/damianavila/RISE/blob/master/rise/static/main.js#L347 and https://github.com/damianavila/RISE/blob/master/rise/static/main.js#L353 That will select every first cell of each slide when you change the slides... if 500 ms is too much for you, you can probably diminish it (I tested with 200ms and seems to work OK). Beware to hard clean the browser cache after making the change in main.js, so you have the latest code. I need to put this with a proper config option and maybe add an option to link the action to a keyboard event if you only want this behavior in specific slides and not in all of them. Hope it helps! |
Hey; thanks for the tip Also, stupid question but: I have the system installed through pip + I have the git repo on a file; what's the easiest way to try the code in the git repo ? I feel like I did that already but can't remember how I did it, it feels like I used a very quick and dirty way, and I'd rather not do that again :) thanks in advance -- I'm eager to try this out - Thierry |
Sorry about that, I corrected the links above. You should see the correct locations now... I merged some pull request after giving this instructions for first time.
I would follow these instructions: https://github.com/damianavila/RISE#development, to try new things. |
ok, now the location for the patched makes more sense; about the devel. mode OTOH, I am struggling a bit:
turns out sed -i on the mac requires a suffix argument: I would advocate invoking
which works on both mac and linux, as far as I can tell; let me know if you'd like me to create a PR to this effect - I'm not fluent with
from my rather shallow knowledge of the way I test it is to just call I can find
should I expect the former to be copied into the latter after I followed the instructions as per the devel guide ? because they're different in my case ? PS. I ran all the devel. guide with a modified PS2. also I had to run everything under sudo, of course PS3. Also I figured that running PS4. also I cleared my browser cache |
I need to test it on Linux...
Yep, For sure!
Right.
PS. I ran all the devel. guide with a modified main.js, so I'm not yet talking about doing a change in the JavaScript file on the fly. Probably the simlinking is not working... what is you PS2. also I had to run everything under sudo, of course Why? In my case I am using conda... but you should not need to sudo things in the pip world... I think. PS3. Also I figured that running pip install -e . was not doing anything in my case because I had that same version installed in my system; so I did pip install --upgrade -e . instead, which apparently was doing more stuff; but to no avail either mmm... that is weird... so... are you using the same environment where you have the released version installed to do development? PS4. also I cleared my browser cache Nice to know, it is a source of problems with stale-cached js. |
thanks a lot I created the PR as #285 Removing and yes, this is a single-user setup, and I tear down everything often enough to not worry too much about the installed stuff, so yes, I wanted this to go into the installed version as I plan to use it for real :) My understanding is that whenever I change main.js, I'll need to rerun
that's fine... thanks again |
Yep, it seems your solution for now. Thanks for battle this out. I will try to review your PR as soon as I can. |
Hi; mostly thinking aloud here, but..
Would it make sense to create a new fragment-type, for example 'autoexec-fragment', that would cause the cell to be executed when the fragment shows up ?
not sure it that makes sense to many people, but I have the feeling that in my case in particular, it would make the whole presenter's life a lot easier; It could in particular contribute smoothening issue #254, that is related in the sense that the only reason why I need to select a cell is so I can evaluate it.
well again, just a thought - thanks !
The text was updated successfully, but these errors were encountered: