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

@huyikai/vitepress-helper

v0.0.30

Published

This tool is designed to help you to use VitePress more easily.

Downloads

133

Readme

VitePress-Helper

npm-version node-version npm-downloads license

简体中文

Brief

On the basis of vitepress, optimize the user experience.

Features

  • Nav:Automatic generate the navigation bar based on the file directory
  • Sidebar:Automatic generate the sidebar based on the file directory
  • Cli:Guide to complete the initialization operation
  • Integration CMS: Run a local CMS to make content management easier
  • Home: Customizable home page

ToDo

  • Internationalization compatibility: Modify the methods for generating sidebar and navigation bar to adapt to internationalization settings.
  • CMS:
    • Optimize the experience of using Markdown editor.
    • Move files and directories, and drag and drop.
    • Import local files and batch processing.
    • Import linked content.
    • Version control.
    • Management of static resources (images).

Long-term Plan

  • Code: Add unit tests to ensure code quality
  • User Experience: Optimize UI, usage logic, and performance
  • Documentation: Provide bilingual documentation, more detailed usage instructions, and appropriate usage examples
  • Exploration:
    • Pay attention to the updates of vitepress to keep the functions and experience synchronized.
    • Plan for new inspirations during the development and usage process.

Usage

Currently, two usage methods are planned:

  1. Using the scaffolding initialization (recommended), you can get started directly.
  2. Add the dependency @huyikai/vitepress-helper to an existing vitepress project and manually modify the config and theme.

Cli Init

npx @huyikai/vitepress-helper init

You will be greeted with a few simple questions:

# Project Name
# Author
# Version
# Do you need local CMS?

After the initialization is complete, you can run npm run dev to preview or run npm run cms to manage content.

2. Add Dependency

npm @huyikai/vitepress-helper
// Modify config.js
import vitepressHelper from '@huyikai/vitepress-helper';
export default async () => {
  const instance: any = await vitepressHelper({
    directory: 'docs',
    collapsible: true
  });
  return {
    ...,
    themeConfig:{
      ...,
      nav:instance.nav,// You can continue to expand. Example: [...instance.nav,...otherNavArray]
      sidebar:instance.sidebar // You can continue to expand. Example: [...instance.sidebar,...otherSidebarArray]
    }
  }
}

Create directory .vitepress/theme, and create files home.vue and index.js

home.vue

<script setup lang="ts">
import VPDoc from 'vitepress/dist/client/theme-default/components/VPDoc.vue';
import VPButton from 'vitepress/dist/client/theme-default/components/VPButton.vue';
</script>
<template>
  <!-- You can customize any content, for example: -->
  <div>A journey of a thousand miles begins with a single step</div>

  <!-- The VPDoc component here will render the content of index.md in the docs root directory. -->
  <VPDoc />
</template>
<style></style>

index.js

import 'vitepress/dist/client/theme-default/styles/vars.css';
import 'vitepress/dist/client/theme-default/styles/base.css';
import 'vitepress/dist/client/theme-default/styles/utils.css';
import 'vitepress/dist/client/theme-default/styles/components/custom-block.css';
import 'vitepress/dist/client/theme-default/styles/components/vp-code.css';
import 'vitepress/dist/client/theme-default/styles/components/vp-code-group.css';
import 'vitepress/dist/client/theme-default/styles/components/vp-doc.css';
import 'vitepress/dist/client/theme-default/styles/components/vp-sponsor.css';

import Home from './home.vue';
import Layout from '@huyikai/vitepress-helper/theme/Theme.vue';
import VPBadge from 'vitepress/dist/client/theme-default/components/VPBadge.vue';

const theme = {
  Layout,
  enhanceApp: ({ app }) => {
    app.component('Home', Home);
    app.component('Badge', VPBadge);
  }
};
export default theme;

License

MIT

Repository