Skip to content
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

UI For Metadata #2333

Merged
merged 28 commits into from Jan 14, 2013
Merged

UI For Metadata #2333

merged 28 commits into from Jan 14, 2013

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Aug 24, 2012

This a prototype to edit metadata.
right now you need to execute

``` %%javascript #execute to toggle header to edit metadata of cell $('body').toggleClass('editmetaon') ```

To see the UI change.

I'll add a button to the toolbar to do so once #2127 is merged.
looks like
Imgur

Cell "header" are togglable by above command, and clicking on "raw edit" bring the modal editor.

My question is what kind of API do we want to add other buttons to the cell header/toolbar.

Obviously if an extension want to add a button, the button needs to be be added to all the current cell of a certain type.

Do we allows extension to be loaded at any time, or do we says that some stuff can only be extended if the extension is loded at notebook load time?

And we also need maybe an event to say that the metadata have changed.

Update :

see this comment
To see how to enable.

@travisbot
Copy link

This pull request passes (merged 2e2514ab into 144f08a).

@Carreau
Copy link
Member Author

Carreau commented Sep 30, 2012

Hi,
This PR is without activities for 1 month now,
I'm going to close it and open an issue to reference it.
This does not mean than we refuse the code that is here, but that we try to keep the number of opened Pull request as low as possible to have better bird view of active code.

Fell free to reopen this PR whenever you want or contact us if you have any questions.

Thanks for contributing.

I ll reopen later when times come.

@Carreau
Copy link
Member Author

Carreau commented Oct 2, 2012

Reopening since #2127 has been merged.

@Carreau Carreau reopened this Oct 2, 2012
@fperez
Copy link
Member

fperez commented Oct 6, 2012

Now that #2127 went in, do you want to add the button? That way we can play with it 'for real'...

@Carreau
Copy link
Member Author

Carreau commented Oct 6, 2012

Yes, I'm working on it, but I'm leaving for conference on tuesday and just finished my poster.
I'll be offline and without computer next week so i'll do my best to have something usable before the end of the week-end, but that won't be easy.

Still here is a prototype which toggle between "Nothing Special" and "Slide Start".
Should work only with Code Cell.

There is a button in the toolbar to toggle the per cell menubar.

Pinging @ellisonbg, are you more interested in making this ready for merging, or are you Ok to make your PyData Presentation for a not yet merge Branch ?

If the later, I would hard code most on the stuff on this branch and start working on the Presentation Mode itself.

@Carreau
Copy link
Member Author

Carreau commented Oct 6, 2012

Ok, the basic stuff should work for all kinds of cells.
adding buttons should be pretty strait forward.

metadata look like

{
    "slideshow": {
        "slide_start": false,
        "slide_step": true
    }
}

And the 2 properties can be toggled in one click, and survives save and reload.

@Carreau
Copy link
Member Author

Carreau commented Oct 6, 2012

OK,
I'm missing time so I've hacked a quick thing together based on what I did On scipy and this PR.

https://github.com/Carreau/ipython/tree/slideshow_metadata

Click on the 'image' button in the toolbar, before the cell-type dropdown selection.
Edit the metadata to have the Slide Start on the right cell.
Hide the per/cell toolbar.

%load_ext slidemode

then,

%slideshow_mode

This push a new image button on the toolbar.
This new button 'enable' the slide mode.

To control the slide transition you have to click on the 'enable slide control' in the new toolbar on the top.

The 'stop' button is more a 'Pause' button, as if you start the slideshow again, you will get back to where you where before.

I'll redo the all thing later, but right now and won't have time.

@Carreau
Copy link
Member Author

Carreau commented Oct 6, 2012

And now there is a stop/pause button, with the first you will start again from first slide, with the second, you will start where you left from.

The icon to toggle the metadata toolbar is now ui-icon-tag.

Done for today.

@keflavich
Copy link

Slideshow mode is great! Is there any documentation for it? (what does the In/Out button do, what does Group Stop / Slide Stop mean?)

