Skip to main content

A MkDocs plugin to import LeanIX data

Project description

MkDocs LeanIX Plugin

This is a plugin for MkDocs to display data from LeanIX.

Setup

Install the plugin using pip:

pip install mkdocs-leanix-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - leanix  

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation.

Configuration

  • api_token - The API token
  • base_url - Base URL of your LeanIX instance. Can be https://yourorganization.leanix.net
  • material [optional] - Set this to true if the material design template should be used. This requires the pymdownx.tabbed extension to be enabled

Alternatively to the api_token in the mkdocs.yml a environment variable called LEANIX_API_TOKEN can be set. This is likely the way in CI/CD scenarios.

Workspace information (name and id) is retrived from the JWT token.

Sample

plugins
  - leanix:
      api_token: asdfsa23kjlsadflkjsalkjf3 # or LEANIX_API_TOKEN environment variable
      base_url: https://yourcompany.leanix.net/
      workspace_name: test

Usage

Simply create a code block of the type leanix-factsheet and insert the GUID of the factsheet to be shown:

Sample

```leanix-factsheet
d3bdeca8-8f79-4ee9-af4b-e390accf9f3d
```

Customization

Own templates can be used. Add the path to the template after the factsheet GUID. The template must be inside the docs directory.

```leanix-factsheet
d3bdeca8-8f79-4ee9-af4b-e390accf9f3d
templates/custom_factsheet.jinja2
```

Get some inspiration of the packed templates. A factsheet object will be provided as fs and can be printed out with {{ fs }}. Two helper functions are provided:

  • get_user(userid) - Gets friendly username from LeanIX and creates a Markdown mailto-link.
  • get_font_color(backgroundColor) - Gets a black or white CSS color from a provided CSS background color. Can be used to ensure enough contrast between text and background color.

Screenshots

Overview

Overview

Documents

Documents

Subscriptions

Subscriptions

Lifecycle

Lifecycle

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-leanix-plugin-1.0.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_leanix_plugin-1.0.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs-leanix-plugin-1.0.2.tar.gz.

File metadata

  • Download URL: mkdocs-leanix-plugin-1.0.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for mkdocs-leanix-plugin-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a7d5fc16c9348a10a71fb6f1dc125ce2fea3b55dc01ab3eb60fe33dd1a0e2365
MD5 30f8229d50a8ec422044f32ce9798949
BLAKE2b-256 eee06075705ed4e70edc2e993b8661a101b70923b2ef3a04a9284793d0ff9a2e

See more details on using hashes here.

File details

Details for the file mkdocs_leanix_plugin-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_leanix_plugin-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for mkdocs_leanix_plugin-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3c6d2132549e2432fd361cb390d3b792181f65858ad94238ae3c247fc0b3b7f9
MD5 ac738f7cb6c52b0deeb759a8b6b42a3b
BLAKE2b-256 10bcbe1b26b02c8238fe127fca41d302ef9b00ecba712d205c70ef40627e92f8

See more details on using hashes here.

Supported by

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