Environment_setup
Prerequisites
Before testing the tool locally, ensure you have the following prerequisites installed on your system: - Node.js and npm (Node Package Manager) - Git (optional, if cloning the repository) - Babel Quarto (optional, if previewing the generated documentation)
Installation
To test the tool locally, follow these steps:
-
Install the cli package from NPM:
npm i -g @oscsa/jsquarto Install Quarto, to do this refer to the official Quarto installation guide
Install Babel quarto, refer to the official Babel Quarto installation guide
Running the Tool
-
To generate the documentation run the following command
jsq doc:generateThis will extract the JSDoc comments from the js files and write them to their corresponding Quarto Markdown files.
You can choose to specify the directory where the
source_filesare, to do this runjsq doc:generate source=<path to source files>It also supports addition of custom tutorials, to do this add the .qmd files for the tutorials in the
/tutorialsdirectoryThe generated
.qmdfiles can be found in thedocs/buildfolderThis command may vary depending on the workflow you choose, you may want to create the docs files in other languages too. To do this you can run the command below
jsq doc:generate languages=en,ar,es include_localized_versions source=<path to source files>This will generate the documentation in English, Arabic and Spanish. You can add more languages by separating them with a comma. (This doesn’t actually translate the documentation, it just creates a copy of the documentation and renames it to the specified language). To integrate with a translation service, you can use the Crowdin service.
For more information on the available workflows see the guide here Doc generation
-
To preview the generated documentation run
jsq doc:previewThe docs are previewed with quarto, so make sure to have quarto already installed