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

@mrpierrot/cardmaker

v5.0.0

Published

A tool to create cards games

Downloads

1

Readme

= Cardmaker

Cardmaker is a command line tool used to generate game's cards from a template and a Google Spreadsheet. It is currently operational for card prototyping.

= UPDATE : DECKCARDS IS NOW CARDMAKER

Cardmaker is more simple to tape than Deckcards :-)

== For non-developers

Cardmaker needs somes basics knowledges in HTML/CSS and the use of command lines.

== Disclaimer

It's an early version that barely comes out of the furnace. If you want to improve this project you can contribute by submitting https://github.com/mrpierrot/cardmaker/issues[an issue] or propose a https://github.com/mrpierrot/cardmaker/pulls[pull request]

== Install

https://nodejs.org[NodeJS] is required to install Cardmaker. You must install it.

Install with npm:

npm install @mrpierrot/cardmaker -g

== Get started

=== Create a project

First, use this command to create a project with default content in the directory "project_name":


cardmaker setup <project_name>

Next, go to the directory "project_name"


cd ./<project_name>

The project contains the following files :

[options="header,footer"] |=========================================== | File | Description | cardmaker.json | The configuration files | templates/default.hbs | The Handlebars template file. Look at http://handlebarsjs.com/[Handlebars.js] to edit. | layouts/basic.hbs | The Handlebars layout file. Look at http://handlebarsjs.com/[Handlebars.js] to edit. | styles.css | The template's styles. |===========================================

=== cardmaker.json

The default cardmaker.json

[source, json]

{ "templates": { "default": "templates/default.hbs" }, "layouts": { "basic": "layouts/basic.hbs" }, "gsheet":{ "sheetId":"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8", "credentials":null } }

==== Description

[options="header,footer"] |============================================ | Name | Description | templates | The HTML templates path. It's a dictionnary with sheet name as key | layouts | Layout system : usefull to manage differents printers | output | The directory where final HTML files are generated | gsheet.sheetId | The Google Spreadsheet's ID. It can be found here: docs.google.com/spreadsheets/d/1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8/edit?usp=sharing | gsheet.credentials | The credentials file path (i.e. "./credentials.json"). Set it to null if you use a public Google Spreadsheet. |============================================

=== Configure Google authentication

For private and public Google Spreadsheets, follow the instructions from https://github.com/theoephraim/node-google-spreadsheet#authentication[node-google-spreadsheet]

If you use private Google Spreadsheet, you get a JSON file with credentials. Copy this file into the project directory and rename it credentials.json

In cardmaker.json, define the credentials.json path like this:

[source, json]

{ ... "gsheet":{ ... "credentials":"./credentials.json" } }

=== Google Spreadsheet Format

You can find an example https://docs.google.com/spreadsheets/d/1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8/edit#gid=2092230795[here]

The first line contains the variable names (here: NAME and DESC) and the next lines store the values.

You can define several sheets, each of them generating its own HTML page.

==== Meta Variables

In the first line, you can define Meta variables used by the Cardmaker engine

[options="header,footer"] |========================================================================== | Variable | Description | _COUNT | Repeat a card N times ( N is defined in a card line ) | _SKIP | if equal to 1 or TRUE, skip the line |==========================================================================

=== Build

Finally, to generate cards use this :


cardmaker build

=== Watch


cardmaker watch

You can watch templates and data files : when there are modified, the watcher build the cards

=== Export


cardmaker export

You can export to pdf files

== Reference

=== Setup command


cardmaker setup <project_name>

[options="header,footer"] |============================================================ | Option | Alias | Description | --template <name|path> | -t | Use a specific template |============================================================

=== Build command


cardmaker build

[options="header,footer"] |============================================================ | Option | Alias | Description | --layout | -l | The chosen layout to use | --nobrowser | -n | Skip opening generated of files in the browser |============================================================

=== Fetch command


cardmaker fetch

=== Watch command


cardmaker watch

[options="header,footer"] |============================================================ | Option | Alias | Description | --layout | -l | The chosen layout to use | --nobrowser | -n | Skip opening generated of files in the browser |============================================================

=== Export command


cardmaker export

[options="header,footer"] |============================================================ | Option | Alias | Description | --layout | -l | The chosen layout to use |============================================================

=== Template/Layout management

Cardmaker can manage template with ou without layout

==== Work without layouts

This is a example of template without layouts : All the content are in an unique template

[source, html]

==== Work with layouts

If you want to print with a basic printer machine for prototyping, you want a différent format for printing house. Layout help to work with differents this print format.

This is a basic layout :

[source, html]

You can note the

[source, html]

{{>card card=.}}

This is a basic Handlebars partial name card The current card data is pass to this partial

And your template look like this now :

[source, html]

==== Layout in cardmaker.json

Basic configuration :

[source, json]

{ "templates": { "default": "templates/default.hbs" }, "layouts": { "basic": "layouts/basic.hbs" }, "gsheet":{ "sheetId":"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8", "credentials":null } }

Advanced configuration with layout overrides :

[source, json]

{ "templates": { "default": { "template : "templates/default.hbs", "layouts" : { "basic" : "layouts/basic-overridden.hbs" } } }, "layouts": { "basic": "layouts/basic.hbs" }, "gsheet":{ "sheetId":"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8", "credentials":null } }

==== Build and watch with layouts.

To buid : [source]

cardmaker build -l pro

or

[source]

cardmaker build --layout pro

To watch :

[source]

cardmaker watch -l pro

or

[source]

cardmaker watch --layout pro

=== License

Licensed under the link:LICENSE[MIT]