Fun One Liners

Here is a useful (maybe not so fun) oneliner that I use everywhere. Just put the following line after module MyPackage so that ?MyPackage shows README

@doc read(joinpath(dirname(@__DIR__), "README.md"), String) MyPackage

(It’s based on code I saw somewhere. Maybe it was @mbauman?)

There is also a multi-line version if you want to run doctest on README:

@doc let path = joinpath(dirname(@__DIR__), "README.md")
    include_dependency(path)
    replace(read(path, String), "```julia" => "```jldoctest")
end MyPackage