noogle/indexer/makeMarkdown.js
Johannes Kirschbauer d9f579cf44
Feature/monorepo (#24)
* refactor to include all necessary dependencies directly here

* move indexer into monorepo

* add snapshot tests and seperate sub.project for builtin types

* add more missing builtins such as fromTOML
2023-02-25 13:14:40 +01:00

37 lines
477 B
JavaScript

// simple script
// test.json in generated with "cargo run -- --dir ./test"
const data = require("./test.json");
const fs = require("fs");
const all_docs = data.reduce(
(acc, doc) => `${acc}
## ${doc.name}
### Description
\`\`\`nix
${doc.description}
\`\`\`
### Example
\`\`\`nix
${doc.example}
\`\`\`
### Type
\`\`\`nix
${doc.fn_type}
\`\`\`
`,
""
);
fs.writeFile("content.md", `# Functions\n${all_docs}`, (err) => {
if (err) {
console.error(err);
}
});