defmodule Zig.Doc do @moduledoc """ Incorporates Zig documentation from selected files into Elixir projects. ## Usage 1. Include the zig files you wish to document in your project docs: ```elixir def project do [ docs: [ ... zig_doc: [name_of_module: [file: "path/to/file.zig"]] ] ] end ``` 2. (optional) alias `Zig.Doc` in your `mix.exs`: ```elixir def project do [ ... aliases: [ docs: ["zig_doc"] ] ... ] end ``` > ### Note {: .info } > > This step is required if you want HexDocs.pm to include the zig > documentation with your main documentation. ## Documentation forms Currently, Zigler recognizes the following forms of documentation: - **files** This form is set using the `//!` at the top of a document, and will be used as the "module-level" documentation for the ExDoc result. - **functions** Public functions: `pub const = ;` and publicly declared functions: `pub fn () { }` are both recognized and converted to ExDoc-style function documentation. - **types** `pub const = ;` is recognized and converted into ExDoc-style type documentation. functions which return `type` are also recognized and converted into type documentation. - **constants** `pub const = ;` is recognized and converted into ExDoc-style function documentation under the category `Constants`. - **variables** `pub var = ...;` is recognized and converted into ExDoc-style function documentation under the category `Variables`. ## Tags preamble documentation comments like so ```zig \\\\\\ \