Created
April 24, 2020 16:13
-
-
Save elbow-jason/f1dde203443a62485896d3e52b605fb8 to your computer and use it in GitHub Desktop.
SNIPPET: readme as moduledoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Thing do | |
# get the full qualified path to the README. | |
@readme_path Path.join(__DIR__, "../README.md") | |
# ensure the module recompiles if the README changes | |
# NOTE: @external_resource requires a fully qualified path. | |
@external_resource @readme_path | |
# read the README into the moduledoc | |
@moduledoc File.read!(@readme_path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment