Skip to content

A simple Kodi library to convert Markdown to Kodi GUI formatted text

License

Notifications You must be signed in to change notification settings

retrospect-addon/script.module.markdown

Repository files navigation

Markdown-to-Kodi formatted text

GitHub release (latest by date) GitHub Workflow Status (branch) Quality Gate Status License Python

This simple library for Kodi converts basic Markdown to valid Kodi formatted text (See here).

Supported Markdown Syntax

The basic Markdown syntax is supported. The aim is to eventually also support the majority of the GitHub flavoured markdown. A cheatsheet can be found at GitHub.

Basic Markdown Syntax

The following table has an overview of the supported syntax:

Description Markdown Kodi formatted text
Heading 1 # [B][LIGHT][UPPERCASE]
Heading 2 ## [B][LIGHT][CAPITALIZE]
Heading 3 ### [LIGHT][CAPITALIZE]
Heading 4 #### [LIGHT][CAPITALIZE]
Bold **bold** or __bold__ [B]bold[/B]
Italic *bold* or _bold_ [I]bold[/I]
Link [text](url) [COLOR blue]text[/COLOR]
Image ![text](url) [COLOR yellow][text][/COLOR]

Lists

Ordered and unordered lists are supported. However, ordered lists need to have proper numbering. Output for numbered lists is:

1. Ordered List Level 1         |    1. Ordered List Level 1
2. Ordered List Level 1         |    2. Ordered List Level 1
  1. Ordered List Level 2       |      1. Ordered List Level 2
  2. Ordered List Level 2       |      2. Ordered List Level 2

For unordered lists, the chars *, + and - can be used. The Kodi formatted output will be:

- Unordered Level 1             |    • Ordered List Level 1
+ Unordered  Level 1            |    • Ordered List Level 1
* Unordered Level 1             |    • Ordered List Level 1
  + Unordered Level 2           |      - Ordered List Level 2
  - Unordered List Level 2      |      - Ordered List Level 2
  * Unordered List Level 2      |      - Ordered List Level 2

List styles can be combined:

- Unordered Level 1             |    • Ordered List Level 1
- Unordered Level 1             |    • Ordered List Level 1
  1. Ordered List Level 2       |      1. Ordered List Level 2
  2. Ordered List Level 2       |      2. Ordered List Level 2

Not Supported:

Description Remark
Tables Will be removed completely.
Images Replaced with the alt text: [alt text](actual url)
Links Will be replaced with the their corresponding text.

About

A simple Kodi library to convert Markdown to Kodi GUI formatted text

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages