Download an offline version of the hexdocs of your projects dependencies to a local folder.
Useful for if you are travelling a lot and do not have a great or any internet connection at all times. Or if you just want to have a centralized index page for all of the hexdocs of your dependencies and close 10 of those tabs.
All this package does is fetch the dependencies from the gleam.toml file and uses
mix hex.docs fetch ... to download a local version of them.
HEXDOCS.html for this project
This package works fine on macos and linux. It has not been tested on Windows
and will probably fail due to the ~/.hex directory default.
Apart from Gleam you need to have Mix installed on your system.
gleam add hexdocs_offline --devgleam run -m hexdocs_offlineThis will generate the hexdocs with the default configuration:
- gleam_path:
./gleam.toml - manifest_path:
./manifest.toml - output_path:
./HEXDOCS.html - new_tab:
True(opens links as a new tab) - include_dev:
True(includes dev dependencies) - ignore_deps:
[](take all dependencies into consideration)
//// file `src/dev/generate_hexdocs.gleam`
import hexdocs_offline.{generate}
import hexdocs_offline/config.{
default_config, with_ignore_deps, with_include_dev, with_output_path,
}
pub fn main() {
let config =
default_config()
|> with_output_path("./HEXDOCS.html")
|> with_include_dev(False)
|> with_ignore_deps(["..."])
generate(config)
}gleam run -m dev/generate_hexdocs- you might want to add the resulting
HEXDOCS.htmlfile to your.gitignore
gleam run # Run the project
gleam test # Run the tests- Thank you
simplecss(GitHub) (https://github.com/kevquirk) - Thank you Mix Docs for saving me a lot of pain of recreating this myself
- Thank you to
go_over(Hex, GitHub) for inspiring the code that reads out thegleam.tomlfile (https://github.com/bwireman) - Thank you to
squirrel(Hex, GitHub) for a lot of the code and repository structure inspiration (https://github.com/giacomocavalieri)