Also, have you ever tried applying styling to your slides? http://wiki.ipython.org/Cookbook/Styling_Notebook only seems to work for the UI component.

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

From my phone, so short:

In/Out: show only input; show only output; show in then out.; 2 at the same
time.

Group/slide : is it a start of a new slide or a step in showing the current
slide.

This is mainly an experimental branch so it is not documented and wont stay
as is.
Le 9 nov. 2012 19:44, "Adam Ginsburg" notifications@github.com a écrit :

Slideshow mode is great! Is there any documentation for it? (what does the
In/Out button do, what does Group Stop / Slide Stop mean?)

Also, have you ever tried applying styling to your slides?
http://wiki.ipython.org/Cookbook/Styling_Notebook only seems to work for
the UI component.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2333#issuecomment-10239909.

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

As for the css; we have custon element. You can override in
.ipython/profil_xxx/static/css/cusom.css if you need need smth more
specific we might give a more precise answer of how to do it.
Le 9 nov. 2012 19:44, "Adam Ginsburg" notifications@github.com a écrit :

Slideshow mode is great! Is there any documentation for it? (what does the
In/Out button do, what does Group Stop / Slide Stop mean?)

Also, have you ever tried applying styling to your slides?
http://wiki.ipython.org/Cookbook/Styling_Notebook only seems to work for
the UI component.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2333#issuecomment-10239909.

@keflavich
Copy link

Re: experimental - it will be incredibly useful, so I hope you continue development!

Re: css, thanks; looks like the full directions for that process are here: http://mail.scipy.org/pipermail/ipython-user/2012-August/010997.html. However, I get the Placeholder for custom user CSS message instead of the css loading if I look at http://localhost:port/static/css/custom.css

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

Re: experimental - it will be incredibly useful, so I hope you continue development!

Yes, it will be part of ipython.

However, I get the Placeholder for custom user CSS message instead of the css loading if I look at http://localhost:port/static/css/custom.css

This is because the server does not see you file, there is a placeholder file to avoid 404.

Did you restart the server? What is the full path of the css file you added ?

@keflavich
Copy link

Yes, I restarted the server. Full path is:
/Users/adam/.ipython/profile_default/static/css/custom.css
and the server reports on startup:
[NotebookApp] Using existing profile dir: u'/Users/adam/.ipython/profile_default'

FYI, I'm running from commit faedbd7 on the slideshow_extension branch.

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

Yep, you are right, this branch is a little old and does not have custom css.

This one should be a little more recent :
https://github.com/Carreau/ipython/commits/slideshow_metadata

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

slideshow_mode is the proof of concept branch.
slideshow_metadata is the more recent one ( i think) and should be the one to use.

You should also have a pmodeand _pmode branch around.

IIRC, in some branches the transition can be edited with the metadata toolbar, in the oldes one you should put
<!--####-->or #### in the first cell of each slide. I didn't had time to rework a lot on that. @ellisonbg might have used it for is talk at pydata and @dwf will soon use it or has used it not so long ago. They might send me feedback to improve it and hopefully we can start to merge things in IPython itself.

@keflavich
Copy link

OK, great! I will go ahead and use it - is this Issue a good place for feedback, or should I open independent issues in your fork?

