https://github.com/chifisource/documator.jl
Automate documentation.
https://github.com/chifisource/documator.jl
Last synced: over 1 year ago
JSON representation
Automate documentation.
- Host: GitHub
- URL: https://github.com/chifisource/documator.jl
- Owner: ChifiSource
- License: mit
- Created: 2022-04-20T15:26:07.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T04:32:36.000Z (over 1 year ago)
- Last Synced: 2025-02-25T18:52:25.943Z (over 1 year ago)
- Language: Julia
- Size: 145 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://juliahub.com/ui/Packages/Lathe/6rMNJ)
[](https://juliahub.com/ui/Packages/Lathe/6rMNJ?t=2)
[](https://juliahub.com/ui/Packages/Lathe/6rMNJ)
Documator.jl
Documator is an automatic, active-webserver documentation deployment solution for julia. This application builds automatic documentation referencing, searching, and special component interpolation -- all built on the back of the `Toolips` web-development framework.
### adding
Step one is adding the package. This package will be a dependency of a project which contains all of your documentation, so we start by creating a new environment. Let's say that we wanted to document [`Toolips`](https://github.com/ChifiSource/Toolips.jl) and `ToolipsServables` in from the `toolips` ecosystem. We would add documator, plus both of those packages.
```julia
julia> ]
pkg> generate TLDocServer
pkg> activate TLDocServer
pkg> add Toolips
pkg> add ToolipsServables
pkg> add Documator
```
### setup
After we have an environment with the modules we want to build for loaded, we will first want to call `Documator.generate(groups::Pair{String, Vector{Module}} ...)`. This allows us to group our modules according to ecosystem. This will a `config.toml` alongside a bunch of directories for our project. From here on, we are able to call `generate(...` in this same directory to add additional documentation. After this, we simply need to provide our `Module` to `read_doc_config` before calling `start!` on documator.
```julia
function start_project(ip::IP4 = "192.168.1.10":8000, path::String = pwd())
docloader = Documator.docloader
docloader.dir = path
docloader.docsystems = Documator.read_doc_config(path, TLDocServer)
Documator.load_docs!(TLDocServer, docloader)
start!(Documator, ip)
end
```
From here, we can add `md` to the folders in `modules/` to add more documentation, while a reference and doc interpolation are generated for us.
- A great example of a precreated and deployed, working version of this would be [ChifiDocs](https://github.com/ChifiSource/ChifiDocs.jl)
- A special `components` vector may also be exported from your module to load those components into interpolation for your markdown files.
```julia
module MyDocumatorServer
using Documator
using Documator.Toolips.Components
using ModToDoc
function start_project(ip::IP4 = "192.168.1.10":8000, path::String = pwd())
docloader = Documator.docloader
docloader.dir = path
docloader.docsystems = Documator.read_doc_config(path, MyDocumatorServer)
Documator.load_docs!(MyDocumatorServer, docloader)
start!(Documator, ip)
end
components = []
push!(components, a("sample", text = "this was interpolated"))
export components
end
```