https://github.com/highlightjs/hljs_org
The official highlight.js website.
https://github.com/highlightjs/hljs_org
Last synced: 6 months ago
JSON representation
The official highlight.js website.
- Host: GitHub
- URL: https://github.com/highlightjs/hljs_org
- Owner: highlightjs
- Created: 2020-06-29T04:22:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-16T14:29:28.000Z (about 3 years ago)
- Last Synced: 2024-03-25T19:59:39.745Z (over 1 year ago)
- Language: Python
- Homepage: https://highlightjs.org/
- Size: 338 KB
- Stars: 0
- Watchers: 8
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# highlight.js Web site
## Development
The site is a pretty standard Django application. Some interesting parts:
- `hljs_org/settings.py` — default project settings. Those that are read from `env(...)` can be overwritten by env vars.
- `hljs_org/management/commands/updatehljs.py` — deployment script that can be run both manually and as a reaction on a GitHub webhook posting to `/api/release/`.
- `hljs_org/views.py::release()` — GitHub webhook end point.
- `hljs_org/lib.py` — logic for working with the highlight.js source directory (parsing versions, readme, building a .zip archive for download, etc.)
(There are indeed no tests. Never needed them for this project :-) )
## Local installation
### System requirements
- Python 3.6+
- dev package for libmemcached
On a Mac:
```sh
brew install libmemcached
```
On a Debian family Linux:
```sh
sudo apt install libmemcached-dev
```
**Alternatively**, comment out `pylibmc` in requirements.txt, it should work without a cache.
- Local PostgreSQL. Installation is left as an exercise for the reader. Also feel free to change `hljs_org/settings.py` to use something simpler, the code only uses very basic SQL.
Create the database with `createdb hljs_org`.
### App
Installation:
```sh
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
./manage.py migrate
```
Running:
```
./manage.py runserver
```
Note, the site needs access to a checkout of highlight.js itself, which it expects to be at `../highlight.js` by default. You can override the location via an env var `HLJS_SOURCE`. Also, refer to `hljs_org/settings.py` for other tweakable settings.
## Production deployment
Deployment is done manually by the current owner of highlightjs.org, all the configs are outside of this repo.