Skip to content
Grant Bruer edited this page Sep 11, 2024 · 6 revisions

Usage

Press the "Use this template" button on the main page of this repo. That will let you create a new repo with the same files as this one.

First, you'll probably want to replace the LICENSE file.

Important customizations

Once you've created a new repo, you'll need to modify it so it is a separate Julia package from this one. For this, I use sed.

Set package name.

Replace PKGNAME with the name you chose. I'll use CoolJuliaPackage as an example.

find . -type f -not -path "./.git/*" -exec sed -i -e 's/PKGNAME/CoolJuliaPackage/g' '{}' \;
git mv src/PKGNAME.jl src/CoolJuliaPackage.jl

Set package UUID.

Choose a package UUID.

e=`julia -e "import UUIDs; println(UUIDs.uuid4())"`

Replace PKGNAME.jl's UUID with the one you choose.

find . -type f -not -path "./.git/*" -exec sed -i -e "s/00000000-0000-0000-0000-123456789010/$e/g" '{}' \;

Set author name and address.

The default author name is the typical name "Grant Bruer", but you may want to change that to something like "Different Person".

find . -type f -not -path "./.git/*" -exec sed -i -e 's/Grant Bruer/Different Person/g' '{}' \;

Similarly, the default author email address may need to be changed as well.

find . -type f -not -path "./.git/*" -exec sed -i -e 's/[email protected]/[email protected]/g' '{}' \;

Set repository owner.

You may want to change the username for the repository owner, which affects the GitHub links. The default is a classic "gbruer15".

find . -type f -not -path "./.git/*" -exec sed -i -e 's/gbruer15/differentperson232/g' '{}' \;

But wait! The new author's email may be "gbruer15" while the owner is a different username. In that case, do this series of replacements to replace the owner without replacing the email.

find . -type f -not -path "./.git/*" -exec sed -i -e 's/github.com\/gbruer15/github.com\/differentperson232/g' '{}' \;
find . -type f -not -path "./.git/*" -exec sed -i -e 's/gbruer15.github.io/differentperson232.github.io/g' '{}' \;

Set repository name.

The repository might not be named the same as the Julia package. Let's say you followed the commands above to set the Julia package name to "CoolJuliaPackage". Let's say the repository is called "repositoryname".

find . -type f -not -path "./.git/*" -exec sed -i -e 's/\/CoolJuliaPackage.jl/\/repositoryname/g' '{}' \;
find . -type f -not -path "./.git/*" -exec sed -i -e 's/src\/repositoryname/src\/CoolJuliaPackage.jl/g' '{}' \;

Remove extensions

If you don't want extensions in your package, you should delete the ext folder and remove all references to extensions in the package.

These files require modification to remove extensions:

  • src/CoolPackageName.jl
  • README.md
  • makefile
  • docs/make.jl
  • docs/src/index.md
  • test/runtests.jl

Less important customizations

These customizations should come naturally while developing your package, so I deem them less important than the ones above which will keep the nice features of this repo working.

  1. Update the paragraph near the top of the README with a description of what your package does.
  2. Update the files in the src folder with a Julia package of your own.
  3. Update Project.toml with your own package's dependencies' information.
  4. Update the files in the test folder to test your Julia package.
  5. Update examples in the examples folder with your own examples.