Display External Markdown Content In Modals – mdModal

Category: Javascript , Modal & Popup | March 30, 2024
Author:itshnawy
Views Total:11 views
Official Page:Go to website
Last Update:March 30, 2024
License:MIT

Preview:

Display External Markdown Content In Modals – mdModal

Description:

modal is a dynamic modal library that fetches content from an external Markdown file (.md) and then displays it in a customizable modal window.

This can be useful for displaying documentation, instructions, tutorials, terms and conditions, or any text-based information in a clean, readable format.

How to use it:

1. Load the minified version of the mdModal library in the document.

<script src="dist/mdModal.min.js"></script>

2. Initialize the mdModal and specify the path to the markdown file.

mdModal(
  src = '/path/to/readme.md'
)

3. Available parameters to customize the markdown modal.

  • dir: ‘ltr” or “rtl”
  • header: Modal Title
  • bg: Background color
  • fontSrc: Path to the font
  • fontName: Font name
mdModal(
  src,
  dir = "ltr",
  header = "",
  bg = "#ffffff",
  fontSrc = "./assets/addon/fonts.css",
  fontName = "Tajawal",
}

Changelog:

03/30/2024

  • Update JS

You Might Be Interested In:


Leave a Reply