rhcarvalho

rhcarvalho

I recently came across HexSearch and yesterday found yet another interesting thread on improving the experience of HexDocs (Introduce search across all of HexDocs · Issue #1811 · elixir-lang/ex_doc · GitHub). The latter is apparently aiming at changes at the ExDoc level, requiring documentation for a package to be regenerated to benefit from improvements.

Elixir documentation is generally top notch, specially for the most used libraries, however one of the things that I noticed with time is that the ExDoc/HexDocs experience can be quite inconsistent depending on the version of ExDoc used to build docs for a package.

That means clicking links that take you to another package may change the UI drastically, both aesthetically and functionally. Navigating to older versions of documentation for a given page has a similar effect.

There are advantages to having the documentation built once and never changing for a given release, but there are advantages to having a single “ExDoc server” that can render documentation for arbitrary versions of arbitrary packages, too.

Has this server model been explored in public earlier? I haven’t found any references yet.

I am not really familiar with how ExDoc works and how easy/compatible would it be for a recent version of ExDoc to render docs for arbitrarily old packages – but does that sound plausible and worth investigating further?

In broad lines, I’m thinking a server that would be able to take a Hex package (or perhaps even a Git repo), generate documentation, cache it and serve that. Any updates to the server functionality and design would apply to all pages consistently.

Showing Posts 1 to 3

christhekeele

christhekeele

ExDoc works primarily by extracting documentation chunks from compiled BEAM code. That means that you should be able to take any BEAM project that compiles, and the same version of :ex_doc, and generate more modern documentation from it.

The additional complexity I foresee is that mix projects can and do customize their generated documentation extensively via configuration in their mix.exs or their rebar3.config files, so you will need to make sure your approach honors them.

This could be as simple as a script that checks out each project, adds your desired version of :ex_doc/unlocks :ex_doc and related dependencies and resets them to your desired version, and tries to do normal docgen!

I think so!

rhcarvalho

rhcarvalho OP

Interesting! Thanks for the insight and information :heart_decoration:

Can ExDoc run from “outside” of a project, that is, without messing with the package dependencies?

If I had just the compiled BEAM code and an isolated environment, say my own temporary Mix project with only ex_doc and related dependencies, could that be used to generate documentation?

christhekeele

christhekeele

Not without messing with dependencies, exactly—the compiled BEAM code by necessity includes the compiled dependencies, if you have access to a completely compiled BEAM project by definition you’ve got the deps in there.

As far as ex_doc supporting being pointed to a folder with precompiled BEAM deps, I don’t know if it has an API for that. I would be surprised, as it’s optimized for the library owner’s developer experience, but you may be able to muck around with internals!

Even if it does support that, I would suggest the full-build solution anyhow; remember that ex_doc does not JUST look at the compiled code, but also the project’s mix/rebar configuration for extra pages, module groups, etc; to build the resulting site. Mix/Rebar build metadata like that don’t end up in the compiled release, so you don’t have enough artifacts to re-generate a full ex_doc site for a library just from precompiled files alone.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 92995 915
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
caslu
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
matt-savvy
Is there a word for the ~> symbol used in Version strings? Do you also just call it a Squiggle Arrow™ ?!
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews