mirror of
https://github.com/AskDavis/Getting-Started-With-ACPI.git
synced 2026-01-01 05:05:57 -08:00
I2C Trackpad improvements (#42)
This commit is contained in:
9
scripts/linkcheck.py
Normal file
9
scripts/linkcheck.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
|
||||
for i in [i for i in list(Path().resolve().glob("**/*.md")) if "node_modules" not in str(i.parent) and "_book" not in str(i.parent)]:
|
||||
#bert = subprocess.run(['npx', 'markdown-link-check', '"' + str(i) + '"', '-c', '.markdownlinkcheck.json'], capture_output=True, shell=True, cwd=Path().resolve())
|
||||
bert = subprocess.run('npx markdown-link-check "' + str(i) + '"', stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, cwd=Path().resolve())
|
||||
outpot = bert.stdout.decode().replace("\r", "").split("\n")
|
||||
outpot = [i for i in outpot if ("FILE: " in i or " → Status: " in i) and " → Status: 429" not in i]
|
||||
[print(i) for i in outpot]
|
||||
26
scripts/sortDict.js
Normal file
26
scripts/sortDict.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const fs = require("fs");
|
||||
|
||||
process.chdir(__dirname);
|
||||
|
||||
console.log("Reading dictionary.txt");
|
||||
let dictionary = fs.readFileSync("../dictionary/dictionary.txt", { encoding: "UTF8" })
|
||||
.replace("\r", "").split("\n");
|
||||
|
||||
let ocDictionary = fs.readFileSync("../dictionary/opencorekeys.txt", { encoding: "UTF8" })
|
||||
.replace("\r", "").split("\n");
|
||||
|
||||
dictionary = dictionary.filter(string => string != "");
|
||||
ocDictionary = ocDictionary.filter(string => string != "");
|
||||
|
||||
dictionary = dictionary.filter((string, index) => dictionary.indexOf(string) == index);
|
||||
ocDictionary = ocDictionary.filter((string, index) => ocDictionary.indexOf(string) == index);
|
||||
|
||||
dictionary = dictionary.filter(string => !ocDictionary.includes(string));
|
||||
|
||||
console.log("Sorting...");
|
||||
dictionary.sort();
|
||||
ocDictionary.sort();
|
||||
|
||||
console.log("Writing dictionary.txt");
|
||||
fs.writeFileSync("../dictionary/dictionary.txt", dictionary.join("\n"));
|
||||
fs.writeFileSync("../dictionary/opencorekeys.txt", ocDictionary.join("\n"));
|
||||
Reference in New Issue
Block a user