Skip to content

Commit 0e23dc9

Browse files
authored
Merge pull request #100 from Dyalog/docs
Docs
2 parents b53f1d4 + eeb474c commit 0e23dc9

File tree

10 files changed

+503
-0
lines changed

10 files changed

+503
-0
lines changed

DOCS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Building the docs
2+
3+
Make a Python virtual environment, e.g.
4+
5+
```sh
6+
mkdir ~/.venv
7+
python -m venv ~/.venv/docs
8+
. ~/.venv/docs/bin/activate
9+
```
10+
11+
Install the following python modules:
12+
13+
```sh
14+
pip install --upgrade pip
15+
pip install mkdocs
16+
pip install mkdocs-material
17+
```
18+
19+
To build:
20+
```sh
21+
mkdocs build
22+
```
23+
24+
View locally:
25+
```sh
26+
mkdocs serve
27+
```
28+
access at http://127.0.0.1:8000
29+
30+
Deploy:
31+
```sh
32+
mkdocs gh-deploy
33+
```

docs/assets/apl385.ttf

207 KB
Binary file not shown.

docs/css/main.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@font-face {
2+
font-family: APL;
3+
src: local("APL385 Unicode"), url("../assets/apl385.ttf");
4+
}
5+
.language-APL {
6+
font-family: APL!important;
7+
line-height: 1.2em!important;
8+
}
9+
code {
10+
font-family: APL;
11+
font-size: 1em!important;
12+
padding-left: 0em!important;
13+
padding-right: 0em!important;
14+
}
15+
.md-logo > img{
16+
width: 7rem!important;
17+
height: 1.2rem!important;
18+
}
19+
@media screen and (max-width: 76.1875em) {
20+
.md-logo > img{
21+
width: 10rem!important;
22+
height: 1.8rem!important;
23+
}
24+
}
25+
td:first-child {
26+
white-space: nowrap;
27+
}
28+
table.scrollable {
29+
display:block;
30+
overflow-x: auto;
31+
white-space: nowrap;
32+
}
33+
/* Custom colors */
34+
:root {
35+
--md-primary-fg-color: #ED7F00;
36+
--md-primary-fg-color--dark: #563336;
37+
--md-default-bg-color: #F8F8F8;
38+
}
39+
/* Code copy only input (see CONTRIBUTING.md) */
40+
pre + pre > button, pre + hr {
41+
display: none!important;
42+
}
43+
pre > code {
44+
padding-bottom: 1em!important;
45+
}
46+
hr + pre > button {
47+
top: -0.2em!important;
48+
}
49+
pre + pre , hr + pre {
50+
margin-top: -1.8em!important;
51+
}
52+
pre + pre > code, hr + pre > code {
53+
padding-top: 0.2em!important;
54+
}

docs/img/dyalog-white.svg

Lines changed: 198 additions & 0 deletions
Loading

docs/img/favicon-32.png

1.26 KB
Loading

