mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(apidoc): Fixing contrast in api docs
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to improve contrast in auto-generated API documentation
|
||||||
|
# The code examples in api-doc use grey-on-grey colors that are hard to read.
|
||||||
|
# This fixes that issue by improving text contrast for better readability.
|
||||||
|
# Run this script *after* running 'npm run docs'
|
||||||
|
|
||||||
|
FILE="./docs/assets/prism.css"
|
||||||
|
|
||||||
|
# Check if file exists
|
||||||
|
if [ ! -f "$FILE" ]; then
|
||||||
|
echo "Error: $FILE not found. Make sure to run 'npm run docs' first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a backup
|
||||||
|
#cp "$FILE" "$FILE.bak"
|
||||||
|
|
||||||
|
# Improve contrast:
|
||||||
|
# - Change default text color from #ccc to #e8e8e8 (brighter light gray)
|
||||||
|
# - Change comment color from #999 to #b5b5b5 (lighter for better visibility)
|
||||||
|
# - Change punctuation color from #ccc to #e8e8e8 (consistent with text)
|
||||||
|
|
||||||
|
# Replace default text color in code[class*="language-"] and pre[class*="language-"]
|
||||||
|
sed -i 's/color: #ccc;/color: #000000;/g' "$FILE"
|
||||||
|
|
||||||
|
# Replace comment color
|
||||||
|
sed -i 's/color: #999;/color: #b5b5b5;/g' "$FILE"
|
||||||
|
|
||||||
|
|
||||||
|
# Replace punctuation color (already handled by first sed, but explicit for clarity)
|
||||||
|
# The punctuation token also uses #ccc, so the first sed command handles it
|
||||||
|
|
||||||
|
echo "✓ Improved contrast in prism.css:"
|
||||||
|
echo " - Default text: #ccc → #e8e8e8"
|
||||||
|
echo " - Comments: #999 → #b5b5b5"
|
||||||
|
echo " - Punctuation: #ccc → #e8e8e8"
|
||||||
|
|
||||||
Generated
+490
-384
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -23,7 +23,7 @@
|
|||||||
"test:integration:decatur:abc": "export RESTURL=http://192.168.2.142:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/",
|
"test:integration:decatur:abc": "export RESTURL=http://192.168.2.142:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/",
|
||||||
"test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/",
|
"test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/",
|
||||||
"coverage": "nyc --reporter=html mocha --timeout 25000 test/unit/",
|
"coverage": "nyc --reporter=html mocha --timeout 25000 test/unit/",
|
||||||
"docs": "./node_modules/.bin/apidoc -i src/ -o docs",
|
"docs": "./node_modules/.bin/apidoc -i src/ -o docs && ./fix-docs-contrast.sh",
|
||||||
"lint": "standard --env mocha --fix"
|
"lint": "standard --env mocha --fix"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"wif": "2.0.6"
|
"wif": "2.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"apidoc": "0.50.5",
|
"apidoc": "1.2.0",
|
||||||
"assert": "2.1.0",
|
"assert": "2.1.0",
|
||||||
"c8": "10.1.3",
|
"c8": "10.1.3",
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
|
|||||||
Reference in New Issue
Block a user