add src folder
This commit is contained in:
1 parent
79673e55fe
commit
16f3e28690
9 files changed
+232
-204
No files matched your search
@@ -1,39 +1,39 @@
|
||||
import fs from 'fs'
|
||||
import fs from 'fs';
|
||||
|
||||
import { radicals } from './beautify-radicals'
|
||||
import { radicals } from './beautify-radicals';
|
||||
|
||||
async function main() {
|
||||
const map = radicals.load()
|
||||
const map = radicals.load();
|
||||
|
||||
fs.writeFileSync(
|
||||
'../../_radicals.md',
|
||||
Object.entries(map)
|
||||
.map(([k, v]) => {
|
||||
const headers = [k]
|
||||
const headers = [k];
|
||||
if (v.meaning !== k) {
|
||||
headers.push(v.meaning)
|
||||
headers.push(v.meaning);
|
||||
}
|
||||
if (v.reading) {
|
||||
headers.push(v.reading)
|
||||
headers.push(v.reading);
|
||||
}
|
||||
headers.push(String(v.level))
|
||||
headers.push(String(v.level));
|
||||
|
||||
const rows = [`## ${headers.join(', ')}`, '']
|
||||
const rows = [`## ${headers.join(', ')}`, ''];
|
||||
if (v.image) {
|
||||
rows.push(
|
||||
`<img src="${v.image.src}" alt="${k}"${
|
||||
v.image.width ? ` width="${v.image.width}"` : ''
|
||||
}${v.image.height ? ` height="${v.image.height}"` : ''} />`,
|
||||
''
|
||||
)
|
||||
'',
|
||||
);
|
||||
}
|
||||
|
||||
return rows.join('\n')
|
||||
return rows.join('\n');
|
||||
})
|
||||
.join('\n\n')
|
||||
)
|
||||
.join('\n\n'),
|
||||
);
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main()
|
||||
main();
|
||||
}
|
||||
Reference in new issue
Block a user