1.1.3 • Published 3 months ago

badgetable v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

CircleCI PRs Welcome

Badge Table Generator

Helps create summary tables for modules and websites by adding badges through shields.io. It generates complex Markdown code with a simple payload for an easy-to-understand visual overview.

Features

  • Creates an overview in the form of a markdown table.
  • Users can choose from various predefined presets.
  • Dynamic information can be inserted into individual cells using, for example, shields.io badges.
  • Customized to meet the needs of open-source repository maintainers. To efficiently monitor metrics from various repositories.
npm init -y
npm i badgetable

Example

TitleArticleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge TableX

Implementation: ./presets.md#githubOverviewWithArticle

See #presets for more examples.

Table of Contents

Methods

The following methods are publicly accessible. getTable generates the actual table, while all other methods assist in displaying manually created tables.

npm init -y
npm i badgetable

.getTable()

This method generates the desired table. The form is determined by the preset parameter.

Method

.getTable( { preset, projects, sort=true, footer=true, header=false } )
NameTypeDefaultDescriptionRequired
presetStringThe preset to use for generating the table.true
projectsArray of ObjectsThe projects to include in the table.true
sortBooleantrueWhether to sort the table.false
footerBooleantrueWhether to include a footer in the table.false
headerBooleanfalseWhether to include a header in the table.false

See Presets for examples.

Returns String (markdown)

.getPresets()

This helper method returns an array of strings containing all available presets.

Method

.getPresets()

Return

Array of Strings

.getConfig()

This method returns the currently active configuration. This object also contains the respective presets needed to generate a table. To create a custom table, see .setConfig().

Method

.getConfig()

Returns Object

Retrieve the default configuration after auto-generation. This can be useful if you want to create your custom configuration.

.setConfig()

This method allows you to adjust the configuration, for example, to insert your custom template.

Contribution welcome, we are happy to expand the standard presets. Please send us your suggestions.

Method

.setConfig( { config, init=false } )
NameTypeDefaultDescriptionRequired
configObjectThe configuration to set for the function.true
initBooleanfalseDo not provide this parameter.false

Example To customize your configuration, you can provide your own config. It is recommended to modify the default configuration. The configuration distinguishes between Badges, Columns, and Presets. Within Badges, each badge is defined using a struct. The wrapperUrl can be used to create a clickable link, and the shield represents the actual badge content. The struct expects pseudo-HTML enclosed in "<<" and ">>". Variables within the payload are denoted by "{{" and "}}".

import { BadgeTable } from 'badgetable'
const btg = new BadgeTable( true )

const yourConfig = {}

const myconfig = btg.getConfig()
myconfig['presets']['githubMinimal']['struct'] = [
    [ 'tree__columns__text', 'tree__markdown__alignment__left' ],
    [ 'tree__columns__githubUpdated', 'tree__markdown__alignment__left' ],


    [ 'tree__columns__license', 'tree__markdown__alignment__left' ]
]

const markDown = btg
    .setConfig( yourConfig )
    // .getTable( { 'preset': 'githubMinimal', projects, sort } )

Returns Boolean

Presets

Here are all the presets listed as an overview. A detailed description for each example is stored in ./preset.md.

documentation

TitleUptimeUrl
https://docs.statosio.com/
https://docs.statosio.com/

Implementation: ./presets.md#documentation

dynamicPackageSearch

TitleUpdatedPackage
Easy Mina
Mina Data

Implementation: ./presets.md#dynamicPackageSearch

gemPackages

TitleVersionUpdatedStatisticsLicense
Feed Into
Masked Ape Club

Implementation: ./presets.md#gemPackages

gemPackagesCircleCi

TitleVersionUpdatedStatisticsTestsLicense
Feed Into
Masked Ape Club

Implementation: ./presets.md#gemPackagesCircleCi

githubActivity

TitleUpdatedStarsCommitsContributorsLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubActivity

githubAdvanced

TitleUpdatedStarsCommitsContributorsFilesSizeLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubAdvanced

githubMinimal

TitleUpdatedLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubMinimal

githubOverview

TitleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubOverview

githubOverviewWithArticle

TitleArticleUpdatedStarsCommitsIssuesTestsLicense
Ascii to svg Generator
Badge TableX

Implementation: ./presets.md#githubOverviewWithArticle

githubStats

TitleUpdatedStarsFilesSizeLicense
Ascii to svg Generator
Badge Table

Implementation: ./presets.md#githubStats

npmPackages

TitleVersionUpdatedStatisticsLicense
Badge Table
Easy Mina

Implementation: ./presets.md#npmPackages

npmPackagesCircleCi

TitleVersionUpdatedStatisticsTestsLicense
Badge Table
Easy Mina

Implementation: ./presets.md#npmPackagesCircleCi

npmPackagesCircleCiWithArticle

TitleArticleVersionUpdatedStatisticsTestsLicense
Badge TableX
Easy Mina

Implementation: ./presets.md#npmPackagesCircleCiWithArticle

License

The module is available as open source under the terms of the MIT.

1.1.3

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.1.2

3 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

0.1.0

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago