JSON Against Humanity

Finally, Cards Against Humanity® as plain text and JSON.

FAQ

How many cards are there?
Let me think about it for a second...
Wha— where the heck did you find all those cards??
The primary source is this Google Sheet I found through Board Game Geek. Previous sources included Hangouts Against Humanity, Pretend You're Xyzzy, and contributions from viewers like you.
What font is CAH?
Cards Against Humanity® cards are in Helvetica® Neue. It's not free. I use Inter Medium. You're looking at it now.
Who are you?
Chris Hallberg.
I'm just getting started and I have a lot of questions
You can reach me on Twitter as @crhallberg. I'd love to hear from you! My DMs are open if privacy is a concern.
I have the best feature idea! Can you add this?
Sure! Open a pull request or tweet at me.
I want to give you money.
Very nice of you, but you legally can't. More on that later. You should instead donate to a voting rights organization or donate to a local community bail fund.

File formats

cah-all-compact.json

{
  "white": ["Answer cards in plain text, formatted with **Markdown**"],
  "black": [
    { "text": "_Prompt_ cards\nformatted with _.", "pick": 1 },
    { "text": "I want a _ **and** _ sandwich! No corners!", "pick": 2 }
  ],
  "packs": {
    "abbreviation": {
      "name": "The Base Set",
      "description": "Sweet dirty vanilla",
      "official": true,
      "white": [0, 1, 2, "indexes for every white card in this pack"],
      "black": [0, 1, 2, "indexes for every black card in this pack"]
    }
  }
}

full.json (download or hydrated with CAHDeck.js)

[
  {
    "name": "The Base Set",
    "description": "Sweet dirty vanilla",
    "official": true,
    "white": [
      {
        "text": "Answer cards in plain text, formatted with **Markdown**",
        "pack": 0
      }
    ],
    "black": [
      {
        "text": "_Prompt_ cards\nformatted with _.",
        "pick": 1,
        "pack": 0
      }
    ]
  },
  { "white": [ { "pack": 1 }, ... ], ... },
  { "white": [ { "pack": 2 }, ... ], ... }
]

Plaintext

White, answer cards.
Putting a new card on each line.
Adding a divider after the white cards.
----------
I love it when my _ are in plaintext.
How are these cards styled?
Are **you** telling **me** that _these cards_ are styled with Markdown and _?

Examples

Canvas Deck Sampler
Demonstration of ingesting the cah-all-compact.json file with the basic Javascript library and displaying cards on a canvas element.
This Very Webpage
Ingesting from compact.json, listing decks, combining selected decks, and exporting files.

Fine Print

Is this legal?

Yes. Cards Against Humanity® is distributed under a Creative Commons BY-NC-SA 4.0 license.

I think their website puts it best:

We give you permission to use the Cards Against Humanity® writing under a limited Creative Commons BY-NC-SA 4.0 license. That means you can use our writing if (and only if) you do all of these things:

    1. Make your work available totally for free.
    2. Share your work with others under the same Creative Commons license that we use.
    3. Give us credit in your project.

If you have questions or paperwork that says otherwise, contact me, we can work this out.