Plugin for safe text editing with MKDocs.
Project description
# mkdocs-safe-text-plugin
[![Build Status](https://travis-ci.org/raimon49/mkdocs-safe-text-plugin.svg?branch=master)](https://travis-ci.org/raimon49/mkdocs-safe-text-plugin)
[![PyPI version](https://badge.fury.io/py/mkdocs-safe-text-plugin.svg)](https://badge.fury.io/py/mkdocs-safe-text-plugin)
[![Codecov](https://codecov.io/gh/raimon49/mkdocs-safe-text-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/raimon49/mkdocs-safe-text-plugin)
[![BSD License](http://img.shields.io/badge/license-BSD-green.svg)](LICENSE)
[![Requirements Status](https://requires.io/github/raimon49/mkdocs-safe-text-plugin/requirements.svg?branch=master)](https://requires.io/github/raimon49/mkdocs-safe-text-plugin/requirements/?branch=master)
Plugin for safe text editing with [MKDocs](http://www.mkdocs.org/).
## Table of Contents
* [How does this plugin work?](#how-does-this-plugin-work)
* [Installation](#installation)
* [Plugin configuration](#plugin-configuration)
* [License](#license)
## How does this plugin work?
Markdown is a very flexible format, and raw HTML is allowed. But it is unnecessary in multiple-person text editing.
When raw HTML like `<font>` tag is used in MKDocs, it is rendered as it is.
![no\_escape\_font](https://user-images.githubusercontent.com/221802/35481481-ac9e4894-0467-11e8-89ab-47ca5037d9d2.png)
If you use this plug-in with MKDocs, tags that are not allowed in the whitelist are escaped.
![escape\_font](https://user-images.githubusercontent.com/221802/35481484-b268e02c-0467-11e8-8b7a-c3c7232312ed.png)
## Installation
Install it via PyPI using `pip` command.
```console
$ pip install mkdocs-safe-text-plugin
```
And add it to your `mkdocs.yml` file.
```yaml
plugins:
- mkdocs_safe_text
```
An example of use can be checked by [example/basic-usage](examples/basic-usage).
## Plugin configuration
This plugin works with the HTML tag element for Markdown defined by [bleach-whitelist](https://github.com/yourcelf/bleach-whitelist/blob/master/bleach_whitelist/bleach_whitelist.py) enabled. This implementation approach is recommended in [the Python-Markdown release notes](https://python-markdown.github.io/change_log/release-2.6/).
And user can change this setting.
```yaml
plugins:
- mkdocs_safe_text:
append_allowed_tags:
- tag1
- tag2
remove_allowed_tags:
- tag3
- tag4
allowed_attrs:
tag5:
- attribute1
- attribute2
```
An example of use can be checked by [example/customization-usage](examples/customization-usage).
## License
[BSD 2-Clause License](LICENSE)
[![Build Status](https://travis-ci.org/raimon49/mkdocs-safe-text-plugin.svg?branch=master)](https://travis-ci.org/raimon49/mkdocs-safe-text-plugin)
[![PyPI version](https://badge.fury.io/py/mkdocs-safe-text-plugin.svg)](https://badge.fury.io/py/mkdocs-safe-text-plugin)
[![Codecov](https://codecov.io/gh/raimon49/mkdocs-safe-text-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/raimon49/mkdocs-safe-text-plugin)
[![BSD License](http://img.shields.io/badge/license-BSD-green.svg)](LICENSE)
[![Requirements Status](https://requires.io/github/raimon49/mkdocs-safe-text-plugin/requirements.svg?branch=master)](https://requires.io/github/raimon49/mkdocs-safe-text-plugin/requirements/?branch=master)
Plugin for safe text editing with [MKDocs](http://www.mkdocs.org/).
## Table of Contents
* [How does this plugin work?](#how-does-this-plugin-work)
* [Installation](#installation)
* [Plugin configuration](#plugin-configuration)
* [License](#license)
## How does this plugin work?
Markdown is a very flexible format, and raw HTML is allowed. But it is unnecessary in multiple-person text editing.
When raw HTML like `<font>` tag is used in MKDocs, it is rendered as it is.
![no\_escape\_font](https://user-images.githubusercontent.com/221802/35481481-ac9e4894-0467-11e8-89ab-47ca5037d9d2.png)
If you use this plug-in with MKDocs, tags that are not allowed in the whitelist are escaped.
![escape\_font](https://user-images.githubusercontent.com/221802/35481484-b268e02c-0467-11e8-8b7a-c3c7232312ed.png)
## Installation
Install it via PyPI using `pip` command.
```console
$ pip install mkdocs-safe-text-plugin
```
And add it to your `mkdocs.yml` file.
```yaml
plugins:
- mkdocs_safe_text
```
An example of use can be checked by [example/basic-usage](examples/basic-usage).
## Plugin configuration
This plugin works with the HTML tag element for Markdown defined by [bleach-whitelist](https://github.com/yourcelf/bleach-whitelist/blob/master/bleach_whitelist/bleach_whitelist.py) enabled. This implementation approach is recommended in [the Python-Markdown release notes](https://python-markdown.github.io/change_log/release-2.6/).
And user can change this setting.
```yaml
plugins:
- mkdocs_safe_text:
append_allowed_tags:
- tag1
- tag2
remove_allowed_tags:
- tag3
- tag4
allowed_attrs:
tag5:
- attribute1
- attribute2
```
An example of use can be checked by [example/customization-usage](examples/customization-usage).
## License
[BSD 2-Clause License](LICENSE)
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
Close
Hashes for mkdocs-safe-text-plugin-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ee6efd1913ae0cda50b333d27f29eaca54e9dd5e9c435bb099b2b05889a0892 |
|
MD5 | ca06f876bf4f6b6587f990421523a975 |
|
BLAKE2b-256 | 83dc358e985d60304918d5694d0c03d15dc078f7ae4b46d4fca207f7146e015d |
Close
Hashes for mkdocs_safe_text_plugin-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5970e4764fab4b04b0dcf328a0623e05958930b9d17e57cda95f2c539fb304f |
|
MD5 | a20f3f42edce4a21ce370256a52e8ea4 |
|
BLAKE2b-256 | d3bed214583f64e44b6a2638d33ba08932984e217020e38cf79d799275c32bb1 |