Coder Social home page Coder Social logo

evergreen-js's Introduction

Evergreen Markdown

An expansion of regular Markdown. Evergreen adds the ability to add classes, ids, and other HTML elements to your markdown, allowing better control of how your pages look and feel. This package is an experiment to create a Markdown processor and to learn how to publish an npm module. It is free to use.

Current Support

  • Header Elements
  • Bold and Italic Elements
  • Anchors
  • Standalone Images
  • Ordered Lists
  • Unorderd Lists
  • Blockquotes
  • Tables
  • Horizontal Rules
  • Divs
  • IDs
  • Classes
  • Fenced Code Blocks

To Be Implemented

  • Inline Images
  • Wiki-style Reference Links
  • ID Linking
  • Definition Lists
  • Task Lists
  • Table Row/Col Span
  • Escaping Characters

Usage

There are two parts to Evergreen. The first part is the EvergreenProcessor. This takes an array of strings in the initializer, and after calling parse returns an array containing a tree-like structure of elements.

Example:

const processor = new EvergreenProcessor(lines);
const elements = processor.process();

If you want to change the array of strings that the processor has simply update the lines variable in the processor.

Example:

processor.lines = ["# New", "Information"];

The second part is the converter. This takes the elements that are output by the processor and a parent element to attach them to.

Example:

const converter = new EvergreenConverter(elements);
const element = document.getElementById("someParentElement");
converter.convert(element);

The above will retrieve the element you queried by, and then insert the new HTML elements that were generated by the converter.

evergreen-js's People

Contributors

bhaze31 avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.