Skip to content

Commit 6123d51

Browse files
author
Steven Silvester
authored
Merge pull request #171 from ktaletsk/master
Move to prebuilt extension system
2 parents e6b3c5f + aff8a02 commit 6123d51

38 files changed

+1673
-1474
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,48 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout
14-
uses: actions/[email protected]
15-
- name: Install node
16-
uses: actions/[email protected]
17-
with:
18-
node-version: '14.x'
19-
- name: Run a one-line script
20-
run: echo Hello, world!
21-
- name: Install dependencies
22-
run: python -m pip install -U jupyter_packaging~=0.10.4 jupyterlab~=3.0.16 pip wheel
13+
- name: Checkout
14+
uses: actions/[email protected]
15+
- name: Install node
16+
uses: actions/[email protected]
17+
with:
18+
node-version: '14.x'
19+
- name: Install Python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: '3.8'
23+
architecture: 'x64'
24+
25+
26+
- name: Setup pip cache
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/.cache/pip
30+
key: pip-3.8-${{ hashFiles('package.json') }}
31+
restore-keys: |
32+
pip-3.8-
33+
pip-
34+
35+
- name: Get yarn cache directory path
36+
id: yarn-cache-dir-path
37+
run: echo "::set-output name=dir::$(yarn cache dir)"
38+
- name: Setup yarn cache
39+
uses: actions/cache@v2
40+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
41+
with:
42+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43+
key: yarn-${{ hashFiles('**/yarn.lock') }}
44+
restore-keys: |
45+
yarn-
46+
47+
- name: Install dependencies
48+
run: python -m pip install -U jupyter_packaging~=0.10.4 jupyterlab~=3.0.16 pip wheel
49+
- name: Install the extension
50+
run: |
51+
set -eux
52+
python -m pip install .
53+
- name: Integration test
54+
run: |
55+
jupyter serverextension list 2>&1 | grep -ie "jupyterlab_latex.*OK"
56+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/latex.*OK"
57+

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
.ipynb_checkpoints/
12
*.bundle.*
3+
*.gz
4+
*.pdf
25
dist/
36
jupyterlab_latex.egg-info/
47
jupyterlab_latex/__pycache__/
8+
jupyterlab_latex/labextension/
59
lib/
6-
test/build/*
710
node_modules/
811
npm-debug.log
12+
test/build/*

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
node_modules
2-
**/lib
1+
**/lib/
2+
dist/
3+
jupyterlab_latex/labextension/
4+
node_modules/

README.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# JupyterLab LaTeX
22

3-
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-latex/master?urlpath=lab%2Ftree%2Fsample.tex)
3+
| build | stable | latest |
4+
| :---------------: | :------------------------------: | :------------------------------: |
5+
| [![ci-badge]][ci] | [![binder-badge]][binder-stable] | [![binder-badge]][binder-latest] |
6+
7+
[ci-badge]: https://github.com/jupyterlab/jupyterlab-latex/actions/workflows/build.yml/badge.svg
8+
[ci]: https://github.com/jupyterlab/jupyterlab-latex/actions/workflows/build.yml?query=branch/master
9+
[binder-badge]: https://mybinder.org/badge_logo.svg
10+
[binder-stable]: https://mybinder.org/v2/gh/jupyterlab/jupyterlab-latex.git/3.0.0?urlpath=lab/tree/sample.tex
11+
[binder-latest]: https://mybinder.org/v2/gh/jupyterlab/jupyterlab-latex.git/master?urlpath=lab/tree/sample.tex
412

513
An extension for JupyterLab which allows for live-editing of LaTeX documents.
614

@@ -17,7 +25,8 @@ For more advanced usage documentation, see [here](docs/advanced.md).
1725

1826
## Requirements
1927