Last question on css: Is it possible to override the UI css using the ~/.ipython/profile/static/jquery/css/themes/ directory, or does that still need to be done as on the wiki? My goal is to create a slideshow with a black background (so I don't get blinded by the projector)

@keflavich
Copy link

slideshow_metadata seems to be missing the "start slideshow" button; it has the sub-menus on each individual cell but not the overall important one. What is _pmode for?

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

is this Issue a good place for feedback,
Yes, here is fine.

Last question on css: Is it possible to override the UI css using the ~/.ipython/profile/static/jquery/css/themes/ directory, or does that still need to be done as on the wiki? My goal is to create a slideshow with a black background (so I don't get blinded by the projector)

Yes any file in ~/.ipython/profile_xxx/static/ will "overwrite" its corresponding version in IPython source dir.
they just need to exist at server boot time (I think) .

It should be possible to add a class to <body> when the slide show is on (is there already maybe ?) so that your custom css apply only while you are presenting.

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

You need to load the extension cf comment above (#2333 (comment))

@Carreau
Copy link
Member Author

Carreau commented Nov 9, 2012

_pmodeand pmode are other draft branches. I should dive in it again to tell you the exact difference.
One should have a prototype that allow to show a code cell by group of line to slowly describe it. It still had to be triggerd by hand from the js console.

@keflavich
Copy link

Ah right, I just made a silly mistake not doing %load_ext. However, when I try %load_ext, it fails. If I look in my ipython/build directory, this file exists: ./build/lib/IPython/extensions/slidemode.py but this file ./IPython/extensions/slidemode.py is not copied into build/ - I think this may be an oversight in the setup.py?

@ahmadia
Copy link
Contributor

ahmadia commented Nov 10, 2012

@Carreau - Thanks for your work on this Matthias. We're going to be using slideshow_mode tomorrow in the Supercomputing presentation. We're going to hold off on the advanced metadata stuff, but I'll try to collect feedback from both instructors and students about how they feel things went.

@ahmadia
Copy link
Contributor

ahmadia commented Nov 10, 2012

More initial feedback. The lack of a slide navigator is a real show-stopper right now for working with and debugging large slide shows. It would be great if you could click the little [x/X] button indicating the current slide and choose to jump to a slide from the dropdown.

@Carreau
Copy link
Member Author

Carreau commented Jan 14, 2013

Everything should be fixed, rebased on master to avoid stupid conflict.

Css could be perfected, but if we move to bootstrap soon, in anyway most of this would have to be re-done. So I would prefer not to fight for pixel perfect alignment now.

var example_preset = []
example_preset.push('default.rawedit');

CellToolbar.register_preset('default',example_preset);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's capitalize default -> Default as the other menu items are capitalized.

@ellisonbg
Copy link
Member

Hmm, I can't seem to load the example preset from the new location. I am including the following in my custom.js:

$.getScript('/static/js/celltoolbarpresets/example.js');

Am I missing something?

CellToolbar.register_callback('example.help',add_simple_dialog_button)
example_preset.push('example.help')

CellToolbar.register_preset('example',example_preset);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's capitalize "Example" here as well.

@Carreau
Copy link
Member Author

Carreau commented Jan 14, 2013

Hmm, I can't seem to load the example preset from the new location. I am including the following in my custom.js:
$.getScript('/static/js/celltoolbarpresets/example.js');
Am I missing something?

Nop, fixed now.

@ellisonbg
Copy link
Member

Awesome, looks great! I am merging as all the comment have been addressed. Thanks for your patient work on this one, wish I could buy you a beer this evening!

ellisonbg added a commit that referenced this pull request Jan 14, 2013
@ellisonbg ellisonbg merged commit 57b0450 into ipython:master Jan 14, 2013
@Carreau
Copy link
Member Author

Carreau commented Jan 14, 2013

Yeepeee after 5 month ! It was a hard one !

Thanks for you careful review !

@ellisonbg
Copy link
Member

Yes, I wish I could have spent more time reviewing to get it in faster, but
I am really happy that we took our time and did it right. It will pay off
in the long run. Let me know when you have updated the slideshow PR to
master. that one should be easy to merge now as it is just a simple preset!

On Mon, Jan 14, 2013 at 12:05 PM, Bussonnier Matthias <
notifications@github.com> wrote:

Yeepeee after 5 month ! It was a hard one !

Thanks for you careful review !


Reply to this email directly or view it on GitHubhttps://github.com//pull/2333#issuecomment-12236983.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@damianavila
Copy link
Member

El 14/01/13 17:05, Bussonnier Matthias escribió:

Yeepeee after 5 month ! It was a hard one !

Thanks for you careful review !


Reply to this email directly or view it on GitHub
#2333 (comment).

Thanks both for the hard work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants