mirror of
https://github.com/nix-community/noogle.git
synced 2024-12-02 06:24:05 +03:00
d9f579cf44
* 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
37 lines
477 B
JavaScript
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);
|
|
}
|
|
});
|