Skip to content
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

draft windows instructions #642

Merged
merged 5 commits into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/advanced/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,68 @@ html:
The contents of `extra_navbar` will be inserted into your page's HTML after
all other html content.

(working-on-windows)=
## Working on Windows

As of June 5, 2020, there are three open issues that require Windows-specific changes.
Work to complete windows compatibility is underway, in the meantime we provide these
community tips, which are known to work for some users. Note that there is no
guarantee that they will work on all windows installations.

1. Character encoding

Jupyter-book currently reads and writes files on windows in the native windows
encoding, which causes encoding errors for some characters in UTF-8 encoded
notebooks.

**Work-around:** Beginning with
[Python 3.7](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUTF8)
cmd.exe or powershell enviroments that set PYTHONUTF8=1 override the native
locale encoding and use UTF8 for all input/output.

```{tip}
To make it easier to use
this option, the EOAS/UBC notebook courseware project has created a conda package
[runjb](https://anaconda.org/eoas_ubc/runjb) which
[does this automatically for powershell](https://github.com/eoas-ubc/eoas_tlef/blob/master/converted_docs/wintools/binwin/runjb.ps1)
```

2. A new windows event loop

The asyncio event loop [has been changed for Python 3.8](https://github.com/sphinx-doc/sphinx/issues/7310)
causing sphinx-build to fail.

**Work-around:** Pin to Python 3.7.6. This
[environment_win.yml](https://github.com/eoas-ubc/quantecon-mini-example/blob/windows/environment_win.yml)
file does that, and also installs runjb to fix issue 1.

3. Nested tables of contents

Currently, `_toc.yml` files that reference markdown files
in subfolders are failing for some windows users. That is, this
[original _toc.yml](https://github.com/eoas-ubc/quantecon-mini-example/blob/master/mini_book/_toc.yml)
file will fail with a message saying jupyter-book "```cannot find index.md```"

**Work-around**: Flatten the layout of the book to a single level, i.e.
[this _toc.yml](https://github.com/eoas-ubc/quantecon-mini-example/blob/windows/mini_book/docs/_toc.yml)
file works with windows.

**Summary**

The following workflow should succeed using a miniconda powershell terminal on Windows 10:

1. `conda install git`
2. `git clone https://github.com/eoas-ubc/quantecon-mini-example.git`
3. `cd quantecon-mini-example`
4. `git checkout windows`
5. `conda env create -f environment_win.yml`
6. `conda activate wintest`
7. `cd mini_book`
8. `runjb docs`

After the build, view the html with:

`start docs\_build\html\index.html`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the extra whitespace so there are only 2 spaces max?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think I've addressed comments -- re nested _toc.yml, curently getting an MRE so I can run side by side on window and wsl2 -- has to be something fairly simple.

## What if I have an issue or question?

Expand Down