Build static sites for paralex lexicons
Project description
This package is currently in beta. It is meant to render paralex lexicon files in mkdocs sites.
Installing
pip install mkdocs_paralex_plugin
Mkdocs
Create a configuration file for mkdocs, compatible with mkdocs-material.
It needs a special paralex
section, with minimally a paralex_package_path
(to the json file), lists of feature labels to use to separate tables, rows and columns. It can contain
site_name: "My site name"
docs_dir: docs
plugins:
- paralex:
paralex_package_path: "<name>.package.json"
layout_tables:
- mood
layout_rows:
- person/number
layout_columns:
- tense
repo_url: https://gitlab.com/<user>/<repo>
If your lexicon is massive, the generated site might exceed the free hosting capacity on gitlab or github. You can then add two more keys under the paralex section. If sample_size
is set, the corresponding number of lexemes will be selected, and the site will only show that sample. If frequency_sample
is set to true
, then the chosen lexemes will be the most frequent.
site_name: "My site name"
docs_dir: docs
plugins:
- paralex:
paralex_package_path: "<name>.package.json"
sample_size: 5000
frequency_sample: true
layout_tables:
- mood
layout_rows:
- person/number
layout_columns:
- tense
repo_url: https://gitlab.com/<user>/<repo>
Generating the site in a pipeline
To generate the site, add a pipeline file:
=== "gitlab pages"
With gitlab, create a plain text file called `.gitlab-ci.yml`, with the following content. The site will then be served at `https://<username>.gitlab.io/<repository-name>`. For more on gitlab pages, see [the gitlab pages docs](https://docs.gitlab.com/ee/user/project/pages/).
``` yaml title=".gitlab-ci.yml"
image: python:3.8
pages:
stage: deploy
script:
- mkdir -p docs/
- pip install pandas mkdocs>=1.1.2 mkdocs-material mkdocs_paralex_plugin
- mkdocs build -d public/ --strict --verbose
artifacts:
paths:
- public/
only:
- master
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mkdocs_paralex_plugin-0.1.4b0.tar.gz
.
File metadata
- Download URL: mkdocs_paralex_plugin-0.1.4b0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2bfc967f4d7e48ea88976e43b609f3694ceb048526c038d36acaf3c5882fc9b |
|
MD5 | db189bc5cd821649cc05bdf2e89e78e1 |
|
BLAKE2b-256 | 36bacff1c311bdb15a13f9ec6a754cc0231c360bc6bfc1226aad0bcfe616b690 |
File details
Details for the file mkdocs_paralex_plugin-0.1.4b0-py2.py3-none-any.whl
.
File metadata
- Download URL: mkdocs_paralex_plugin-0.1.4b0-py2.py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0921d9d0969d02d53d02ff5fe1b26400d3d5fcd14c663ff1fbfdcd162d225b4 |
|
MD5 | 82824df01a512650d726ce5f2abf2486 |
|
BLAKE2b-256 | 7adfa5d0dd2b850cdc037747c99714b96cd566f26841801cf26a19ddf3b00ae4 |