Giter Club home page Giter Club logo

vanitygen's Introduction

vanitygen

Static HTML generator for Go vanity import paths.

Introduction

vanitygen is a tool for generating static HTML files for Go vanity import paths. It is capable of accepting Git repositories hosted on GitHub, GitLab, Gitea and Sourcehut and generating static HTML files with plain (vangen-like) or Bootstrap-based styling.

Both providers and formatters can be easly extended, so don't hesitate to open issues and/or merge requests for new functionalities!

Installation

go install github.com/Icikowski/vanitygen@latest

Usage

Command line arguments

CLI argument Environment variable Description Default value
--out VANITYGEN_OUT Output directory for generated HTML files "out"
--config VANITYGEN_CONFIG Configuration file (in YAML or JSON format) "vanitygen.yaml"
--format VANITYGEN_FORMAT Formatter for generated HTML files (plain or bootstrap) "plain"

Configuration file

Configuration file defines the generated files' content. It contains both global and package-specific fields.

Schema for configuration file is available on https://raw.githubusercontent.com/Icikowski/vanitygen/main/config.schema.json.

Both YAML and JSON formats are supported.

Example configuration in YAML format
# yaml-language-server: $schema=https://raw.githubusercontent.com/Icikowski/vanitygen/main/config.schema.json
domain: "pkg.somesite.com"
siteName: "Go packages"
author: "John Doe"
docs: "https://pkg.go.dev"
pkgs:
  - name: utils
    provider: github
    repoUrl: "https://github.com/someuser/someutils"
    branch: main
    subpackages:
      - v1
      - v2
      - v3
  - name: tools
    provider: gitlab
    repoUrl: "https://gitlab.com/someuser/sometools"
    branch: devel
  - name: awesome
    provider: gitea
    repoUrl: "https://try.gitea.io/someuser/some-awesome-package"
    branch: staging
    website: "https://somesite.com/my-awesome-package"
  - name: others
    provider: sourcehut
    repoUrl: "https://git.sr.ht/~someuser/someotherpackage"
    branch: master
Example configuration in JSON format
{
  "$schema": "https://raw.githubusercontent.com/Icikowski/vanitygen/main/config.schema.json",
  "domain": "pkg.somesite.com",
  "siteName": "Go packages",
  "author": "John Doe",
  "docs": "https://pkg.go.dev",
  "pkgs": [
    {
      "name": "utils",
      "provider": "github",
      "repoUrl": "https://github.com/someuser/someutils",
      "branch": "main",
      "subpackages": [
        "v1",
        "v2",
        "v3"
      ]
    },
    {
      "name": "tools",
      "provider": "gitlab",
      "repoUrl": "https://gitlab.com/someuser/sometools",
      "branch": "devel"
    },
    {
      "name": "awesome",
      "provider": "gitea",
      "repoUrl": "https://try.gitea.io/someuser/some-awesome-package",
      "branch": "staging",
      "website": "https://somesite.com/my-awesome-package"
    },
    {
      "name": "others",
      "provider": "sourcehut",
      "repoUrl": "https://git.sr.ht/~someuser/someotherpackage",
      "branch": "master"
    }
  ]
}

Demo

Plain-themed HTML output

Plain-themed HTML output for home page

Plain-themed HTML output for package page

Bootstrap-themed HTML output

Bootstrap-themed HTML output for home page

Bootstrap-themed HTML output for package page

vanitygen's People

Contributors

icikowski avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.