Skip to content

Commit

Permalink
Split PkgTemplates code blocks (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill authored Dec 3, 2024
1 parent cc9d397 commit 427fefd
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions sharing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ Do not insert any files like `README.md`, `.gitignore` or `LICENSE.md`, this wil
Indeed, we can leverage [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl) to automate package creation (like `]generate` from Pkg.jl but on steroids).
The following code gives you a basic file structure to start with:

```>pkgtemplates
```>pkgtemplates1
using PkgTemplates
dir = Utils.path(:site) # replace with the folder of your choice
t = Template(dir=dir, user="myuser", interactive=false);
t = Template(user="myuser", interactive=false);
```

```!pkgtemplates2
#hideall
t = Template(dir=Utils.path(:site), user="myuser", interactive=false);
```

```>pkgtemplates3
t("MyAwesomePackage")
```

Expand All @@ -45,12 +52,23 @@ The rest of this post will explain to you what each part of this folder does, an

To work on the package further, we develop it into the current environment and import it:

```>using-awesome
```julia-repl
julia> using Pkg
julia> Pkg.develop(path="MyAwesomePackage")
```

```!using-awesome1
#hideall
using Pkg
Pkg.develop(path=sitepath("MyAwesomePackage")) # ignore sitepath
```

```>using-awesome2
using MyAwesomePackage
```


## GitHub Actions

The most useful aspect of PkgTemplates.jl is that it automatically generates workflows for [GitHub Actions](https://docs.github.com/en/actions/quickstart).
Expand Down

0 comments on commit 427fefd

Please sign in to comment.