https://github.com/clemapfel/autodocs.jl
Automatically generate Documentation for your Julia Package. (for lazy developers only)
https://github.com/clemapfel/autodocs.jl
Last synced: 5 months ago
JSON representation
Automatically generate Documentation for your Julia Package. (for lazy developers only)
- Host: GitHub
- URL: https://github.com/clemapfel/autodocs.jl
- Owner: Clemapfel
- License: mit
- Created: 2022-09-22T20:31:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-22T21:17:49.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T19:51:16.971Z (about 1 year ago)
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# autodocs.jl
Provides the `@autodocs` macro, which, if invoked at the start of a module declaration, will generate basic documentation for all declared Julia objects (functions, structs, macros, etc.) in that module. If an object already has documentation, it will be expanded (but not overwritten).
This allows lazy developers to raise their documentation level to the bare minimum, while more motivated developers can skip writing all the boilerplate and stick to the actual description of objects and their functionality
# Features
+ output can be used with `Documenter.jl`
+ documentation style can be configured
+ hand-written documentation
# Usage
```julia
# undocumented_file.jl
@autodocs module UndocumentedModule
struct UndocumentedStruct
_private_field::Any
public_field
end
export UndocumentedStruct
function undocumented_function(x::T) where {T <: Number}
# ...
end
export undocumented_function
# do foo
function partially_documented_function(x; kwarg_01 = 1234)
# ...
end
#no export
const global_variable = # ...
export global_variable
end
```
Generates:
```julia
# documented_file.jl
"""
`UndocumentedModule` (module)
# Exports
## Structs
+ `UndocumentedStruct`
## Functions
+ `undocumented_function`
## Variables
+ `global_variable::Any`
"""
module UndocumentedModule
"""
`UndocumentedStruct` (immutable)
## Public Members
+ `public_field::Any`
## Constructors
+ `UndocumentedStruct(_private_field::Any, public_field::Any)`
"""
struct UndocumentedStruct
_private_field::Any
public_field
end
export undocumented_struct
"""
`undocumented_function(x <: Number) -> Any`
## Arguments
+ `x <: Number`
"""
function undocumented_function(x::T) where {T <: Number}
# ...
end
export undocumented_function
"""
`partially_documented_function(x::Any, [kwarg_01 = 1234]) -> Any`
## Brief
do foo
## Arguments
+ `x :: Any`
+ `kwarg_01 = 1234`` [optional]
"""
function partially_documented_function(x; kwarg_01 = 1234)
# ...
end
"""
`global_variable::Any` (const)
"""
end
```