20-
- JupyterLab 1.0
28+
- JupyterLab >= 3.0
29+
- older versions are supported in previous releases available on PyPI and npm, check [releases](https://github.com/jupyterlab/jupyterlab-latex/releases)
2130
- Python >= 3.6
2231
- An application that can compile `.tex` files to PDF (e.g., `pdflatex`, `xelatex`; use `pdflatex.exe` on Windows with MiKTeX). This application must be available as a command in the same environment as the notebook server.
2332
- An application that can process `.bib` files for producing bibliographies. As with the LaTeX command, this must be available in the same environment as the notebook server.
@@ -26,24 +35,40 @@ For more advanced usage documentation, see [here](docs/advanced.md).
2635

2736
This extension includes both a notebook server extension (which interfaces with the LaTeX compiler)
2837
and a lab extension (which provides the UI for the LaTeX preview).
29-
In order to use it, you must enable both of them.
38+
The Python package named `jupyterlab_latex` provides both of them as a prebuilt extension.
3039

31-
To install the server extension, run the following in your terminal:
40+
To install the extension, run the following in your terminal:
3241

3342
```bash
3443
pip install jupyterlab_latex
3544
```
3645

37-
If you are running Notebook 5.2 or earlier, enable the server extension by running
46+
### Check installation
47+
48+
To ensure that extension is properly installed, you could check server and lab extensions:
3849

3950
```bash
40-
jupyter serverextension enable --sys-prefix jupyterlab_latex
51+
jupyter server extension list
52+
```
53+
54+
and see the block like this in the output
55+
56+
```
57+
jupyterlab_latex enabled
58+
- Validating jupyterlab_latex...
59+
jupyterlab_latex 3.1.0 OK
4160
```
4261

43-
To install the lab extension, run
62+
then
4463

4564
```bash
46-
jupyter labextension install @jupyterlab/latex
65+
jupyter labextension list
66+
```
67+
68+
and see the block like this in the output
69+
70+
```
71+
@jupyterlab/latex v3.1.0 enabled OK (python, jupyterlab-latex)
4772
```
4873

4974
## Customization

RELEASE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Making a new release of jupyterlab_latex
2+
3+
The extension can be published to `PyPI` and `npm` using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
4+
5+
## Automated releases with the Jupyter Releaser
6+
7+
The extension repository should already be compatible with the Jupyter Releaser.
8+
9+
Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
10+
11+
Here is a summary of the steps to cut a new release:
12+
13+
- Fork the [`jupyter-releaser` repo](https://github.com/jupyter-server/jupyter_releaser)
14+
- Add `ADMIN_GITHUB_TOKEN`, `PYPI_TOKEN` and `NPM_TOKEN` to the Github Secrets in the fork
15+
- Go to the Actions panel
16+
- Run the "Draft Changelog" workflow
17+
- Merge the Changelog PR
18+
- Run the "Draft Release" workflow
19+
- Run the "Publish Release" workflow
20+
21+
## Publishing to `conda-forge`
22+
23+
If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html
24+
25+
Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.

binder/postBuild

100755100644
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
#!/bin/bash
2-
3-
jupyter labextension install @jupyterlab/[email protected]
1+
#!/usr/bin/env bash
2+
python -m pip install .

binder/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
jupyterlab==0.35
2-
jupyterlab_latex==0.4.1
3-
notebook==6.1.5
1+
jupyter_packaging ~=0.10,<2
2+
jupyterlab ~=3.0
3+
setuptools
4+
nbgitpuller

docs/advanced.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,28 @@ From the `jupyterlab-latex` directory, enter the following into your terminal:
3737
pip install -e .
3838
```
3939

40-
This installs the server extension.
40+
Link your development version of the extension with JupyterLab
4141

42-
If you are running Notebook 5.2 or earlier, enable the server extension by running
42+
```bash
43+
jupyter labextension develop . --overwrite{% if cookiecutter.has_server_extension.lower().startswith('y') %}
44+
```
45+
46+
Server extension must be manually installed in develop mode
4347
4448
```bash
45-
jupyter serverextension enable --sys-prefix jupyterlab_latex
49+
jupyter server extension enable {{ cookiecutter.python_name }}{% endif %}
4650
```
4751
48-
Then, to install the lab extension, run
52+
Rebuild extension Typescript source after making changes
4953
5054
```bash
51-
jlpm install
5255
jlpm run build
53-
jupyter labextension install .
5456
```
57+
58+
You can build a Python wheel for testing the distribution
59+
60+
```bash
61+
python setup.py sdist bdist_wheel
62+
```
63+
64+
The wheel and the source archive will be created in `dist/` directory.

docs/changelog.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog for `jupyterlab_latex`
22

3+
- **3.1.0**:
4+
5+
- Switch to prebuilt (federated) extension model
6+
- Fix bug with icons visibility in the dark theme
7+
8+
- **3.0.0**:
9+
10+
- Update to JupyterLab 3.0
11+
- Add LaTeX file menu
12+
- Add download PDF button
13+
14+
- **v2.0.0**:
15+
16+
- Update to JupyterLab 2.0
17+
18+
- **v1.0.0**:
19+
20+
- Update to JupyterLab 1.0
21+
322
- **0.6.1**:
423

524
- Added a new page component allowing the user to navigate PDFs by page label.

install.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"packageManager": "python",
3+
"packageName": "jupyterlab-latex",
4+
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab-latex"
5+
}

0 commit comments

Comments
 (0)