-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
jupyterlab_xkcd extension tutorial #2921
Conversation
3ffe4af
to
1e05d39
Compare
Note to whoever is watching: these are just notes for now. Might turn into an executable notebook for steps beyond the initial conda environment setup. |
cc @mkery, nice meeting you. I've given you commit / push permissions on the branch for this PR. I don't know where it's going to wind-up, but feel free to hack on it if you'd like. |
2ac6515
to
2113f6e
Compare
Looking good, thanks for doing this, @parente! |
Note that we will be turning this into a notebook so we can test it on CI (doesn't have to be in this PR). |
@bollwyvl mentioned that at the sprints. I'm for it. Just wanted to focus on getting my feet under me to start. |
637b993
to
11987d2
Compare
OK. I think I'm done with my draft. It's a bit lengthy (GitHub says the md file is too long to show by default in the diff view, 🙊 ) and that's intentional. It lays out all of the code changes, terminal commands, and browser actions for the reader, and walks through building https://github.com/parente/jupyterlab_xkcd commit by commit. We can move that reference version to jupyterlab/jupyterlab_xkcd if desired. Let me know. |
@@ -0,0 +1,653 @@ | |||
# Let's Make an xkcd JupyterLab Extension | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document is rather long. Could you consider including a table of contents with section links? Or perhaps breaking up the document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would work if sections were grouped into higher level groupings eg Installation
and Initialize Extension With The Cookiecutter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll take a pass at them on the next update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about these, where only the # and ## level headings appears in the table of contents:
# Let's Make an xkcd JupyterLab Extension
## Setup a development environment
### Install conda using miniconda
### Install NodeJS, JupyterLab, etc. in a conda environment
## Create an extension project
### Initialize the project from a cookiecutter
### Build and link the extension for development
### See the initial extension in action
### Commit what you have to git
## Add an xkcd widget
### Show an empty panel
### Show a comic in the panel
## Improve the widget behavior
### Center the comic and add attribution
### Show a new comic on demand
### Restore panel state when the browser refreshes
## Publish your extension to npmjs.org
## Learn more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docs/index.rst
Outdated
@@ -29,6 +29,7 @@ Contents: | |||
adding_content.md | |||
examples.md | |||
terminology.md | |||
zero_to_extension.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be xkcd_extension_tutorial.md
?
Added a list of TODOs to the PR description. I'd like to handle these before the PR merges, in addition to feedback from reviewers. |
@parente, 👍 to move the repo to this org. |
@blink1073 will do. I'll do that soon and update the various links in the tutorial. Should I push a release of it on npm under @jupyterlab/jupyterlab_xkcd instead of my personal space? If so, I'll need access or someone to do it. |
@parente If you give me your npm user name I can add you to the org. |
@ian-r-rose You got it first try: parente 😄 |
@@ -0,0 +1,653 @@ | |||
# Let's Make an xkcd JupyterLab Extension | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docs/xkcd_extension_tutorial.md
Outdated
jupyter lab build | ||
``` | ||
|
||
Note: The build steps may show errors about `node-gyp` and `canvas` that look scary but are harmless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this since the errors won't be there in the next release.
docs/xkcd_extension_tutorial.md
Outdated
}; | ||
``` | ||
|
||
The `requires` attribute states that your plugin needs an object that implements the `ICommandPalette` interface when it starts. JupyterLab will bind pass an instance of `ICommandPalette` as the second parameter of `activate` in order to satisfy this requirement. Defining `palette: ICommandPalette` makes this instance available to your code in that function. The second `console.log` line exists only so that you can immediately check that your changes work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bind pass -> pass?
docs/xkcd_extension_tutorial.md
Outdated
npm publish --access=public | ||
``` | ||
|
||
Check that your package appears on the npm website. You can either search for it from the homepage or visit https://www.npmjs.com/package/@your-username/jupyterlab_xkcd directly. If it doesn't appear, make sure you've updated the package name properly in the `package.json` and run the npm command correctly. Compare your work with the state of the reference project at the [06-prepare-to-publish tag](https://github.com/jupyterlab/jupyterlab_xkcd/tree/06-prepare-to-publish) for further debugging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be updated to show @jupyterlab/xkcd-extension
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the image.
Open for early feedback during the sprint
* Add screenshot * Add git * Avoid PATH mods in conda steps (and come closer to what conda 4.4 supports)
* Screenshot of current progress * Rename completed screenshot * Link to reference impl for troubleshooting
Instead of bombarding someone else's heroku app instance
* Fix links so that they render * Use tags instead of commits so we can move them around later.
Also match current package naming convention and use @jupyterlab/xkcd-extension
95cce03
to
6c58212
Compare
I rebased but it looks like travis is still failing. Let me know if there's anything else you'd like me to do or change before merge. |
@parente, have you checked this box in this PR? I tried pushing a commit but it didn't go through: |
@blink1073 I do have that checked. I've never had much success with that feature. I can grant you read/write access to my PR branch in my fork. |
Worked now: 02b0277. |
@parente would you be interested in turning this into a blogpost on the medium? |
In it goes, thanks so much @parente! |
@jzf2101 Sure. Are you thinking of it as a teaser that links to the full thing or a repost of the whole doc? |
@parente i was thinking like a 5 minute read version of this that explains the high level steps but refers to the documentation you wrote for further details |
Placeholder PR for collaboration during the JupyterCon sprint (or anytime!)
TODOs