ZealDocsets.Hexdocs (zeal_docsets v0.1.7)

Copy Markdown View Source

Downloads and mirrors documentation from hexdocs.pm using a BFS crawler.

Uses Erlang's built-in :httpc HTTP client with no external dependencies. Crawls HTML pages following local href, src, and action attributes, and CSS files following url(...) references. Only assets within the same package/version path prefix are downloaded.

Summary

Functions

Checks whether version of package exists on hexdocs.pm.

Mirrors the documentation for package at version into downloads_root.

Functions

ensure_version!(package, version)

@spec ensure_version!(String.t(), String.t()) :: :ok

Checks whether version of package exists on hexdocs.pm.

Raises a RuntimeError with a descriptive message if the version is not found (HTTP 4xx) or if the network request fails.

mirror(package, version, downloads_root)

@spec mirror(String.t(), String.t(), Path.t()) :: Path.t()

Mirrors the documentation for package at version into downloads_root.

Downloads all HTML pages, stylesheets, and binary assets (images, fonts, scripts) from https://hexdocs.pm/{package}/{version}/ using a BFS crawl. Returns the local root path where the mirrored files were saved.

Raises if the package/version is not found on hexdocs.pm, or if a required resource (any HTML page or the root index) fails to download.