Skip to content

cadojo/CommonLicenses.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests Docs

CommonLicenses.jl

Executable licenses for executable documents!

Installation

Choose one of the lines below!

import Pkg; Pkg.add("CommonLicenses")
# In a Julia REPL
]add CommonLicenses

Motivation

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!

Usage

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"))

Credits

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.