{"id":21610526,"url":"https://github.com/mrpierrot/cardmaker","last_synced_at":"2025-03-18T15:59:42.443Z","repository":{"id":44177823,"uuid":"109974887","full_name":"mrpierrot/cardmaker","owner":"mrpierrot","description":"Deckcards is a tool used to generate game’s cards from a template and a Google Spreadsheet.","archived":false,"fork":false,"pushed_at":"2022-12-07T17:33:31.000Z","size":245,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T13:42:33.524Z","etag":null,"topics":["board-game","card-game","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrpierrot.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T12:45:42.000Z","updated_at":"2023-05-19T22:05:34.000Z","dependencies_parsed_at":"2023-01-23T18:35:12.965Z","dependency_job_id":null,"html_url":"https://github.com/mrpierrot/cardmaker","commit_stats":null,"previous_names":["mrpierrot/deckcards"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrpierrot%2Fcardmaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrpierrot%2Fcardmaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrpierrot%2Fcardmaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrpierrot%2Fcardmaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrpierrot","download_url":"https://codeload.github.com/mrpierrot/cardmaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244257277,"owners_count":20424129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["board-game","card-game","tool"],"created_at":"2024-11-24T21:08:30.104Z","updated_at":"2025-03-18T15:59:42.409Z","avatar_url":"https://github.com/mrpierrot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Cardmaker\n\nCardmaker is a command line tool used to generate game's cards from a template and a Google Spreadsheet.\nIt is currently operational for card prototyping.\n\n= UPDATE : DECKCARDS IS NOW CARDMAKER\n\nCardmaker is more simple to tape than Deckcards :-)\n\n== For non-developers\n\nCardmaker needs somes basics knowledges in HTML/CSS and the use of command lines.\n\n== Disclaimer\n\nIt's an early version that barely comes out of the furnace.\nIf 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]\n\n== Install\n\nhttps://nodejs.org[NodeJS] is required to install Cardmaker. You must install it.\n\nInstall with npm:\n------\nnpm install @mrpierrot/cardmaker -g\n------\n\n== Get started\n\n=== Create a project\n\nFirst, use this command to create a project with default content in the directory *\"project_name\"*:\n\n------\ncardmaker setup \u003cproject_name\u003e\n------\n\nNext, go to the directory *\"project_name\"*\n\n------\ncd ./\u003cproject_name\u003e\n------\n\nThe project contains the following files :\n\n[options=\"header,footer\"]\n|===========================================\n| File                       | Description\n| cardmaker.json             | The configuration files\n| templates/default.hbs      | The Handlebars template file. Look at http://handlebarsjs.com/[Handlebars.js] to edit.\n| layouts/basic.hbs          | The Handlebars layout file. Look at http://handlebarsjs.com/[Handlebars.js] to edit.\n| styles.css                 | The template's styles.\n|===========================================  \n\n\n=== cardmaker.json\n\nThe default cardmaker.json\n\n[source, json]\n------\n{\n    \"templates\": {\n        \"default\": \"templates/default.hbs\"\n    },\n    \"layouts\": {\n        \"basic\": \"layouts/basic.hbs\"\n    },\n    \"gsheet\":{\n        \"sheetId\":\"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8\",\n        \"credentials\":null\n    }\n}\n------\n\n==== Description\n\n[options=\"header,footer\"]\n|============================================\n| Name              | Description \n| templates         | The HTML templates path. It's a dictionnary with sheet name as key\n| layouts           | Layout system : usefull to manage differents printers\n| output            | The directory where final HTML files are generated\n| gsheet.sheetId    | The Google Spreadsheet's ID. It can be found here:\ndocs.google.com/spreadsheets/d/*1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8*/edit?usp=sharing\n| gsheet.credentials | The credentials file path (i.e. *\"./credentials.json\"*). Set it to *null* if you use a public Google Spreadsheet.\n|============================================\n\n=== Configure Google authentication\n\nFor private and public Google Spreadsheets, follow the instructions from https://github.com/theoephraim/node-google-spreadsheet#authentication[node-google-spreadsheet]\n\nIf you use private Google Spreadsheet, you get a JSON file with credentials. Copy this file into the project directory and rename it *credentials.json*\n\nIn cardmaker.json, define the credentials.json path like this:\n\n[source, json]\n------\n{\n    ...\n    \"gsheet\":{\n        ...\n        \"credentials\":\"./credentials.json\"\n    }\n}\n------\n\n=== Google Spreadsheet Format\n\nYou can find an example https://docs.google.com/spreadsheets/d/1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8/edit#gid=2092230795[here]\n\nThe first line contains the variable names (here: NAME and DESC) and the next lines store the values.\n\nYou can define several sheets, each of them generating its own HTML page.\n\n==== Meta Variables\n\nIn the first line, you can define Meta variables used by the Cardmaker engine\n\n[options=\"header,footer\"]\n|==========================================================================\n| Variable          | Description\n| _COUNT           | Repeat a card N times ( N is defined in a card line )\n| _SKIP            | if equal to 1 or TRUE, skip the line\n|==========================================================================\n\n=== Build\n\nFinally, to generate cards use this : \n\n-------\ncardmaker build\n-------\n\n=== Watch \n\n-------\ncardmaker watch\n-------\n\nYou can watch templates and data files : when there are modified, the watcher build the cards\n\n=== Export\n\n-------\ncardmaker export\n-------\n\nYou can export to pdf files\n\n== Reference\n\n=== Setup command\n\n-------\ncardmaker setup \u003cproject_name\u003e \u003coptions\u003e\n-------\n\n[options=\"header,footer\"]\n|============================================================\n| Option                     | Alias | Description\n| --template \u003cname\\|path\u003e    | -t    | Use a specific template\n|============================================================\n\n=== Build command\n\n-------\ncardmaker build \u003coptions\u003e\n-------\n\n[options=\"header,footer\"]\n|============================================================\n| Option                    | Alias | Description\n| --layout                  | -l    | The chosen layout to use\n| --nobrowser               | -n    | Skip opening generated of files in the browser\n|============================================================\n\n=== Fetch command\n\n-------\ncardmaker fetch\n-------\n\n=== Watch command\n\n-------\ncardmaker watch \u003coptions\u003e\n-------\n\n[options=\"header,footer\"]\n|============================================================\n| Option                    | Alias | Description\n| --layout                  | -l    | The chosen layout to use\n| --nobrowser               | -n    | Skip opening generated of files in the browser\n|============================================================\n\n=== Export command\n\n-------\ncardmaker export \u003coptions\u003e\n-------\n\n[options=\"header,footer\"]\n|============================================================\n| Option                    | Alias | Description\n| --layout                  | -l    | The chosen layout to use\n|============================================================\n\n=== Template/Layout management\n\nCardmaker can manage template with ou without layout\n\n==== Work without layouts\n\nThis is a example of template without layouts : All the content are in an unique template\n\n[source, html]\n------\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003ctitle\u003e{{title}}\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" href=\"{{base}}/styles.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cdiv class=\"card-list\"\u003e\n        {{#each cards}}\n            \u003cdiv class=\"card\"\u003e\n                \u003cdiv class=\"card-title\"\u003e{{NAME}}\u003c/div\u003e\n                {{#if DESC }}\u003cdiv class=\"card-desc\"\u003e{{DESC}}\u003c/div\u003e{{/if}}\n            \u003c/div\u003e\n        {{/each}}\n    \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n------\n\n==== Work with layouts\n\nIf 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. \n\nThis is a basic layout : \n\n[source, html]\n------\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003ctitle\u003e{{title}}\u003c/title\u003e\n  \u003clink rel=\"stylesheet\" href=\"{{base}}/styles.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cdiv class=\"card-list\"\u003e\n        {{#each cards}}\n            {{\u003ecard card=.}}\n        {{/each}}\n    \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n------\n\nYou can note the \n\n[source, html]\n------\n    {{\u003ecard card=.}}\n------\n\nThis is a basic Handlebars partial name **card** \nThe current card data is pass to this partial\n\nAnd your template look like this now : \n\n[source, html]\n------\n\u003cdiv class=\"card\"\u003e\n    \u003cdiv class=\"card-title\"\u003e{{NAME}}\u003c/div\u003e\n    {{#if DESC }}\u003cdiv class=\"card-desc\"\u003e{{DESC}}\u003c/div\u003e{{/if}}\n\u003c/div\u003e\n------\n\n==== Layout in cardmaker.json\n\nBasic configuration : \n\n[source, json]\n------\n{\n    \"templates\": {\n        \"default\": \"templates/default.hbs\"\n    },\n    \"layouts\": {\n        \"basic\": \"layouts/basic.hbs\"\n    },\n    \"gsheet\":{\n        \"sheetId\":\"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8\",\n        \"credentials\":null\n    }\n}\n------\n\nAdvanced configuration with layout overrides : \n\n[source, json]\n------\n{\n    \"templates\": {\n        \"default\": {\n            \"template : \"templates/default.hbs\",\n            \"layouts\" : {\n                \"basic\" : \"layouts/basic-overridden.hbs\"\n            }\n        }\n    },\n    \"layouts\": {\n        \"basic\": \"layouts/basic.hbs\"\n    },\n    \"gsheet\":{\n        \"sheetId\":\"1QJm95kTdpR9XT6fC7sirsPRVFjOOri74-jH3mSd1gf8\",\n        \"credentials\":null\n    }\n}\n------\n\n==== Build and watch with layouts.\n\nTo buid : \n[source]\n------\ncardmaker build -l pro\n------\n\nor\n\n[source]\n------\ncardmaker build --layout pro\n------\n\nTo watch : \n\n[source]\n------\ncardmaker watch -l pro\n------\n\nor \n\n[source]\n------\ncardmaker watch --layout pro\n------\n\n=== License\n\nLicensed under the link:LICENSE[MIT]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrpierrot%2Fcardmaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrpierrot%2Fcardmaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrpierrot%2Fcardmaker/lists"}