Skip to main content
This package works with Node.js, BrowsersIt is unknown whether this package works with Bun, Cloudflare Workers, Deno
JSR Score
35%
Published
3 months ago (0.2.2)

nodown thumbnail

Nodown

npm package version npm bundle size npm dependencies count npm types github commits count github last commit

A new experimental lightweight markup language written in javascript ~

Little overview of what Nodown can do

Capture d’écran 2024-02-02 à 00 11 51

Usage

import { parser, renderToHTML } from "nodown";

// Parse the text into a tree
const tree = parser(text);
// Render the tree to HTML
const doc = renderToHTML(tree);

// Display the HTML in your document
document.getElementById("nodown-output").innerHTML = doc;

You can incorporate predefined styles located in the following directory structure:

node_modules/
  nodown/
    styles/
      index.css        // Base styles
      theme.dark.css   // Styles for dark theme
      theme.light.css  // Styles for light theme

For the theme styles to take effect, make sure to link the appropriate stylesheet based on the [data-theme="..."] attribute of your body element. You can include all styles, but only one will be applied depending on the specified theme.

Introduction

The Nodown project emerged from a desire to improve Markdown, by incorporating additional features and resolving certain perceptible limitations. One of the main motivations is to bring together the various iterations of Markdown, created to overcome its initial shortcomings, such as the native absence of features like tables.

This initiative has its origins in specific situations, such as the difficulty of adjusting the size of images in standard Markdown.

The vision of centralization stems from the realization that many services and software use modified versions of Markdown creating a proliferation of variants and confusion as to the exact definition of Markdown.

My ambition is to clarify this situation by offering a new, centralized solution geared towards listening and continuous improvement.

Objectives

  • Address perceived limitations in standard Markdown.
  • Adding new syntax features.
  • Centralize various Markdown iterations.

Key Features

  • Parser: Converts raw text into an object (syntax tree).
  • RenderTo:
    • HTML: Converts text into an HTML document.
    • Text: Converts text into an formatted Text (experimental).
    • Other renders will be available later.

All these features are currently bundled in the same package, with a possible split into multiple packages if needed.

Technology

Language:

Development Dependencies

Compatibility

  • Not 100% compatible with other Markdown versions.
  • Syntax specialization (e.g., one syntax per element).

Testing and Validation

Not yet explored.

Documentation

Not yet started.

Not links available yet.

Future Enhancements

  • Lots of room for improvement.
  • Addition of features.
  • Integration of new renders.
  • Introduction of additional tools.

Add Package

deno add @nodown/nodown

Import symbol

import * as mod from "@nodown/nodown";

Add Package

npx jsr add @nodown/nodown

Import symbol

import * as mod from "@nodown/nodown";

Add Package

yarn dlx jsr add @nodown/nodown

Import symbol

import * as mod from "@nodown/nodown";

Add Package

pnpm dlx jsr add @nodown/nodown

Import symbol

import * as mod from "@nodown/nodown";

Add Package

bunx jsr add @nodown/nodown

Import symbol

import * as mod from "@nodown/nodown";