Skip to content

Commit

Permalink
Move recommendation on startup.jl from README to docs (#317)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Abbott <[email protected]>
  • Loading branch information
SamuelBrand1 and seabbs authored Jun 28, 2024
1 parent 40e2b6e commit 788ddce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
24 changes: 0 additions & 24 deletions EpiAware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,3 @@ We use [`Pluto.jl`](https://plutojl.org/) scripts as part of our documentation a

## Opinionated guide to using Julia for project development
Some user and potential contributors may not be familiar with using Julia for, or part of, project development. In documentation we give our opinions on how to use Julia for project development focussing on Julia version control with the command line tool `juliaup`, typical patterns for using stacked environments and useful settings for development using the Julia extension of VS-Code as an interactive development environment (IDE) for Julia project. Please find the documentation [here](https://cdcgov.github.io/Rt-without-renewal/dev/man/getting-started-julia/).

### `startup.jl` recommendation

We recommend adding a `startup.jl` file to import `Revise` and `Term` at the start of any Julia session. This file should be located in the `~/.julia/config` directory. Here is an example of a `startup.jl` file that loads the `Revise` and `Term`:

```julia
atreplinit() do repl
# Load Revise if it is installed
try
@eval using Revise
catch e
@warn "error while importing Revise" e
end
# Load Term if it is installed
try
@eval using Term
@eval install_term_repr()
@eval install_term_stacktrace()
catch e
@warn "error while importing Term" e
end
end

```
25 changes: 25 additions & 0 deletions EpiAware/docs/src/man/getting-started-julia.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,31 @@ In our view these packages are useful for your Julia version environment, e.g. `
- `TestEnv`: For easy use of test environments for package testing.
- `UnicodePlots`: For simple and quick plotting in the REPL without needing to install a fully featured plotting package.


### `startup.jl` recommendation

`Revise` and `Term` useful to have available in every Julia session. It is convenient to have these packages loaded automatically when you start a Julia session by adding a `startup.jl` file. This file should be located in the `~/.julia/config` directory. Here is an example of a `startup.jl` file that loads the `Revise` and `Term`:

```julia
atreplinit() do repl
# Load Revise if it is installed
try
@eval using Revise
catch e
@warn "error while importing Revise" e
end
# Load Term if it is installed
try
@eval using Term
@eval install_term_repr()
@eval install_term_stacktrace()
catch e
@warn "error while importing Term" e
end
end

```

## Developing a Julia project from VS-Code

### Julia extension for VS-Code
Expand Down

0 comments on commit 788ddce

Please sign in to comment.