Skip to content

Split PkgTemplates code blocks #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading