Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jupyterpost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quantum Tinkerer
jupyterpost
Commits
f3b122de
Verified
Commit
f3b122de
authored
2 years ago
by
Anton Akhmerov
Browse files
Options
Downloads
Patches
Plain Diff
update readme
parent
84e44a2d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+25
-0
25 additions, 0 deletions
README.md
with
25 additions
and
0 deletions
README.md
+
25
−
0
View file @
f3b122de
...
...
@@ -30,6 +30,7 @@ The function is somewhat fragile, but should work for standard Jupyterhub instal
## Using jupyterpost
The low level interface to Jupyterpost is
`jupyterpost.post`
. It takes a message, a channel, and an attachment, and posts it to the Mattermost server.
```
python
from
jupyterpost
import
post
from
matplotlib
import
pyplot
...
...
@@ -41,6 +42,30 @@ post(
attachment
=
pyplot
.
gcf
(),
# Or png bytes
)
```
In practice, however, you will probably want to use the
`%post`
/
`%%post`
magic commands.
Both become available after importing
`jupyterpost`
.
The line magic is meant for short messages:
```
ipython
run_long_computation()
%post @myself Computation done!
```
The cell magic can:
-
Post a multiline formatted message with a
`-r`
argument
```ipython
%%post <channel> -r
## Markdown title
- Anything
- Goes
```
-
Post the cell outputs (latex, plain text, markdown), and a single image (for now)
-
Optionally include the cell input with a
`-i`
argument
```ipython
%%post <channel> -i
import matplotlib.pyplot as plt
plt.plot([0, 1])
```
### Posting from outside of your Jupyterhub
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment