I’m generating docs as a deliverable for a client, and I want them to be hosted somewhere so that I can automate the process. I just need them to be behind a password/login. Has anyone here ever done that with Elixir docs?
ex_doc generates html pages for you. It should be easy enough to set them up behind some kind of login. If you are using some sort of CI/CD, you should be able to automatically build the documentation and upload it to wherever you need to on a successful build release.
I guess I could s3 or something.
I can always host you some space if you want as well.
Appreciated, but I’ll just bill the client for S3 or whatever. I feel like there’s an interesting opportunity to build a simple service that’s like hex docs for private repos.
Offers open for about anyone, I have a lot of unused server right now. ^.^;
I’m not sure it is really hard though, plenty of free services for file doc hosting, hex/ex_docs builds static HTML so it is pretty dead-simple.
On a slight tangent, do you know if it’s possible to capture the tests in ex_doc’s output?
You mean the DocTests? And capture in what way? The code itself, the output of the test, etc…?
No, I mean like generating a doc entry for specific test files. It seems silly, but I have to document test cases for a project, and I don’t want to have to use another tool or maintain a list of tests somewhere by hand.
So, I’m pretty sure that ExDoc is based off of compiled beam
files. So…
You will probably want a different environment for just compiling docs.
You will need to add paths to be compile to your mix.exs
via the :elixirc_paths
option or figure out how to get whatever you want into the parsed beam
.
There may be another way, but that’s how I would approach it with my current understanding.
Can you compile .exs
files to beam
? The test files won’t compile as .ex
files if you’re using things like Phoenix’s ConnCase
.
It turns out that using File.read!("test path goes here") Code.string_to_quoted!
produces the AST and is perfectly usable for getting the moduledoc and test names. I’m putting together a package, and will share ti once I have it working.