Skip to content

Developer guide

Olivier Cots edited this page Sep 8, 2024 · 1 revision

This tutorial explains how to develop on a repository from the control-toolbox ecosystem based on the template CTApp.jl. We suppose you have installed Julia and that your package is called MyAwsomePackage.jl.

Clone the repository

Got to the location of your choice where the repository will be put. For instance,

cd ~/dev

Copy the ssh or html url, see where to click on the following image:

clone

and clone the repository:

git clone the-url-you-have-copied

Install VSCode

We recommend to use   Visual Studio Code   to develop. Install Visual Studio Code (denoted also VSCode).

Then, install the Julia extension.

We recommend to install the following extensions but there are not necessary for a basic usage:

Run unit tests

  • Run VSCode and open the folder ~/dev/MyAwsomePackage.jl.
open folder

using Pkg
Pkg.activate(".")
Pkg.test()

Tip

If you want to add some unit tests, please visit the Unit Testing page.

Build the documentation

using Pkg
Pkg.activate("docs")
Pkg.develop(path=pwd()); include("docs/make.jl"); Pkg.rm("MyAwsomePackage")

Note

There are three commands in the last line.

  • The first command Pkg.develop(path=pwd()) adds the package in docs/Project.toml to make it visible for the documentation. Thanks to this command, you can add using MyAwsomePackage in docs/make.jl or in the markdown files to get access to methods from your package to generate the documentation or to add docstrings.
  • The second command include("docs/make.jl") builds the documentation and put it in docs/build. Open docs/build/index.html to see your documentation.
  • The third command Pkg.rm("MyAwsomePackage") simply removes MyAwsomePackage to docs/Project.toml.

Tip

See the Julia documentation generator Documenter.jl to learn how to build the documentation from the docstrings and markdown files.

Clone this wiki locally