mirror of
https://scm.univ-tours.fr/22107988t/rappaurio-sae501_502.git
synced 2025-08-29 08:25:57 +02:00
18 lines
350 B
JavaScript
18 lines
350 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const fs = require('fs')
|
|
const remark = require('remark')
|
|
const toc = require('remark-toc')
|
|
|
|
const readme = fs.readFileSync('./README.md').toString()
|
|
|
|
remark()
|
|
.use(toc, { tight: true, maxDepth: 2 })
|
|
.process(readme, function (err, file) {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
|
|
fs.writeFileSync('./README.md', file)
|
|
})
|