Some fixes to jupyter docs

This commit is contained in:
Griatch 2020-12-20 14:03:03 +01:00
parent 358fc8ff0e
commit 1cccc527fd
2 changed files with 21 additions and 14 deletions

View file

@ -25,7 +25,7 @@ are some simple commands to get started:
# [open a new console/terminal] # [open a new console/terminal]
# [activate your evennia virtualenv in this console/terminal] # [activate your evennia virtualenv in this console/terminal]
pip install ipython # [only needed the first time] pip install -r requirements_extra.txt # install ipython etc
cd mygame cd mygame
evennia shell evennia shell
@ -40,36 +40,43 @@ info on how to explore it efficiently.
#### Jupyter Notebook Support #### Jupyter Notebook Support
You can now explore evennia interactively with jupyter notebooks. There are a few extra steps that must be taken in order for this to work: You can also explore evennia interactively in a [Jupyter notebook](https://jupyter.readthedocs.io/en/latest/index.html#). This offers
an in-browser view of your code similar to Matlab or similar programs. There are
a few extra steps that must be taken in order for this to work:
# [open a new console/terminal] # [open a new console/terminal]
# [activate your evennia virtualenv in this console/terminal] # [activate your evennia virtualenv in this console/terminal]
cd evennia cd evennia
pip install -r requirements_extra.txt # this installs optional, but necessary modules for this to work. pip install -r requirements_extra.txt # if not done already above
cd mygame # make sure you are in root of your grame
evennia shell_plus --notebook& # this will start the notebook in the background
Open an existing, or create, a notebook and in the first cell you must run: Next, `cd` to your game folder. _It's important that you are in the _root_ of this folder for the next command_:
evennia shell_plus --notebook &
The `&` at the end starts the process as a background process on Linux/Unix.
Skip it if your OS doesn't support this syntax. Your browser should now open
with the Jupyter interface. If not, open a browser to the link given on the
command line.
In the window, open the `new` menu in the top right and start a `Django Shell-Plus` notebook (or
open an existing one if you had one from before). In the first cell you must initialize
Evennia like so:
```python ```python
import evennia import evennia
evennia._init() evennia._init()
``` ```
This will initialize all module level variables located in `evennia.__init__`. _Note that the above initialization must be run every time a new new notebook/kernel is started or restarted._
Now you have the same support as `evennia shell`, but in a more visual and persistent form.
*It is important to remember, everytime the kernel restarts within a notebook you must first run After this you can import and access all of the Evennia system, same as with `evennia shell`.
`evennia._init()`*
#### More exploration
You can complement your exploration by peeking at the sections of the much more detailed You can complement your exploration by peeking at the sections of the much more detailed
[Evennia Component overview](../Components/Components-Overview). The [Tutorials](../Howto/Howto-Overview) section also contains a growing collection [Evennia Component overview](../Components/Components-Overview). The [Tutorials](../Howto/Howto-Overview) section also contains a growing collection
of system- or implementation-specific help. of system- or implementation-specific help.
### Use a python syntax checker ### Use a python syntax checker
Evennia works by importing your own modules and running them as part of the server. Whereas Evennia Evennia works by importing your own modules and running them as part of the server. Whereas Evennia

View file

@ -1,5 +1,5 @@
# Toc # Toc
- [API root](api/evennia-api.rst)
- [Coding/Coding Introduction](Coding/Coding-Introduction) - [Coding/Coding Introduction](Coding/Coding-Introduction)
- [Coding/Coding Overview](Coding/Coding-Overview) - [Coding/Coding Overview](Coding/Coding-Overview)
- [Coding/Continuous Integration](Coding/Continuous-Integration) - [Coding/Continuous Integration](Coding/Continuous-Integration)