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:

  1. Install the cli package from NPM:

    npm i -g @oscsa/jsquarto 
  2. Install Quarto, to do this refer to the official Quarto installation guide

  3. Install Babel quarto, refer to the official Babel Quarto installation guide

Running the Tool


  1. To generate the documentation run the following command

    jsq doc:generate

    This 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_files are, to do this run

    jsq 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 /tutorials directory

    The generated .qmd files can be found in the docs/build folder

    This 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

  2. To preview the generated documentation run

    jsq doc:preview

    The docs are previewed with quarto, so make sure to have quarto already installed