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

contentful-readme-generator

v0.0.25

Published

Generate a README.md file from content stored within https://www.contentful.com

Downloads

529

Readme

Contentful Readme Generator


Project Abbreviation: RDME

Developer Emails: [email protected]

NPM URL: https://www.npmjs.com/package/contentful-readme-generator

Repo URL: https://github.com/srouse/contentful-readme-generator

Description

This is a service that loads a Contentful entry and renders it as a README file in the repo folder. It has the side effect of being able to use this information for other uses, such as project overviews.

Readme Install

To install

yarn add contentful-readme-generator

Create a .env file in your project

# CTFL README
CTFL_README_CONTENTFUL_SPACE=[Your Space Id *]
CTFL_README_CONTENTFUL_ENVIRONMENT=[Your Environment Id *]
CTFL_README_CONTENTFUL_ENTRY_ID=[Your Entry Id *]
CTFL_README_CONTENTFUL_ACCESS_TOKEN=[Your Access Token Id]

Setup Local Configuration *

  • The .env variables are not necessary if using a configuration file.
// ctfl-readme.json
{
  "contentfulSpace": "[Your Space Id]",
  "contentfulEnvironment": "[Your Env]",
  "contentfulEntryId": "[Your Entry Id]",
  "rootFilename": "README",
  "folderName": "README",
  "htmlTemplate": "templates/htmlTemplate.mjs",
  "htmlRootFileName": "index",
  "htmlDist": "dist"
}

build

yarn ctfl-readme

✎ edit

Contentful Content

Build your Content Type

There is no specific structure needed to build a readme file, but there are limitations. For instance, ctfl-readme will try to render out whatever you put into your Entry, but text and markdown (large text) are ideal. A simple, but effective example would be:

{
  "name": "Readme Project",
  "description": "",
  "displayField": "title",
  "fields": [
    {
      "id": "title",
      "name": "Title",
      "type": (TEXT),
      ...
    },
    {
      "id": "Badges",
      "name": "badges",
      "type": (JSON),
      ...
    },
    {
      "id": "tableOfContents",
      "name": "Table of Contents",
      "type": "Boolean",
      "defaultValue": {
        "en-US": true
      },
      ...
    },
    {
      "id": "repoUrl",
      "name": "Repo URL",
      "type": (TEXT, URL VALIDATED),
      ...
    },
    {
      "id": "description",
      "name": "## Description",
      "type": (MARKDOWN TEXT),
      ...
    },
    {
      "id": "howToInstall",
      "name": "## How To Install",
      "type": (MARKDOWN TEXT),
      ...
    },

What Does NOT work as well

Rich Text. Avoid rich text in your Content Type. There is a markdown editor in Contentful, so rich text is a very round about way of getting back to markdown.

Badges

ctfl-readme does understand how to create badges via badges. Add a property to your content type with an id of "badges" with the type of JSON and you will be able to pass in a formatted object into badges' renderBadges. Each argument will be a line in the JSON object:

{
    "list": [
        "npmversion"
    ],
    "config": {
        "npmPackageName": "contentful-readme-generator"
    },
    "options": {}
}

Headers

Properties with header characters (#, ##, ###) will be expressed as headers before their content is rendered. This works well for markdown entries. The only special case is "# Title" which will render the actual title instead of the literal word "title".

Table of Contents

Adding a property with an id of "tableOfContents" with a type of boolean will trigger (if true) the rendering of a table of contents. It is done via markdown-toc.

Arguments

There is only one argument where you can change the destination file name

ctfl-readme --fileName README-OTHER.md

✎ edit

Page Example ➚

Figma Design System Widget ➚

Build Information

Dynamically built using contentful-readme-generator. Do not edit directly.

updated: 6/16/2023, 1:25:07 PM

space: rtkhko6y3s3u

environment: master

entity id: 2Ox6brgaOxUyE0QDuNOAmH

✎ edit