Executable licenses for executable documents!
Choose one of the lines below!
import Pkg; Pkg.add("CommonLicenses")
# In a Julia REPL
]add CommonLicenses
Why does this exist?
Imagine you're writing a blog post. Or a Pluto notebook. Or a Jupyter notebook. Or whatever! You're writing words alongside content, and you'd like to license your work. The license needs to stand alone with your document; the "naive" solution is to find the contents of your standard license file, and paste the license into a block of text somewhere in your document. Cool. Two weeks later you're writing another blog post, or whatever. You need to re-find the contents of this license. Not a big deal, but this gets a bit cumbersome, right?
Enter: CommonLicenses.jl
. This package provides every standard license tracked
by the SPDX License List, so all you need to do is
install this package, and print your desired license wherever you want it!
Try it out for yourself!
julia> using CommonLicenses
julia> using CommonLicenses: MIT, Unlicense
julia> MIT()
julia> Unlicense()
julia> CommonLicenses.text(MIT(copyright="Joe(y)"))
julia> CommonLicenses.name(License("CC-BY-4.0"))
Built on top of lots of helpful projects!
This package was developed independently of
PkgLicenses.jl
,
though it does look like JuliaPackaging
got there first! This package adds
goodies on top of the functionality of PkgLicenses.jl
, including MIME
type
support, and licenses for non-software projects such as Creative Commons.
The SPDX License List is used to fetch the contents for each requested license. The GitHub License API is used to find additional metadata for each license, if available.