{"id":24520453,"url":"https://github.com/pfirpfel/pub-quiz-generator","last_synced_at":"2025-10-25T21:33:50.076Z","repository":{"id":152604915,"uuid":"625503449","full_name":"pfirpfel/pub-quiz-generator","owner":"pfirpfel","description":"Write a pub quiz as YAML, compile into HTML presentation","archived":false,"fork":false,"pushed_at":"2025-04-07T11:42:50.000Z","size":5095,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T16:50:35.273Z","etag":null,"topics":["nodejs","presentation","pub-quiz","reveal-js","revealjs"],"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/pfirpfel.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-09T10:11:57.000Z","updated_at":"2025-03-18T10:36:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"52808231-02cc-4dac-8052-e331d248099a","html_url":"https://github.com/pfirpfel/pub-quiz-generator","commit_stats":{"total_commits":145,"total_committers":3,"mean_commits":"48.333333333333336","dds":"0.40689655172413797","last_synced_commit":"0ab69a1d9c228a1cda17c93cdb65d89cf6c1e2b8"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfirpfel%2Fpub-quiz-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfirpfel%2Fpub-quiz-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfirpfel%2Fpub-quiz-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfirpfel%2Fpub-quiz-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfirpfel","download_url":"https://codeload.github.com/pfirpfel/pub-quiz-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248867590,"owners_count":21174748,"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":["nodejs","presentation","pub-quiz","reveal-js","revealjs"],"created_at":"2025-01-22T02:22:38.982Z","updated_at":"2025-10-25T21:33:50.064Z","avatar_url":"https://github.com/pfirpfel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pub Quiz Generator [![npm version](https://badge.fury.io/js/pub-quiz-generator.svg?cache-control=no-cache)](https://www.npmjs.com/package/pub-quiz-generator)\nWrite your pub quiz questions and answers as YAML code and let this script generate a HTML presentation (using [reveal.js](https://revealjs.com/)) from it.\n\nAn example repository can be found [here](https://github.com/pfirpfel/example-pub-quiz), with the rendered output:\n- [Example presentation](https://pfirpfel.github.io/example-pub-quiz/)\n- [Example presentation with answers visible](https://pfirpfel.github.io/example-pub-quiz/answers.html)\n\n## Usage\n```shell\n./index.js -d example/\n```\n\nThis will create an `output` directory with following files:\n- `index.html` Main Pub Quiz presentation\n- `answers.html` Pub Quiz presentation with answers visible\n- `worksheet.html` Worksheet for the player teams, intended for print\n- `solutionsheet.html` Solutions in worksheet form, intended for print\n\nOptions:\n- `-d, --directory`: Path to the question directory (required)\n- `-o, --output`: Path to output directory, where the HTML is written to\n- `-t, --templates`: Path to template directory, if custom templates are needed\n\n## Dependencies\n- [Node.js](https://nodejs.org/en/download)\n\nOptional (for YouTube question type):\n- [Python 3.x](https://www.python.org/downloads/)\n- [ffmpeg](https://ffmpeg.org/download.html)\n\n\n## Question directory\nFolder structure:\n```\nExample_Quiz\n|_ config.yaml\n|_ 1-Category.yaml    # will be read alphabetically\n|_ 2-Category.yaml\n|_ 3-Category.yaml\n|_ media\n  |_ c1q3.mp3\n  |_ c1q3.png\n```\n\n### Configuration\nThe configuration file has to be named `config.yaml`. Check out the [example](example/config.yaml).\n\nOptions:\n- `title` (String): Used as `\u003ctitle\u003e`value for the HTML. Default: `Pub Quiz`\n- `worksheet_title`: Title on each worksheet\n- `custom_css` (String): Custom CSS to be injected into the HTML\n- `revealjs_path` (String): Path to reveal.js dependency. Default: `../node_modules/reveal.js/`\n- `revealjs_theme` (String): Reveal.js [theme](https://revealjs.com/themes/). Default: `black`\n\n### Categories\nAll yaml files in the root directory of the question directory other than `config.yaml` will be treated as categories.\nThey will be added to the quiz in alphabetical order.\nIf you want to have regular slides in addition to categories, just add category yaml files wit no `questions` attribute.\nCheck out the example directory!\n\nYAML format:\n```yaml\ntitle_page: # each category gets an title slide\n  title: Category title\n  image: media/category.jpg # optional, displayed below title\n  caption: Some caption text # optional, displayed below image\n  # if markdown is set, other properties than title will be ignored\n  markdown: |\n    - a\n    - b\n    - c\n\nquestions: # array of questions, if missing the category will be treated just as a slide\n    - type: text # simple text question\n      title: Capital cities # optional\n      question: What is the capital of Germany?\n      answer: Berlin\n      source: https://en.wikipedia.org/wiki/Germany # optional, displayed on the bottom in small font\n    \n    - type: markdown # markdown allows more formatting options\n      title: Best fruit? # optional, added as h2 title before markdown\n      markdown: |\n        1. Strawberry\n        2. Apple\n        3. Banana\n      answer: Banana\n      source: https://en.wikipedia.org/wiki/Fruit # optional, displayed on the bottom in small font\n    \n    - type: image # question with an image\n      title: Some title # optional, displayed above image\n      image: media/c1q3.png # path to image\n      caption: A caption # optional, displayed below image\n      answer_image: media/c1q3.png # path to answer_image, creates additional solution slide\n      answer: An answer\n      source: Artist, License # optional, displayed on the bottom in small font\n    \n    - type: audio # question with an audio file\n      audio: media/c1q3.mp3 # path to audio file\n      audio_type: audio/mp3 # mime type\n      autoplay: true # default: true\n      controls: true # display control buttons (volume, seeking, and pause/resume), default: true\n      title: Some title # optional, displayed above image\n      image: media/c1q3.png # optional,  path to image\n      caption: A caption # optional, displayed below image\n      answer_image: media/c1q3.png # path to answer_image, creates additional solution slide\n      answer: An answer\n      answer_audio: media/trivia1.ogg # additional audio, that shows up along the answer\n      answer_audio_type: audio/ogg # mime type of answer_audio\n      source: Artist, License # optional, displayed on the bottom in small font\n    \n    - type: video # question with a video file\n      video: media/c1q3.webm # path to video file\n      video_type: video/webm # mime type\n      autoplay: true # default: true\n      controls: true # display control buttons (volume, seeking, and pause/resume), default: true\n      title: Some title # optional, displayed above video\n      caption: A caption # optional, displayed below video\n      answer_image: media/c1q3.png # path to answer_image, creates additional solution slide\n      answer: An answer\n      source: Artist, License # optional, displayed on the bottom in small font\n\n    - type: youtube-dl # downloads media from YouTube\n      url: https://www.youtube.com/watch?v=dQw4w9WgXcQ # YouTube URL\n      hasVideo: true # default: true\n      hasAudio: true # default: true\n      start: 0:00 # default: 0:00\n      end: 1:00 # default: until the end\n      outputPath: media/\n      fileBaseName: dQw4w9WgXcQ  # file extension (.mp4 for example) will be added automatically\n      autoplay: true # default: true\n      controls: true\n      title: Some title # optional, displayed above video\n      caption: A caption # optional, displayed below video\n      answer_image: media/c1q3.png # path to answer_image, creates additional solution slide\n      answer: An answer\n      source: https://www.youtube.com/watch?v=dQw4w9WgXcQ # optional, displayed on the bottom in small font\n```\n\n#### Multiple title pages in a single category\nA category can have multiple title pages. To achieve this, replace the `title_page` attribute with `title_pages`.\nThere you can supply an array of title pages. Example:\n```yaml\ntitle_pages:\n  - title: Example Pub quiz\n\n  - title: Rules\n    markdown: |\n      - No more than 5 people per team\n      - No phones\n      - Drink!\n```\n\n### Media files\nIt is recommended to put all media files (images, audio, video) in a folder inside the question directory, like in the example.\n\n## Theme configuration\nCan be done in the `custom_css` property of `config.yaml`.\n\n### Category/question numbering\nTo disable category/question numbering, add this rule to the `custom_css` property:\n```css\n  #question_number {\n      display: none;\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfirpfel%2Fpub-quiz-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfirpfel%2Fpub-quiz-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfirpfel%2Fpub-quiz-generator/lists"}