UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

122 lines (88 loc) 5.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WikiSetup = void 0; const doc_maker_1 = require("./wiki-mk/doc-maker"); const doc_files_1 = require("./doc-util/doc-files"); /** * https://github.com/flowr-analysis/flowr/wiki/Setup */ class WikiSetup extends doc_maker_1.DocMaker { constructor() { super('wiki/Setup.md', module.filename, 'setup instructions'); } text({ ctx }) { return ` There are several ways to use _flowR_. You can download and build it from source, download the accompanying [docker image](${doc_files_1.FlowrDockerRef}), or use its [Visual Studio Code extension](${doc_files_1.FlowrVsCode}) and [RStudio Addin](${doc_files_1.FlowrRStudioAddin}). - [🗒️ Using the Visual Studio Code Extension](#-using-the-visual-studio-code-extension) - [🗒️ Using the RStudio Addin](#-using-the-rstudio-addin) - [🐳️ Using the Docker Image](#-using-the-docker-image) - [⚒️ Building From Scratch](#-building-from-scratch) - [📜 Developing for _flowR_](#-developing-for-flowr) If you want to develop for _flowR_, you want to see how to [build from scratch](#-building-from-scratch) and have a look at the [Contributing Guidelines](https://github.com/flowr-analysis/flowr/tree/main//.github/CONTRIBUTING.md). ## 🗒️ Using the Visual Studio Code Extension The easiest way to use _flowR_ is to install the [Visual Studio Code extension](${doc_files_1.FlowrVsCode}). The extension directly includes a version of _flowR_ that can be used by default, so you can start analyzing code right away (given that you have R installed on your system). Please check out the marketplace entry for more information. This extension works with Positron as well (in general, it is available on [open-vsx](${doc_files_1.FlowrPositron}) as well). ## 🗒️ Using the RStudio Addin You can also use _flowR_ as an RStudio Addin. Please check out the [RStudio Addin repository](${doc_files_1.FlowrRStudioAddin}) for more information on how to get started! ## 🐳️ Using the Docker Image You can get the image from [docker hub](${doc_files_1.FlowrDockerRef}) by running: \`\`\`shell docker pull eagleoutice/flowr \`\`\` Afterward, you can test if the installation was successful by running the following (currently, there is no helper script for that): \`\`\`shell docker run -it --rm eagleoutice/flowr \`\`\` This should drop you into _flowR_'s read-evaluate-print loop. Enter ${ctx.replCmd('help')} to receive more information and ${ctx.replCmd('quit')} to leave. Please remember that you have to link external directories to make them available within the running container. To start flowr as a server, you can run: \`\`\`shell docker run -it --rm -p1042:1042 eagleoutice/flowr --server \`\`\` For more information, see the ${ctx.linkPage('wiki/Interface')} wiki page. ## ⚒️ Building From Scratch To use _flowR_, you may need [_R_](https://www.r-project.org/) installed and on your path (this only affects the [\`r-shell\` engine][r-shell], which is _not_ the default). ### Installing R Although there are several ways to do so, there is nothing wrong with installing&nbsp;R with the help of your favorite package manager or directly from the [website](https://cloud.r-project.org/).<a href="#note1" id="note1ref"><sup>&lt;1&gt;</sup></a> For 🪟&nbsp;Windows, see [here](https://www.hanss.info/sebastian/post/rtools-path/) for an explanation on how to add [_R_](https://www.r-project.org/) to your path variable. Again, you only require this for the [\`r-shell\` engine][r-shell]. ### Installing Node.js Furthermore, you need the [node package manager](https://www.npmjs.com/) (for Linux, we recommend using [nvm](https://github.com/nvm-sh/nvm)). To work, we currently rely on node versions starting from \`22.x\`. ### Installing _flowR_ After cloning the repository,<a href="#note2" id="note2ref"><sup>&lt;2&gt;</sup></a> you can install the dependencies with: \`\`\`shell npm i \`\`\` After that, you should be fine! You may test _flowR_'s command-line interface by running the following from the \`cli\` directory: \`\`\`shell npm run slicer -- --criterion "12@product" test/testfiles/example.R \`\`\` The output should look similar to this: \`\`\`R product <- 1 N <- 10 for(i in 1:(N-1)) product <- product * i cat("Product:", product, "\\n") \`\`\` At the time of writing this, there is currently no page for frequently encountered errors. So just [message me](mailto:florian.sihler@uni-ulm.de) in case of problems. ## 📜 Developing for _flowR_ If you want to develop for _flowR_, explore the wiki. For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository. ----- <a id="note1" href="#note1ref">&lt;1&gt;</a>: Currently, _flowR_ is only tested with R versions \`4.x\` and \`3.6.x\`. <a id="note2" href="#note2ref">&lt;2&gt;</a>: We use [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository for more information). [r-shell]: (https://github.com/flowr-analysis/flowr/wiki/Engines) `.trim(); } } exports.WikiSetup = WikiSetup; //# sourceMappingURL=wiki-setup.js.map