Troubleshoot Common Errors
Error: ## docstrings not included in the manual
Problem: Docstrings have been written, but have not been properly mapped to either a public or internal API. There may be multiple issues to iterate through:
Verify there is an Internal API .md file to catch doctrings for structs/functions that are not exported. Example here
Identify the
*.jl
file for one of your missing docstrings. Are other docstrings in that file visible in the compiled API .html?YES: Check whether those other docstrings are listed in the Public API .md file in a
@docs
block. Either:- Add the missing struct/function names to an appropriate
@docs
block in the API .md if it is manually organized. See below if this creates ano docs found
error. - Preferrably, switch to
@autodocs
with the*.jl
file as one of itsPages
instead.
- Add the missing struct/function names to an appropriate
No: add a new
@autodocs
block in the Public API .md file with that*.jl
file as one of itsPages
.
Are these docstrings from
InfrastructureSystems.jl
? Follow how-to selectively export docstrings fromInfrastructureSystems.jl
.
Error: no docs found for SomeFunction
or [:docs_block]
error
No docstring has been written for SomeFunction
. Find the *.jl
file containing SomeFunction
and add a docstring.
Error: duplicate docs found
Example:
Error: duplicate docs found for 'PowerSimulations.SimulationProblemResults' in src\reference\PowerSimulations.md
Problem: The same .jl
file has been found more than once by Documenter.jl
, which matches based on the end of a file path.
Determine which file the function is located in
Example:
simulation_problem_results.jl
forPowerSimulations.SimulationProblemResults
Check whether that file is listed more than once in an
@autodocs
Pages
list in the API markdown file (e.g.,PowerSimulations.md
orpublic.md
). Remove duplicates.Also check for other files with the same partial ending in the
@autodocs
Pages
lists in the API .md file. Specify more of that file path to distinguish it.Example: Change
Pages = ["problem_results.jl"]
toPages = ["operation/problem_results.jl"]
Parsing error for input
from JuliaFormatter
Problem: JuliaFormatter
1.0 gives an uninformative error message when it can't parse something, with unhelpful line numbers. Common causes are something that is not proper Julia syntax inside a julia
markdown block:
```julia
Whoops,
```
Or a single bracket in a markdown file:
] add PowerSystems
Workarounds:
- Avoid the single bracket with alternatives:
using Pkg;
Pkg.add(["PowerSystems"]);
- If you can't avoid it:
- Remove the text with single bracket (or other problem) temporarily
- Run the formatter once to format the rest of the file
- Add the text back in
- Add the
ignore
keyword argument with the file name toJuliaFormatter.format
inscripts/formatter/formatter_code.jl
to skip the file in the future:
ignore = ["problem-file.md"]
You might need to iterate through multiple files.