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

marked-plaintify

v1.1.1

Published

A marked extension to convert Markdown to Plaintext

Downloads

5,411

Readme

marked-plaintify

A marked extension to convert Markdown to Plaintext.

Install

You can install marked-plaintify using npm or yarn:

npm i marked-plaintify
# or
yarn add marked-plaintify

Usage

Once you've installed this extension, you can use it in your marked configuration. Here's an example of how to configure it:

Say we have the following file example.md:

# GitHub Flavored Markdown (GFM) Specifications Demo

This document showcases various features and specifications of GitHub Flavored Markdown (GFM).

## 1. Headings

### This is a third-level heading

#### This is a fourth-level heading

## 2. Emphasis

_This text will be italic_
_This will also be italic_

**This text will be bold**
**This will also be bold**

## 3. Lists

### Unordered List

- Item 1
- Item 2
  - Item 2a
  - Item 2b

### Ordered List

1. First item
2. Second item
3. Third item
   1. Indented item
   2. Indented item

## 4. Links

[Github](https://github.com) - Renders as a link to GitHub.

## 5. Images

![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)

## 6. Blockquotes

> This is a blockquote

## 7. Inline code

This is an `inline code` example.

## 8. Code blocks

```javascript
function greet(name) {
  console.log('Hello, ' + name + '!')
}

greet('World')
```

## 9. Strikethrough

~~This text is strikethrough.~~

## 10. Tables

| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

## 11. Task lists

- [x] Task 1
- [x] Task 2
- [ ] Task 3

## 12. Mentioning users and issues

@username, #123

## 13. Emoji

:smile:, :rocket:, :octocat:

## 14. Automatic linking for URLs

https://www.google.com

## 15. Strikethrough

~~Strikethrough~~

## 16. Ignoring Markdown formatting

\*This will not be italic\*

## 17. Tables

| Markdown | Less      | Pretty     |
| -------- | --------- | ---------- |
| _Still_  | `renders` | **nicely** |
| 1        | 2         | 3          |

## 18. Fenced code blocks with language syntax highlighting

```python
def hello():
    print("Hello, World!")
```

## 19. Disabling line breaks in paragraphs

This is a paragraph that demonstrates how to
disable line breaks.

## 20. Automatic linking for URLs

www.example.com

And our module example.js looks as follows:

import { readFileSync } from 'node:fs'
import { Marked } from 'marked'
import markedPlaintify from 'marked-plaintify'

const plaintext = new Marked({ gfm: true })
  .use(markedPlaintify())
  .parse(readFileSync('example.md', 'utf8'))

console.log(plaintext)

Now, running node example.js yields:

GitHub Flavored Markdown (GFM) Specifications Demo

This document showcases various features and specifications of GitHub Flavored Markdown (GFM).

1. Headings

This is a third-level heading

This is a fourth-level heading

2. Emphasis

This text will be italic
This will also be italic

This text will be bold
This will also be bold

3. Lists

Unordered List


Item 1
Item 2
Item 2a
Item 2b

Ordered List


First item
Second item
Third item
Indented item
Indented item

4. Links

Github - Renders as a link to GitHub.

5. Images

GitHub Logo

6. Blockquotes

This is a blockquote

7. Inline code

This is an inline code example.

8. Code blocks

function greet(name) {
  console.log('Hello, ' + name + '!')
}

greet('World')

9. Strikethrough

This text is strikethrough.

10. Tables

Column 1: Cell 1
Column 2: Cell 2
Column 3: Cell 3

Column 1: Cell 4
Column 2: Cell 5
Column 3: Cell 6

11. Task lists


Task 1
Task 2
Task 3

12. Mentioning users and issues

@username, #123

13. Emoji

:smile:, :rocket:, :octocat:

14. Automatic linking for URLs

https://www.google.com

15. Strikethrough

Strikethrough

16. Ignoring Markdown formatting

This will not be italic

17. Tables

Markdown: Still
Less: renders
Pretty: nicely

Markdown: 1
Less: 2
Pretty: 3

18. Fenced code blocks with language syntax highlighting

def hello():
    print("Hello, World!")

19. Disabling line breaks in paragraphs

This is a paragraph that demonstrates how to
disable line breaks.

20. Automatic linking for URLs

www.example.com

API

markedPlaintify(options: Options): MarkedExtension

This function creates a marked extension to convert Markdown to plaintext.

  • options: Custom renderers for configuring the marked-plaintify extension. It's an object where keys represent renderer names and values are functions that take arguments and return plaintext strings or false.

Related

See extensions list.

Contributing

We 💛  issues.

When committing, please conform to the semantic-release commit standards. Please install commitizen and the adapter globally, if you have not already.

npm i -g commitizen cz-conventional-changelog

Now you can use git cz or just cz instead of git commit when committing. You can also use git-cz, which is an alias for cz.

git add . && git cz

License

GitHub

A project by Stilearning © 2023-2024.