Skip to content

Commit 37b7bac

Browse files
authored
Add documentation with Documenter.jl (#941)
* Documenter.jl src files with README contents * Add public API docs page w/ @AutoDoc, empty docs page on internals * Simplify README * Set up documentation deployment * Add documentation badges to README * Run Pkg.build() in documentation workflow
1 parent ad459e8 commit 37b7bac

File tree

13 files changed

+473
-332
lines changed

13 files changed

+473
-332
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags: 'v*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: julia-actions/setup-julia@latest
16+
with:
17+
version: '1.4'
18+
- name: Install dependencies
19+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build("IJulia")'
20+
- name: Build and deploy
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
23+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
24+
run: julia --project=docs/ docs/make.jl

README.md

Lines changed: 18 additions & 332 deletions
Large diffs are not rendered by default.

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"

docs/make.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Documenter, IJulia
2+
3+
4+
makedocs(
5+
modules=[IJulia],
6+
sitename="IJulia",
7+
pages=[
8+
"Home" => "index.md",
9+
"Manual" => [
10+
"manual/installation.md",
11+
"manual/running.md",
12+
"manual/usage.md",
13+
"manual/troubleshooting.md",
14+
],
15+
"Library" => [
16+
"library/public.md",
17+
"library/internals.md",
18+
],
19+
],
20+
)
21+
22+
23+
deploydocs(
24+
repo = "github.com/JuliaLang/IJulia.jl.git",
25+
push_preview = true,
26+
)

docs/src/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# IJulia
2+
3+
**IJulia** is a [Julia-language](http://julialang.org/) backend
4+
combined with the [Jupyter](http://jupyter.org/) interactive
5+
environment (also used by [IPython](http://ipython.org/)). This
6+
combination allows you to interact with the Julia language using
7+
Jupyter/IPython's powerful [graphical
8+
notebook](http://ipython.org/notebook.html), which combines code,
9+
formatted text, math, and multimedia in a single document. It
10+
also works with [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), a Jupyter-based
11+
integrated development environment for notebooks and code.
12+
13+
(IJulia notebooks can also be re-used in other Julia code via
14+
the [NBInclude](https://github.com/stevengj/NBInclude.jl) package.)

docs/src/internals.md

Whitespace-only changes.

docs/src/library/internals.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Internals
2+
3+
TODO

docs/src/library/public.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Public API
2+
3+
4+
```@autodocs
5+
Modules = [ IJulia ]
6+
```

docs/src/manual/installation.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Installation
2+
3+
4+
## Installing IJulia
5+
6+
First, [download Julia](http://julialang.org/downloads/) *version 0.7
7+
or later* and run the installer. Then run the Julia application
8+
(double-click on it); a window with a `julia>` prompt will appear. At
9+
the prompt, type:
10+
```julia
11+
using Pkg
12+
Pkg.add("IJulia")
13+
```
14+
to install IJulia.
15+
16+
This process installs a [kernel specification](https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs) that tells Jupyter (or JupyterLab) etcetera
17+
how to launch Julia.
18+
19+
`Pkg.add("IJulia")` does not actually install Jupyter itself.
20+
You can install Jupyter if you want, but it can also be installed
21+
automatically when you run `IJulia.notebook()` below. (You
22+
can force it to use a specific `jupyter` installation by
23+
setting `ENV["JUPYTER"]` to the path of the `jupyter` program
24+
before `Pkg.add`, or before running `Pkg.build("IJulia")`;
25+
your preference is remembered on subsequent updates.
26+
27+
28+
## Updating Julia and IJulia
29+
30+
Julia is improving rapidly, so it won't be long before you want to
31+
update to a more recent version. To update the packages only, keeping
32+
Julia itself the same, just run:
33+
```julia
34+
Pkg.update()
35+
```
36+
at the Julia prompt (or in IJulia).
37+
38+
If you download and install a new version of Julia from the Julia web
39+
site, you will also probably want to update the packages with
40+
`Pkg.update()` (in case newer versions of the packages are required
41+
for the most recent Julia). In any case, if you install a new Julia
42+
binary (or do anything that *changes the location of Julia* on your
43+
computer), you *must* update the IJulia installation (to tell Jupyter
44+
where to find the new Julia) by running
45+
```julia
46+
Pkg.build("IJulia")
47+
```
48+
at the Julia command line (**important**: not in IJulia).
49+
50+
51+
## Installing additional Julia kernels
52+
53+
You can also install additional Julia kernels, for example, to
54+
pass alternative command-line arguments to the `julia` executable,
55+
by using the `IJulia.installkernel` function. See the help for this
56+
function (`? IJulia.installkernel` in Julia) for complete details.
57+
58+
For example, if you want to run Julia with all deprecation warnings
59+
disabled, you can do:
60+
```julia
61+
using IJulia
62+
installkernel("Julia nodeps", "--depwarn=no")
63+
```
64+
and a kernel called `Julia nodeps 0.7` (if you are using Julia 0.7)
65+
will be installed (will show up in your main Jupyter kernel menu) that
66+
lets you open notebooks with this flag.
67+
68+
You can also install kernels to run Julia with different environment
69+
variables, for example to set [`JULIA_NUM_THREADS`](https://docs.julialang.org/en/v1/manual/environment-variables/index.html#JULIA_NUM_THREADS-1) for use with Julia [multithreading](https://docs.julialang.org/en/v1/manual/parallel-computing/#Multi-Threading-(Experimental)-1):
70+
```
71+
using IJulia
72+
installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4"))
73+
```
74+
The `env` keyword should be a `Dict` mapping environment variables to values.
75+
76+
77+
## Low-level Information
78+
79+
### Using older IPython versions
80+
81+
While we strongly recommend using IPython version 3 or later (note that this
82+
has nothing to do with whether you use Python version 2 or 3), we recognize
83+
that in the short term some users may need to continue using IPython 2.x. You
84+
can do this by checkout out the `ipython2` branch of the IJulia package:
85+
86+
```julia
87+
Pkg.checkout("IJulia", "ipython2")
88+
Pkg.build("IJulia")
89+
```
90+
91+
### Manual installation of IPython
92+
93+
First, you will need to install a few prerequisites:
94+
95+
* You need **version 3.0** or later of IPython, or version 4 or later
96+
of Jupyter. Note that IPython 3.0 was released in February 2015, so
97+
if you have an older operating system you may
98+
have to [install IPython
99+
manually](http://ipython.org/ipython-doc/stable/install/install.html).
100+
On Mac and Windows systems, it is currently easiest to use the
101+
[Anaconda Python](http://continuum.io/downloads) installer.
102+
103+
* To use the [IPython notebook](http://ipython.org/notebook.html) interface, which runs in your web
104+
browser and provides a rich multimedia environment, you will need
105+
to install the [jsonschema](https://pypi.python.org/pypi/jsonschema), [Jinja2](http://jinja.pocoo.org/docs/), [Tornado](http://www.tornadoweb.org/en/stable/),
106+
and [pyzmq](https://github.com/zeromq/pyzmq) (requires `apt-get install libzmq-dev` and possibly `pip install --upgrade --force-reinstall pyzmq` on Ubuntu if you are using `pip`) Python packages.
107+
(Given the [pip](http://www.pip-installer.org/en/latest/) installer, `pip install jsonschema jinja2 tornado pyzmq`
108+
should normally be sufficient.) These should have been automatically installed if you installed IPython itself
109+
[via `easy_install` or `pip`](http://ipython.org/ipython-doc/stable/install/install.html#quickstart).
110+
111+
* To use the [IPython qtconsole](http://ipython.org/ipython-doc/dev/interactive/qtconsole.html) interface,
112+
you will need to install [PyQt4](http://www.riverbankcomputing.com/software/pyqt/download) or
113+
[PySide](http://qt-project.org/wiki/Category:LanguageBindings::PySide).
114+
115+
* You need Julia version 0.7 or later.
116+
117+
Once IPython 3.0+ and Julia 0.7+ are installed, you can install IJulia from a Julia console by typing:
118+
```julia
119+
Pkg.add("IJulia")
120+
```
121+
This will download IJulia and a few other prerequisites, and will set up a
122+
Julia kernel for IPython.
123+
124+
If the command above returns an error, you may need to run `Pkg.update()`, then
125+
retry it, or possibly run `Pkg.build("IJulia")` to force a rebuild.

0 commit comments

Comments
 (0)