Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdzjs

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdzjs

```bash npm i mdzjs ```

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Markdown for Zikojs

Install

 npm i mdzjs

Usage

Config

import {defineConfig} from "vite"
import {MDZ} from "mdzjs"
export default defineConfig({
    plugins : [
        MDZ()
    ]
})

Example

---
title : MDZ
background : tomato
---

import InteractiveBlock from "./InteractiveBlock.js";

**MDZ** (Markdown for ***zikojs***) is a format that allows you to append Zikojs Elements directly within Markdown.

It combines the simplicity of Markdown syntax with the power and flexibility of ***Javascript***

Here’s an example of an interactive block rendered within this MDZ file:

<InteractiveBlock data="Hello  from MDZ" color="darkblue"/>

### Features of MDZ:
1- **Simple Integration :** Write Markdown as usual, and inject ZikoJS elements wherever needed.
2- **Frontmatter Support :** In this example, the title of the document is set dynamically through the frontmatter.

3- **Extensible :** Create custom components like InteractiveBlock and use them in any Markdown file.
// InteractiveBlock.js
import {Flex, input, text} from "ziko"
export default ({data, color})=>{
    let txt = text(data).style({color})
    let inp = input(data).style({
        padding : "5px",
        background : "transparent",
        outline :"none",
        boxShadow :"1px 1px 1px white",
        fontSize : "inherit"
    })
    inp.onInput(e=>txt.setValue(e.value))
    return Flex(
        inp,
        txt
    ).vertical(0, "space-around").size("60%").style({
        border : "2px darkblue solid",
        padding : "10px",
        minHeight : "100px",
        margin : "auto"
    })
}
// main.js
import { useTitle } from "ziko"
import UI,{title, background} from "./test.mdz"
title && useTitle(title)
UI().style({
    border : "2px darkblue solid",
    width : "70%",
    margin : "auto",
    padding : "10px",
    fontFamily : "Cheeronsta",
    background : background ?? "orange"
}).vertical(-1, "space-around")

Keywords

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc