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

@kyma-project/dc-markdown-render-engine

v0.3.6

Published

OpenApi render engine for @kyma-project/documentation-component

Downloads

67

Readme

Markdown Render Engine

Overview

The Markdown render engine is based on the React Markdown component. It allows you to render .md files.

Installation

  • using npm

    npm i @kyma-project/dc-markdown-render-engine
  • using yarn

    yarn add @kyma-project/dc-markdown-render-engine

Configuration

NOTE: The Markdown render engine supports all options available in the React Markdown component.

| Name | Required | Type | Default value | Description | | ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | parsers | No | MarkdownParserPlugin[] | [] | Defines custom parsers for custom content in Markdown files. Go here to read more about write parsers. | | customRenderers | No | Renderers | {} | Defines an object in which the keys represent the node type, and the value is a React component. The object is merged with the default renderers. The props passed to the component vary based on the type of node. See the default implementations of renderers. | | highlightTheme | No | any | {} | Defines custom styles for highlighting code blocks. The Markdown render engine uses PrismJS to highlight. See the style examples. | | headingPrefix | No | string or ((source: Source) => string), where Source is type | "" | Defines a prefix for any heading in a Markdown file. | | copyButton | No | ReactNode | null | Defines a custom copy button in code blocks. The Markdown render engine accepts only code blocks as a value to copy. |

NOTE: To learn how to pass options of a render engine, read this document.

Styles

To use default styles based on SAP Fundamentals, import them as follows:

import "@kyma-project/dc-markdown-render-engine/lib/styles.css";

To use the default font 72 provided by SAP Fundamentals, install the npm package from this Getting Started guide and import the font as follows:

import "fiori-fundamentals/dist/fonts.min.css";

Plugins

To use plugins available in the package, import the plugins object from the package. See the following example:

import { plugins as markdownPlugins } from "@kyma-project/dc-markdown-render-engine";

| Name | Type | Source types | Description | | ------------------------- | ---------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | embedVideo | mutation | ["markdown", "md"] | A mutation plugin to extract videos. The pattern for embedding a video is: {platform}: {url}, where {url} is the URL to the video, and {platform} is one of the following: youtube, vimeo, videopress, twitch, twitchlive, niconico. NOTE: To fully integrate with the Documentation component you must also use markdownEmbedVideoParserPlugin | | frontmatter | mutation and extractor | ["markdown", "md"] | Mutation and extractor plugins. The mutation plugin removes Front Matter from the beginning of a Markdown file. The extractor plugin extracts file metadata from a Markdown file. | | headers | extractor | ["markdown", "md"] | An extractor plugin to extract headers from a Markdown file. | | replaceAllLessThanChars | mutation | ["markdown", "md"] | A mutation plugin to replace every < char to an appropriate Unicode character. Used the plugin to render chars properly. | | tabs | mutation | ["markdown", "md"] | A mutation plugin to extract the details HTML tag in order to have fully interactive tabs. NOTE: To integrate fully with the Documentation component you must also use tabsParserPlugin. |

NOTE: To learn how to pass options of a plugin, read this document.

TypeScript types

To use TypeScript types available in the package, import the types object from the package. See the following example:

import { types as markdownRETypes } from "@kyma-project/dc-markdown-render-engine";