首页/ AI 技能 / @skilllib/skill-2117939930272417244
Skill站外收录 @skilllib/skill-2117939930272417244

hex-docs-search

专注于 Elixir 生态中 Hex 包的深度技术调研,支持在本地依赖、缓存文档与源码、HexDocs API 及网页间逐层检索,自动补全缺失资料,精准定位模块函数说明、真实用例及源码位置。

0.0 (0) 20 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# Hex Documentation Search Search Elixir package documentation. Prioritize local sources, fetch if needed. ## Search Locations (in order) 1. **Project deps**: `deps/<package>/lib/` (source with @moduledoc/@doc), `deps/<package>/doc/` (HTML if generated) 2. **Fetched docs cache**: `.hex-docs/docs/hexpm/<package>/<version>/` 3. **Fetched source cache**: `.hex-packages/<package>-<version>/` 4. **HexDocs API**: Programmatic search (see below) 5. **Web search**: Last resort with `site:hexdocs.pm` ## Fetching Locally Determine version from `mix.lock`, `mix.exs`, or prompt user if ambiguous. ```bash # Fetch documentation (stores in .hex-docs/) HEX_HOME=.hex-docs mix hex.docs fetch <package> <version> # Fetch source code (if docs insufficient or unavailable) mix hex.package fetch <package> <version> --unpack --output .hex-packages/<package>-<version> ``` Mention adding `.hex-docs/` and `.hex-packages/` to `.gitignore` once per session when fetching occurs. ## HexDocs Search API Powered by Typesense at `search.hexdocs.pm`. ```bash # Search within a specific package curl -s "https://search.hexdocs.pm/?q=<query>&filter_by=package:=[<package>-<version>]" \ | jq '.hits[].document | {title, doc, url}' # Search across all packages curl -s "https://search.hexdocs.pm/?q=<query>" \ | jq '.hits[].document | {package, title, doc}' ``` Response fields: - `package`: Package name - `title`: Module/function name - `doc`: Documentation text - `url`: Path to append to `https://hexdocs.pm` ## Version Resolution ```bash # From mix.lock grep '"<package>"' mix.lock | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' # Latest from hex.pm curl -s "https://hex.pm/api/packages/<package>" | jq -r '.releases[0].version' ``` ## Key Behaviors - Prefer local/cached results (version matches project) - Show real usage examples from project codebase when relevant - Include file:line references for source code - Prompt user before fetching external packages - Source code @moduledoc/@doc often has more detail than HTML docs

评论 0

还没有评论,来抢沙发。