npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-markdown-to-matrix

v1.1.5

Published

converts markdown files of a standard format into an interactive matrix view

Downloads

11

Readme

React Markdown-To-Matrix

This library creates an embeddable React application that will transform a specified markdown file into a matrix form, with H2s being turned into rows and H3s turned into columns. This also looks for differences between items and optionally highlights those differences.

Installation

Run yarn add react-markdown-to-matrix or npm install react-markdown-matrix to add to an existing React app.

You will then be able to use the <MarkdownToMatrix> component:

import { MarkdownToMatrix } from 'react-markdown-to-matrix';

export const App: React.FC = () => {
    return(
        <MarkdownToMatrix 
            title='Markdown-To-Matrix'
            enabledOptions={['diff', 'filters', 'displayMode', 'upload']}
        />
    );
};

Options

There are a variety of configuration options available within the MarkdownToMatrix component:

| Parameter | Type | Required?| Description | | --------- | ---- | ---------| ----------- | | enabledOptions | string[] | Required | The options to enable in the sidebar (see below) | | title | string | Optional | The title to display in the sidebar | | subtitle | string | Optional | The subtitle to display in the sidebar | | fileUrls | string[] | Optional | If provided, the files to preload into the matrix view | | customTheme | Theme | Optional | Style overrides for colors and fonts | | defaultMode | 'matrix' | 'list' | Optional | What view mode to start with; defaults to 'matrix' | | renderHtml | boolean | Optional | Set to true to render inline HTML within the loaded markdown | | excludeHeaders | string[] | Optional | Any H2s / H3s that shouldn't be parsed into headers can be specified here |

enabledOptions

There are four available options to enable or disable within the enabledOptions parameter.

  • 'upload' : allows users to upload their own markdown files to this view
  • 'filters' : allows users to hide rows or columns
  • 'diff' : allows users to view a diff view of elements in the grid
  • 'displayMode' : allows users to toggle between list and matrix view

If an empty string is provided, the sidebar is entirely hidden from the usesrs (which may be better for embedding). In this case, a set of urls for fileUrls must be provided.

customTheme

You can update a variety of aspects about how the app displays through the properties on the customTheme parameter. All fields are optional. All colors are expected to be specified as six-digit hex colors, including the # at the beginning.

| Theme Property | Type | Description | | -------------- | ---- | ----------- | | dark | HexColor | The dark color to use for the foregrouund | | light | HexColor | The light color to use for the background | | darkTheme | HexColor | A complementary dark color; used for the sidebar | | lightTheme | HexColor | A complementary light color; used for hovers | | bodyFont | FontFamily | The font to use for all body text | | headerFont | FontFamily | The font to use for all header text | | isDarkMode | boolean | If true, reverses when light and dark colors are used |

Source

The source for this library is avilable at github.com/kipprice/markdown-matrix. You can see a working version of this library at kipprice.github.io/markdown-matrix.