{"id":24434122,"url":"https://github.com/tfwright/docout","last_synced_at":"2026-02-09T13:16:55.541Z","repository":{"id":45059079,"uuid":"443635355","full_name":"tfwright/docout","owner":"tfwright","description":"Generate documentation files from your existing Elixir app docs at compile time.","archived":false,"fork":false,"pushed_at":"2022-05-14T17:07:21.000Z","size":29,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-02T00:22:39.011Z","etag":null,"topics":["api","documentation-generator"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tfwright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-01T22:26:27.000Z","updated_at":"2024-04-17T05:57:06.000Z","dependencies_parsed_at":"2022-09-05T03:01:19.365Z","dependency_job_id":null,"html_url":"https://github.com/tfwright/docout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfwright%2Fdocout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfwright%2Fdocout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfwright%2Fdocout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfwright%2Fdocout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfwright","download_url":"https://codeload.github.com/tfwright/docout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234823645,"owners_count":18892367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","documentation-generator"],"created_at":"2025-01-20T16:54:21.669Z","updated_at":"2025-10-01T04:31:32.860Z","avatar_url":"https://github.com/tfwright.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docout\n\nDocout is a multi-purpose documentation tool. Parse function docs and meta and implement one or more formatters to use the data to generate files like API specifications, onboarding guides, etc. Files will be automatically updated every time the app compiles, so you just need to save changes once.\n\nThe following were the main goals and inspiration for this library:\n\n* Run during compilation phase (like [PhoenixSwagger](https://github.com/xerions/phoenix_swagger))\n* Use native Elixir doc API (like [OpenApiSpex Controller syntax](https://github.com/open-api-spex/open_api_spex/blob/master/lib/open_api_spex/controller.ex))\n* Support multiple output formats (like [Bureaucrat](https://github.com/api-hogs/bureaucrat))\n\nFor more information about the rationale behind the project, or to contact me about the project, see https://elixirforum.com/t/docout-flexible-documentation-generator/45227\n\n*Note: Docout itself has been configured to use the [Docout.Demo.Formatter](demo/formatter.ex) formatter to generate [docs/demo.md](docs/demo.md).*\n\n## Installation\n\n1. Add `{:docout, github: \"tfwright/docout\", branch: \"main\", runtime: false}` to your app's `deps`\n\n## Basic usage\n\n1. Add a module that uses Docout and implements the `format/1` function:\n\n  ```\n  defmodule MyDocFormatter do\n    use Docout\n\n    def format(_doc_list) do\n      \"\"\"\n      My docs!\n      \"\"\"\n    end\n  ```\n\n2. Add the following to your app's **compile time** config (`config.exs`):\n\n  ```\n  config :docout,\n    app_name: :your_app,\n    formatters: [MyDocFormatter]\n  ```\n\n3. Add `docout: true` to any [module's metadata](https://hexdocs.pm/elixir/writing-documentation.html#documentation-metadata) to include its function docs in the list passed to the format function.\n\nThat's it! Now when your app compiles, `Docout` will write a file with the output of your formatter to `/docs/[underscored module name]`.\n\n4. Generate docs!\n\n```\nmix compile.docout\n```\n\n## Advanced usage\n\n\u003cdetails\u003e\n\u003csummary\u003eConfigure where the doc file is written\u003c/summary\u003e\n\n  ```\n  defmodule MyDocFormatter do\n    use Docout, output_path: \"other_dir/mydocs.html\"\n  end\n  ```\n\n  `output_path` should be a path relative to your app's root\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSelect which formatters should process a module\u003c/summary\u003e\n\n  ```\n  defmodule MyModule do\n    @moduledoc docout: [XFormatter, YFormatter]\n  end\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCustomize parsing\u003c/summary\u003e\n\n  In order to simplify formatting logic, you might want to change how Docout preprocesses the docs for a module. Set the value of the `parse_function` option to any 2 arity function reference to be invoked instead of `Docout.parse/2`\n\n  ```\n  defmodule MyDocFormatter do\n    # this formatter doesn't care about the module being documented\n    use Docout, parse_function: fn mod, docs -\u003e docs end\n  end\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAutomatically compile during development\u003c/summary\u003e\n\n  ```\n  # mix.exs\n  def project do\n    # ...\n    compilers: Mix.compilers() ++ compilers(Mix.env())\n    # ...\n  end\n\n  # ...\n\n  defp compilers(:dev), do: [:docout]\n  defp compilers(_), do: []\n  ```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfwright%2Fdocout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfwright%2Fdocout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfwright%2Fdocout/lists"}