From 84173abfedf54c303319cb5ab48e5592a8031aab Mon Sep 17 00:00:00 2001 From: adrhill Date: Tue, 3 Dec 2024 15:57:32 +0100 Subject: [PATCH 1/2] Split PkgTemplates code blocks --- sharing/index.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/sharing/index.md b/sharing/index.md index cb1cef0..4e810da 100644 --- a/sharing/index.md +++ b/sharing/index.md @@ -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") ``` @@ -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-awesome2 +#hideall using Pkg Pkg.develop(path=sitepath("MyAwesomePackage")) # ignore sitepath +``` + +```>using-awesome3 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). From e6f285910d29831dc54724a9c8dc24ced03a623d Mon Sep 17 00:00:00 2001 From: adrhill Date: Tue, 3 Dec 2024 16:02:46 +0100 Subject: [PATCH 2/2] Fix enumeration --- sharing/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharing/index.md b/sharing/index.md index 4e810da..2c0f7a9 100644 --- a/sharing/index.md +++ b/sharing/index.md @@ -58,13 +58,13 @@ julia> using Pkg julia> Pkg.develop(path="MyAwesomePackage") ``` -```!using-awesome2 +```!using-awesome1 #hideall using Pkg Pkg.develop(path=sitepath("MyAwesomePackage")) # ignore sitepath ``` -```>using-awesome3 +```>using-awesome2 using MyAwesomePackage ```