-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from nmfs-opensci/eeholmes-patch-1
add jupyterlab-quarto
- Loading branch information
Showing
24 changed files
with
1,140 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Publishing | ||
|
||
py-rocket-base has a number of packages to help with creation of documentation, books and webpages from content: Sphinx, Quarto, and Myst. Pandoc is installed which allows output to many different formats including html, Word, markdown and PDF. TexLive (for PDF output) is installed with tlmgr to handle package installation. | ||
|
||
## Quarto | ||
|
||
![](assets/quarto-illustration.png) | ||
|
||
Quarto is a full-feature platform for creation of documents, books and webpages in a variety of formats. Explore the documentation at [https://quarto.org/](https://quarto.org/). You can use Quarto in JupyterLab, RStudio or VSCode. RStudio has the most featured integration followed by VSCode. JupyterLab integration is somewhat minimal. | ||
|
||
### RStudio | ||
|
||
Quarto is fully integrated with RStudio. Use the Render and Build buttons. | ||
|
||
**Special note regarding creating pdfs** | ||
|
||
Rendering to PDF or `format: pdf` should work fine and packages will be installed on the fly. But the package installations will not persist and you will need to install them again after you restart the server. | ||
|
||
### VSCode | ||
|
||
The VSCode Quarto extension is installed. This provides many nice features. Read about them on the Quarto [VSCode](https://quarto.org/docs/tools/vscode.html) page. The extension includes keyboard shortcuts for rendering or you can render from a terminal. | ||
|
||
### Jupyter Lab | ||
|
||
The `jupyterlab-quarto` package is installed which allows Quarto markdown to be rendered in markdown cells in Jupyter notebooks (ipynb). But you will need to render from a terminal. Quarto render both `qmd` and `ipynb` files. Read about using Quarto with JupyterLab on this Quarto [page](https://quarto.org/docs/tools/jupyter-lab.html). For example, | ||
|
||
``` | ||
quarto render --to pdf test.qmd | ||
quarto render --to html test.ipynb | ||
``` | ||
|
||
For PDF output, TexLive packages will not install on the fly and you will need to do `tlmgr install packagename` for any missing package errors you get. | ||
|
||
## MyST | ||
|
||
<div> | ||
<div style="float: right; position: relative; top: 0px; padding: 2px;"> | ||
![](assets/myst.svg){width=200px} | ||
</div> | ||
|
||
[MyST](https://mystmd.org/) is an Python ecosystem of tools for creating interactive scientific publications for the web or export to PDF, LaTeX and Microsoft Word. [jupyterlab-myst](https://jupyter-book.github.io/jupyterlab-myst/) extension is installed. Read more about MyST in JupyterLab [here](https://mystmd.org/guide/quickstart-jupyter-lab-myst). The [MyST VSCode extension](https://marketplace.visualstudio.com/items?itemName=ExecutableBookProject.myst-highlight) is also installed if you are editting MyST markdown in VSCode. | ||
</div> | ||
|
||
**Creating PDFs with Myst** | ||
|
||
You can output to PDF like so from a terminal: `jupyter nbconvert --to pdf test.ipynb`. | ||
However. TexLive packages will not install on the fly and you will need to do `tlmgr install packagename` for any missing package errors you get. | ||
|
||
## Sphinx | ||
|
||
<div> | ||
<div style="float: right; position: relative; top: 0px; padding: 2px;"> | ||
![](assets/sphinx.png){width=200px} | ||
</div> | ||
|
||
[Sphinx](https://www.sphinx-doc.org/en/master/) is a commonly used package for creating documentation for Python packages. | ||
</div> | ||
|
||
## TexLive | ||
|
||
<div> | ||
<div style="float: right; position: relative; top: 0px; padding: 2px;"> | ||
![](assets/texlive.png) | ||
</div> | ||
|
||
py-rocket-base has Quarto and Myst installed along with pandoc and TeXLive for output to PDF. The tlmgr is used (and must be used) to manage packages. | ||
|
||
</div> | ||
|
||
|
||
### Installing new TexLive packages | ||
|
||
tlmgr must be used. | ||
|
||
* Do not use `apt-get` to install texlive packages. This will turn off tlmgr (the TeX package manager). Instead use | ||
``` | ||
tlmgr install <package> | ||
``` | ||
* Run `tlmgr option` to make sure tlmgr is working. | ||
|
||
Unfortunately any packages you install will be in the `/opt` directory and this gets recreated every time you restart your server. So if you need a | ||
particular package you will need to keep installing it. Or create your own image based on py-rocket-base: | ||
|
||
Dockerfile | ||
``` | ||
FROM ghcr.io/nmfs-opensci/py-rocket-base:latest | ||
RUN tlmgr install collection-latexrecommended && tlmgr clean --all | ||
``` | ||
|
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.