Skip to content

Fix installation with Poetry #1

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
build/
dist/
__pycache__/
.venv
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,66 @@ This package provides a copy of MathJax, a JavaScript library for
displaying mathematics on the web, packaged for use with the Django
web framework.

## Installation and usage

To use MathJax with Django:

1. Install this package.

For instance, if you use Poetry, add this line in the `[tool.poetry.dependencies]` section of your pyproject.toml:

django-static-mathjax = {git = "https://github.com/MIT-LCP/django-static-mathjax", branch="master"}

2. Add `'mathjax'` to your list of `INSTALLED_APPS`.

3. Add a script tag to your page templates, such as:

```
<script src="{% static 'mathjax/es5/tex-mml-chtml.js' %}"></script>
```

For more information about MathJax, refer to https://www.mathjax.org/.

For more information about Django, refer to https://www.djangoproject.com/.

## Contributing

1. [Install npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) if not already installed, for instance:

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
nvm install node
```

2. Clone this project with the mathjax submodule:

```
git clone --recurse-submodules https://github.com/MIT-LCP/django-static-mathjax
```

3. Create and source your Python virtual environment:

```
cd django-static-mathjax
python -m venv .venv
source .venv/bin/activate
```

4. Ensure pip and setuptool are up-to-date:

```
pip install --upgrade pip
pip install --upgrade setuptools
```

5. Install django-static-mathjax module:

```
pip install .
```

6. Eventually update the dependencies in the pyproject.toml of your projects using django-static-mathjax in order to look at the local folder, for instance:

```
django-static-mathjax = {path = "../django-static-mathjax", develop = true}
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ readme = "README.md"
maintainers = [
{name = "Benjamin Moody", email = "[email protected]"},
]
license = "Apache-2.0"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: JavaScript",
"Topic :: Text Processing :: Markup :: LaTeX",
]
Expand Down