docs/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# About
2+
3+
## What are Jupyter notebooks?
4+
A Jupyter notebook document combines an interactive coding session with narrative text according to [Donald Knuth's *literate programming*](https://en.wikipedia.org/wiki/Literate_programming) paradigm.
5+
6+
This is a nice format for teaching APL, explaining algorithms, and sharing ideas. The consumer of a notebook can experiment with the code, and make changes to the text and republish the notebook.
7+
8+
## What is the Dyalog Jupyter kernel?
9+
Jupyter originated as a system for use with the **Julia**, **Python** and **R** programming languages (**JuPy**te**R**). To use the system with other programming languages, an interface between the Jupyter system and the language system (compiler, interpreter and what have you) is required. This interface is the language kernel.
10+
11+
## How do I use Jupyter notebooks?
12+
Jupyter notebook documents can be used in the following ways:
13+
14+
- You can [install](./install.md) the Jupyter system locally on your machine to write and interactively use notebooks - this means that you can edit the text and execute the code examples within the notebooks.
15+
- View the notebooks and execute the code [online](./online.md) in a dedicated sandboxed environment.
16+
- View or share the notebook as a static document, for example using [nbviewer](http://nbviewer.jupyter.org/).
17+
- Export notebooks to widely supported formats, such as HTML or PDF, in [local offline usage](./install.md) or in [Binder](./online.md#using-binder).
18+
19+
> Open the *File* menu, click on *Download as* and select format. Note that some target formats may require installation of third party tools.

docs/install.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Install and use locally
2+
3+
**Dyalog version 15.0 or later** and **Python version 3.8+**, and the **jupyterlab** Python package must be installed in order to use the Dyalog Jupyter kernel.
4+
5+
Installing, operating and maintaining a Python installation can be a bit of a chore, especially if you're not a Python developer. If you're coming to this wanting only to use Jupyter for Dyalog APL, here are some step by step instructions for how to set up the whole tool chain from scratch.
6+
7+
If you're a Python developer, or if you're already using a "canned" Python distribution, like [conda](https://docs.conda.io/en/latest/), you probably know what you're doing and can skip this document.
8+
9+
The below instructions show how to install Jupyter and the Dyalog kernel inside a Python "virtual environment". This means that you can keep your Jupyter work separate from any other Python work, current or future. This is usually a good idea when working with Python.
10+
11+
1. Download and install the [Dyalog interpreter](https://www.dyalog.com/download-zone.htm).
12+
2. Download, and run the official [Python installer](https://www.python.org/downloads/). Ensure you select `Use admin privileges to install Python`, `Add python.exe to PATH`, and `Disable PATH limit`.
13+
3. Open a terminal (e.g. PowerShell if you're on Windows). Type the following steps into the terminal window.
14+
4. Create a virtual Python environment with a name of your choosing, e.g.
15+
```
16+
python -m venv jupy312
17+
```
18+
5. Activate the virtual environment -- this is important:
19+
```
20+
jupy312\Scripts\activate # Windows
21+
. jupy312/bin/activate # linux, macOS. Note leading dot.
22+
```
23+
Your terminal prompt should change to have a `(jupy312)` prefix.
24+
6. [Optional, but recommended] Upgrade `pip` to the latest version:
25+
```
26+
python.exe -m pip installl --upgrade pip # Windows
27+
python -m pip installl --upgrade pip # linux, macOS
28+
```
29+
7. Install `jupyterlab`:
30+
```
31+
pip install jupyterlab
32+
```
33+
8. Install the Dyalog kernel Python module:
34+
```
35+
pip install dyalog-jupyter-kernel
36+
```
37+
9. Register the kernel with Jupyter:
38+
```
39+
python -m 'dyalog_kernel' install
40+
```
41+
10. Start jupyterlab (or notebook):
42+
```
43+
cd path/to/my/notebooks/
44+
jupyter lab # or jupyter notebook
45+
```
46+
47+
Jupyter lab (and notebook) uses a web interface. It has a drop-down button labeled *New▾* where you can choose to create a new Dyalog APL notebook. You can also navigate to and click on any existing notebook (a file with the `.ipynb` extension) to open it.
48+
49+
## Troubleshooting
50+
51+
### Python is not found
52+
> If you get the message
53+
> ```
54+
> python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program.
55+
> ```
56+
> Run the installer again. Make sure to tick **Add Python to environment variables**
57+
58+
### Cannot assign requsted address
59+
> If you get the message
60+
> `OSError: [Errno 99] Cannot assign requested address`
61+
> try:
62+
> `jupyter-notebook --ip=0.0.0.0 --port=8080`
63+
> or some other port number.
64+
65+
## Entering APL characters
66+
67+
You can get an APL language bar and enable key-bindings and character compositions using just a [a bookmarklet](https://abrudz.github.io/lb/apl) (a browser bookmark that contains commands which add new features to the browser). After adding the bookmarklet to your language bar, and opening a Jupyter notebook document in your browser, click on the bookmarklet. You can now insert APL characters in three ways:
68+
69+
1. Click a symbol on the language bar.
70+
1. Type *Backtick* (`` ` ``) and then the associated symbol (hover over symbols on the language bar to see associations), e.g. *Backtick*+*r* makes `⍴` and *Backtick*+*Shift*+*e* makes `⍷`.
71+
1. Type two symbols which roughly make up the APL symbol, then press the *Tab* key to combine them. The two symbols are chosen to be easy to guess according to one of the following systems:
72+
1. The symbols roughly make up the APL symbol when overlaid. For example, `O-` *Tab* makes `⊖` and `A|`*Tab* makes `⍋`.
73+
1. The symbols roughly make up the APL symbol when juxtaposed. For example, `<>` *Tab* makes `⋄` and `[]` *Tab* makes `⎕`
74+
1. The symbols are identical, and are visually similar to the APL symbol. For example, `ee` makes `∊` and `xx` makes `×`.

0 commit comments

Comments
 (0)