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

@mtdev/gatsby-theme-terminal

v1.1.0

Published

A terminal theme for Gatsby

Downloads

7

Readme

Gatsby Theme Terminal

A Gatsby theme that looks like a real terminal! You have to type the command and press Enter to navigate the site.

You can see a demo on my actual website https://marcotisi.dev.

Installation

For a new site

Sorry, no starter yet. You need to create a new site with gatsby and add the theme manually:

gatsby new my-terminal-site

For an existing site

  1. Install the theme
npm install @mtdev/gatsby-theme-terminal

yarn add @mtdev/gatsby-theme-terminal
  1. Add the configuration to your gatsby-config.js file
// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "@mtdev/gatsby-theme-terminal",
      options: {
        // basePath defaults to "/"
        basePath: "/terminal",
      },
    },
  ],
};
  1. Add commands (pages) by creating md or mdx files inside /commands.

  2. Run your site using gatsby develop, browse it, type help and press Enter. You'll see a list of available commands.

Usage

Theme options

| Key | Default value | Description | | ------------------------------- | ------------- | -------------------------------------------------------------------------------- | | basePath | / | Root url for the site | | commandsPath | commands | Location of commands | | mdxOtherwiseConfigured | false | Set this flag true if gatsby-plugin-mdx is already configured for your site. | | maxWidth | 80ch | Max width of the body. Works best if using ch. | | fontFamily | monospace | Font family. | | backgroundColor | #1E1E1E | Background color. | | textColor | #FFF | Text color. | | promptPrefixColor | #00a6b3 | Prompt prefix color. | | promptTextColor | #00a600 | Prompt text color. | | promptSuffixColor | #b200b3 | Prompt suffix color. | | scrollbarWidth | 0.5rem | Scrollbar width. | | scrollbarBackgroundColor | #3c3c3c | Scrollbar background color. | | scrollbarTrackBackgroundColor | #3c3c3c | Scrollbar track background color. | | scrollbarThumbBackgroundColor | #4c4c4c | Scrollbar thumb background color. |

Example usage

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "@mtdev/gatsby-theme-terminal",
      options: {
        maxWidth: "120ch",
        fontFamily: "source-code-pro",
        backgroundColor: "#1B2B34",
        textColor: "#CDD3DE",
        promptPrefixColor: "#99C794",
        promptTextColor: "#5FB3B3",
        promptSuffixColor: "#EC5f67",
        scrollbarBackgroundColor: "#4F5B66",
        scrollbarTrackBackgroundColor: "#4F5B66",
        scrollbarThumbBackgroundColor: "#A7ADBA",
      },
    },
  ],
};

Additional configuration

In addition to the theme options, you can customize some items using the siteMetadata object of your site in gatsby-config.js

// gatsby-config.js
module.exports = {
  siteMetadata: {
    // Used to display an avatar next to the title
    avatar: "https://i.pravatar.cc/128?img=6",
    // Used for SEO twitter:creator meta
    author: "twitter_author",
    // Used for the site header, title and SEO
    title: "Gatsby Theme Terminal",
    // Used for the site header and SEO
    description: "Description",
    // Used for the welcome text just above the prompt
    helpText: "Type 'help' and press Enter to start",
    // Used to customize the user in the prompt
    user: "guest",
    // Used to customize the host in the prompt
    host: "gatsby-theme-terminal.dev",
  },
};

Command Fields

The following are the defined command fields based on the node interface in the schema

| Field | Type | | ----------- | ------ | | id | String | | command | String | | title | String | | description | String | | slug | String | | body | String |

Example Command

Here's an example command with its fields:

---
command: example
title: Example
description: And example command
---

## Example command

This is an example command