@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
75 lines (59 loc) ⢠3.94 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const log_1 = require("../../test/functionality/_helper/log");
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
const doc_files_1 = require("./doc-util/doc-files");
const doc_code_1 = require("./doc-util/doc-code");
function print() {
return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'frequently asked questions' })}
## š® *flowR* FAQ
### š§āš» *flowR* Development
${qAndA('What are test labels and how do they work?', `
Tests are labeled based on the *flowR* capabilities that they test for. The list of supported capabilities can be found on the [Capabilities](${doc_files_1.FlowrWikiBaseRef}/Capabilities) wiki page. For more extensive information on test labels, see the [test labels wiki section](${doc_files_1.FlowrWikiBaseRef}/Linting-and-Testing#test-labels).
`)}
${qAndA('How do I generate mermaid diagrams?', `
There are several ways to generate mermaid diagrams based on the input data that you want to use.
- From the AST (abstract syntax tree): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/ast.ts')}
- From the CFG (control flow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/cfg.ts')}
- From the DFG (dataflow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}
`)}
${qAndA('How do I create new wiki pages?', `
To create an automatically generated wiki page, you can follow these steps:
- Createa a new file in \`src/documentation\` with a name like \`print-my-page-wiki.ts\`.
- Add a new wiki generation script to the ${(0, doc_files_1.getFilePathMd)('../../package.json')}. You can copy one of the existing ones of the form \`"wiki:my-page": "ts-node src/documentation/print-my-page-wiki.ts"\`.
- Add the wiki generation script to the \`broken-links-and-wiki.yml\` GitHub workflow file to enable automatic generation through the CI. You can copy one of the existing ones of the form \`update_page wiki/"My page" wiki:my-page\`.
You can test your page by piping the wiki generation script to a file. For example, you can run the following command:
${(0, doc_code_1.codeBlock)('shell', 'npm run --silent wiki:my-page > __my-page.md')}
`)}
Remember not to commit this file, as it's only meant for testing.
## š· R FAQ
### š¦ R Packages
${qAndA('What is the R prelude and R base package?', `
The base package contains lots of base functions like \`source\` for example.
The R prelude includes the base package along with several other packages.
Packages that were loaded by the prelude can be called without prefixing the function call with the package name and the \`::\` operator.
The packages loaded by the R prelude can be seen in the \`attached base packages\` sections in the output of \`sessionInfo()\`.
`)}
${qAndA('How to get documentation for a function or package?', `
There are a couple of ways to get documentation for a function or package.
š„ļø Firstly, if you have already installed the package the function originated from you can simply run \`?<package name>::<function name>\` in an R session to print the
relevant documentation. If you don't know the origin of the package, you can use
\`??<function name>\` in an R shell to fuzzy find all documentations containing
\`<function name>\` or something similar.
š Secondly, if you don't have or don't want to install the package you can simply google the fully qualified name of the function. Good sources include \`rdrr.io\`
or \`rdocumentation.org\`. Additionally, the package documentation PDF can also
be downloaded directly from \`cran\`.
`)}
`.trim();
}
function qAndA(question, answer) {
return `<details>
<summary><strong>${question}</strong></summary>
${answer.trim()}
</details>`;
}
if (require.main === module) {
(0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
console.log(print());
}
//# sourceMappingURL=print-faq-wiki.js.map