Sympli integration preprocessor for Foliant.
Project description
BindSympli
BindSympli is a tool to download design layout images from Sympli CDN using certain Sympli account, to resize these images, and to bind them with the documentation project.
Installation
Before using BindSympli, you need to install Node.js, Puppeteer, wget, and ImageMagick.
BindSympli preprocessor code is written in Python, but it uses the external script written in JavaScript. This script is provided in BindSympli package:
$ pip install foliantcontrib.bindsympli
Config
To enable the preprocessor, add bindsympli
to preprocessors
section in the project config:
preprocessors:
- bindsympli
The preprocessor has a number of options with the following default values:
preprocessors:
- bindsympli:
get_sympli_img_urls_path: get_sympli_img_urls.js
wget_path: wget
convert_path: convert
cache_dir: !path .bindsymplicache
sympli_login: ''
sympli_password: ''
image_width: 800
max_attempts: 5
get_sympli_img_urls_path
: Path to the script get_sympli_img_urls.js
or alternative command that launches it (e.g. node some_another_script.js
). By default, it is assumed that you have this command and all other commands in PATH
.
wget_path
: Path to wget
binary.
convert_path
: Path to convert
binary, a part of ImageMagick.
cache_dir
: Directory to store downloaded and resized images.
sympli_login
: Your username in Sympli account.
sympli_password
: Your password in Sympli account.
image_width
: Width of resulting images in pixels (original images are too large).
max_attempts
: Maximum number of attempts to run the script get_sympli_img_urls.js
on fails.
Usage
To insert a design layout image from Sympli into your documentation, use <<sympli>...</sympli>
tags in Markdown source:
Here’s an image from Sympli:
<<sympli caption="An optional caption" width="400" url="https://app.sympli.io/app#!/designs/0123456789abcdef01234567/specs/assets"></sympli>
You have to specify the URL of Sympli design layout page in url
attribute.
You may specify an optional caption in the caption
attribute, and an optional custom image width in the width
attribute. The width
attribute overrides the image_width
config option for a certain image.
BindSympli preprocessor will replace such blocks with local image references.
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 foliantcontrib.bindsympli-1.0.14.tar.gz
.
File metadata
- Download URL: foliantcontrib.bindsympli-1.0.14.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ee38f031261b9bdbfadde9ad0232eae56f10a0d5f63205f4935413c47e0c88 |
|
MD5 | 1a02f8de433b17a7c05714440a8f68a0 |
|
BLAKE2b-256 | bd438377c6f9c986ba9c31512b73c8ffbb408d8c58c0610a80997bdedd79007e |
File details
Details for the file foliantcontrib.bindsympli-1.0.14-py3-none-any.whl
.
File metadata
- Download URL: foliantcontrib.bindsympli-1.0.14-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98b761f8a8897fa4183c2ab1e05ab97c390bfbc076d7804ee21ba1d69e009c13 |
|
MD5 | eb99c744d8b81656784006f7a63d5b85 |
|
BLAKE2b-256 | a05c4155bef6640e4f63eab5bd3fe2d11bb2c64f18e4314049ef34db25f8af53 |