Coder Social home page Coder Social logo

markdown-it-fancy-lists's Introduction

markdown-it-fancy-lists

A plugin for markdown-it adding lettered and Roman numeral ordered lists

I wanted fancy lists for markdown, and markdown-it was a fairly easily extensible one that's fast and standards-compliant, so I made this plug-in.

Use

I am not using node. I just set it up with pure HTML and JavaScript.
Put this in your HTML:

<script src="https://cdn.jsdelivr.net/markdown-it/8.3.1/markdown-it.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Ullallulloo/[email protected]/markdown-it-fancy-lists.min.js">

Put this in your JavaScript:

var md = window.markdownit({breaks: true, linkify: true});
md.block.ruler.at('list', fancyList, { alt: [ 'paragraph', 'reference', 'blockquote' ] });

I could probably add node support pretty easily though?

Disclaimers

  • This violates the CommonMark standard in multiple ways:
    • Obviously fancy lettered and Roman numeral lists are not in the standard
    • Since Roman numerals have a tendency to get long, it exacerbates a thing in the standard that I dislike, which is that it requires you to put fewer spaces behind longer markers. This makes the text align with monospace fonts, but looks stupid in any other font. Also, this means that tabs will not align right, especially with long things. I do a rather hacky thing and strip out these spaces in the parser if the bullet point's long, which makes things slightly inconsistent. I can fix that by running it on two long things, but that would make it slower. Also I could make this an option maybe. Idk.
  • If you want to fix it or change it or whatever, I don't care. Just keep the license with it.

markdown-it-fancy-lists's People

Contributors

mminer237 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

markdown-it-fancy-lists's Issues

NPM version

I'd like to use this package via NPM. Would you accept a pull request that makes this library runnable in both web browser (like currently) and in Node? Or should I stick to a fork?

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.