-
Notifications
You must be signed in to change notification settings - Fork 99
How to create a new Julia package
PkgTemplates is a Julia package for creating new Julia packages in an easy, repeatable, and customizable way.
We provide here a short outline of the usage of this package, originally
referring to v.0.7.6
, but still working for v.0.7.31
.
NOTE: PkgTemplates
usage has significantly varied compared to versions older than v.0.7
. You can
review the main changes at Migrating To PkgTemplates 0.7+.
Read carefully the User guide, especially the sections Template and Plugins.
julia> import Pkg; Pkg.add("PkgTemplates")
julia> using PkgTemplates
julia> t = Template(;
user="gridap",
authors=["Your name <your-email>"],
dir=pwd(),
julia=v"1.7",
plugins=[
License(; name="MIT", path=nothing, destination="LICENSE.md"),
CompatHelper(),
Codecov(),
GitHubActions(;
osx=false,
windows=false,
),
Documenter{GitHubActions}(),
Git(;
ignore=["*.jl.*.cov",
"*.jl.cov",
"*.jl.mem",
"*.code-workspace",
".DS_Store",
"docs/build/",
"Manifest.toml",
"tmp/"],
ssh=true
),
],
)
julia> t("myPkg")
- The above configuration will create a package named
myPkg
on thepwd()
folder with a standard MIT license (the same one as gridap). - The user field of the template must be set to the organisation name. For
instance, for Gridap packages to be published in the Gridap organisation we
must set
user="gridap"
. It becomes clear why in point 3. - The above configuration also initialises a
git
repository at themyPkg
folder. If you change directory tomyPkg
and rungit remote -v
, you should see thatorigin
's remote URL is set to[email protected]:gridap/myPkg.jl.git
(ready to be published).
Documenter is a julia package for building documentation of julia projects.
Official Documenter web page contains enough and clear information on how to create and develop documentation for julia projects.
In this section we only enumerate the required steps to create from scratch a [Documenter] project in order to enable automatic documentation deployment for GitHub hosted projects using GitHub Actions.