Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_paralex_plugin-0.1.1b0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

mkdocs_paralex_plugin-0.1.1b0-py2.py3-none-any.whl (24.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mkdocs_paralex_plugin-0.1.1b0.tar.gz.

File metadata

File hashes

Hashes for mkdocs_paralex_plugin-0.1.1b0.tar.gz
Algorithm Hash digest
SHA256 132e10977657e08051c8ffd09fe6356ab259d504bf25c21ce8dbd3d198c17f98
MD5 74494239e8960fc84c95dbb646315201
BLAKE2b-256 b84127598f38ea951ca221b25f5b9ea38a5dd51e0b71f033c368e8a9195ad8c1

See more details on using hashes here.

File details

Details for the file mkdocs_paralex_plugin-0.1.1b0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_paralex_plugin-0.1.1b0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d6d9c62dd431aefdaeb0cf158e0e746761f8e9f4f09325bf6b8d7dc197547bbe
MD5 a75f50511d4b9fbcbcb8fbfaaf162c65
BLAKE2b-256 235f47fa58607c0993b781605a00b6c554fb68f5cb753c2c1c04895451eca547

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page