Hexdocs Offline

Package Version Hex Docs

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.

How?

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.

Demo

HEXDOCS.html for this project

Platform Support

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.

Required Software

Apart from Gleam you will need have to need Mix installed on your system.

Usage

Installation

gleam add hexdocs_offline --dev

Option 1: Default Config

Example Repository

gleam run -m hexdocs_offline

This will generate the hexdocs with the default configuration:

Option 2: Custom Config

Example Repository

//// 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

Notices

Development

gleam run   # Run the project
gleam test  # Run the tests

Acknowledgements

License

Apache License, Version 2.0

Search Document