mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-09 04:25:12 +00:00
feat(definitions): helper script to create defs from data list
This commit is contained in:
parent
c9b04a6fbe
commit
02a937e2a6
1
_temp/create-empty-definitions-min.js
vendored
Normal file
1
_temp/create-empty-definitions-min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
import slugify from"slugify";import path from"path";import fs from"fs";import{promisify}from"util";const writeFile=promisify(fs.writeFile);import{words}from"./undefined-words";const defintionPath=path.resolve(process.cwd(),"11ty/definitions/"),template="\n---\ntitle: {{title}}\nslug: {{slug}}\ndefined: false\n---\n";export function createDefinitions(){return words.forEach(async t=>{const e=t,i=slugify(t.toLowerCase().replace(/ \([a-z]+\)| ([a-z-]+) slur/i,"")),r=template.replace("{{title}}",e).replace("{{slug}}",i).trim();try{await writeFile(`${defintionPath}/${i}.md`,r,"utf8")}catch(t){console.error(t),process.exit(1)}return!0})}
|
36
_temp/create-empty-definitions.js
Normal file
36
_temp/create-empty-definitions.js
Normal file
@ -0,0 +1,36 @@
|
||||
import slugify from 'slugify'
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
import { promisify } from 'util'
|
||||
|
||||
const writeFile = promisify(fs.writeFile)
|
||||
|
||||
import { words } from './undefined-words'
|
||||
const defintionPath = path.resolve(process.cwd(), '11ty/definitions/')
|
||||
|
||||
const template = `
|
||||
---
|
||||
title: {{title}}
|
||||
slug: {{slug}}
|
||||
defined: false
|
||||
---
|
||||
`
|
||||
|
||||
export function createDefinitions() {
|
||||
return words.forEach(async (word) => {
|
||||
const title = word
|
||||
const slug = slugify(word.toLowerCase().replace(/ \([a-z]+\)| ([a-z-]+) slur/i, ''))
|
||||
|
||||
const content = template.replace('{{title}}', title).replace('{{slug}}', slug).trim()
|
||||
|
||||
try {
|
||||
await writeFile(`${defintionPath}/${slug}.md`, content, 'utf8')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
}
|
162
_temp/undefined-words.json
Normal file
162
_temp/undefined-words.json
Normal file
@ -0,0 +1,162 @@
|
||||
{
|
||||
"words": [
|
||||
"Ableism",
|
||||
"American",
|
||||
"Ambulatory Wheelchair",
|
||||
"Ancestors",
|
||||
"Anti-",
|
||||
"Anxiety disorders",
|
||||
"aromantic",
|
||||
"Asian",
|
||||
"asexual",
|
||||
"Acquired Immune Deficiency Syndrome (AIDS)",
|
||||
"assigned at birth",
|
||||
"Attraction",
|
||||
"Attention-Deficit/Hyperactivity Disorder (ADHD)",
|
||||
"Autism spectrum",
|
||||
"Bias",
|
||||
"Bierasure",
|
||||
"Bipolar medical appropriation",
|
||||
"Black Asian Minority Ethnic (BAME)",
|
||||
"Black Indigenous People of Color (BIPOC)",
|
||||
"Black",
|
||||
"Brown",
|
||||
"Bropropriating",
|
||||
"Burka",
|
||||
"Child of a Deaf Adult (CODA)",
|
||||
"Climate change",
|
||||
"Colonial narrative",
|
||||
"Colonialism",
|
||||
"colorism",
|
||||
"Complex Post-Traumatic Stress Disorder (PTSD)",
|
||||
"cultural appropriation",
|
||||
"Crippled ableist slur",
|
||||
"Demi",
|
||||
"deaf and Deaf",
|
||||
"Disability",
|
||||
"Disabled",
|
||||
"Discordant couples",
|
||||
"Discrimination",
|
||||
"Dominant culture",
|
||||
"Dominant culture habits",
|
||||
"Ehlers-Danlos Syndromes (EDS)",
|
||||
"Egalitarian",
|
||||
"Empathy",
|
||||
"enby",
|
||||
"Entitlement",
|
||||
"Equality",
|
||||
"Equity",
|
||||
"Ethnicity",
|
||||
"Fat",
|
||||
"Fem",
|
||||
"Femme",
|
||||
"Gender",
|
||||
"Gender confirmation surgery (GCS)",
|
||||
"Gender pronouns",
|
||||
"Genocide",
|
||||
"Governmentality",
|
||||
"gray ace",
|
||||
"Gray asexuality",
|
||||
"Hard of Hearing (HOH)",
|
||||
"hegemonic",
|
||||
"Hermaphrodite",
|
||||
"High-Functioning",
|
||||
"Hijab",
|
||||
"Hispanic",
|
||||
"Human Immunodeficiency Virus (HIV)",
|
||||
"Homophobia",
|
||||
"Hormone Replacement Therapy (HRT)",
|
||||
"Idiot ableist slur",
|
||||
"Illness",
|
||||
"Immigrant",
|
||||
"Impact",
|
||||
"Implicit bias",
|
||||
"Indigenous",
|
||||
"Inherent",
|
||||
"Intent",
|
||||
"internalized oppression",
|
||||
"Intersectionality",
|
||||
"intersex",
|
||||
"invisible disabilities",
|
||||
"Jihad",
|
||||
"Lame ableist slur",
|
||||
"Latinx",
|
||||
"Lunatic ableist slur",
|
||||
"Maniac ableist slur",
|
||||
"Marginalized",
|
||||
"Matriarchy",
|
||||
"Medication sensitive",
|
||||
"Midget ableist slur",
|
||||
"Militarisation",
|
||||
"Misogynoir",
|
||||
"Moron ableist slur",
|
||||
"Neurodivergent",
|
||||
"Neurodiverse",
|
||||
"Neurotypical",
|
||||
"N-word racist slur",
|
||||
"-normative",
|
||||
"nuts ableist slur",
|
||||
"Obese anti-fat slur",
|
||||
"Oppression",
|
||||
"Other specified feeding or eating disorders (OSFED)",
|
||||
"Panic attacks",
|
||||
"-passing",
|
||||
"Parachuting",
|
||||
"Patriarchy",
|
||||
"People of Color (PoC)",
|
||||
"People with disabilities",
|
||||
"-phile",
|
||||
"-phobia",
|
||||
"Platonic",
|
||||
"Positivism",
|
||||
"Post-Traumatic Stress Disorder (PTSD)",
|
||||
"power",
|
||||
"Poz",
|
||||
"Prejudice",
|
||||
"Pride",
|
||||
"Prophylaxis",
|
||||
"Privilege",
|
||||
"Psych ableist slur",
|
||||
"Psychopath ableist slur",
|
||||
"Race",
|
||||
"Racism",
|
||||
"Racist",
|
||||
"R-tard ableist slur",
|
||||
"Savage racist slur",
|
||||
"Savior",
|
||||
"Semitic",
|
||||
"Serodiscordant",
|
||||
"settler",
|
||||
"Sexual",
|
||||
"Socially constructed",
|
||||
"Solidarity",
|
||||
"Spaz ableist slur",
|
||||
"-Splaining",
|
||||
"Spirit animalcultural appropriation",
|
||||
"Stupid ableist slur",
|
||||
"Systematic",
|
||||
"Systemic",
|
||||
"-tard ableist slur",
|
||||
"Top-down approach",
|
||||
"Totemic animal",
|
||||
"Tawhid",
|
||||
"Tranny anti-trans slur",
|
||||
"Trans",
|
||||
"Trans Exclusionary Radical Feminist (TERF)",
|
||||
"Tribe",
|
||||
"Triggers",
|
||||
"Two-spirited",
|
||||
"Undetectable=Untransmittable (U=U)",
|
||||
"Undetectable",
|
||||
"Unqueer",
|
||||
"Indigenous",
|
||||
"Vertigo",
|
||||
"Vestibular migraine",
|
||||
"Violence against women and girls (VAWG)",
|
||||
"Viral Load",
|
||||
"White",
|
||||
"White supremacist capitalist patriarchy",
|
||||
"womanism",
|
||||
"womxn"
|
||||
]
|
||||
}
|
5
bin/create-definitions
Executable file
5
bin/create-definitions
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require = require('esm')(module /*, options*/);
|
||||
|
||||
require('../_temp/create-empty-definitions').createDefinitions()
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -1344,6 +1344,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"esm": {
|
||||
"version": "3.2.25",
|
||||
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
|
||||
"integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
|
||||
"dev": true
|
||||
},
|
||||
"esprima": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
||||
|
10
package.json
10
package.json
@ -8,7 +8,11 @@
|
||||
"build": "eleventy",
|
||||
"watch": "eleventy --watch",
|
||||
"serve": "eleventy --serve",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"create-definitions": "bin/create-definitions"
|
||||
},
|
||||
"bin": {
|
||||
"create-definitions": "bin/create-definitions"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -28,5 +32,9 @@
|
||||
"markdown-it-anchor": "^5.2.5",
|
||||
"markdown-it-prism": "^2.0.3",
|
||||
"prism-themes": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esm": "^3.2.25",
|
||||
"slugify": "^1.3.6"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user