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
*.jlfile 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
@docsblock. Either:- Add the missing struct/function names to an appropriate
@docsblock in the API .md if it is manually organized. See below if this creates ano docs founderror. - Preferrably, switch to
@autodocswith the*.jlfile as one of itsPagesinstead.
- Add the missing struct/function names to an appropriate
No: add a new
@autodocsblock in the Public API .md file with that*.jlfile 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.jlforPowerSimulations.SimulationProblemResultsCheck whether that file is listed more than once in an
@autodocsPageslist in the API markdown file (e.g.,PowerSimulations.mdorpublic.md). Remove duplicates.Also check for other files with the same partial ending in the
@autodocsPageslists 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 PowerSystemsWorkarounds:
- 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
ignorekeyword argument with the file name toJuliaFormatter.formatinscripts/formatter/formatter_code.jlto skip the file in the future:
ignore = ["problem-file.md"]You might need to iterate through multiple files.
How can I see the output even with errors?
Sometimes the easiest way to diagnose an error is to look at the generated webpage locally.
By setting warnonly=true in makedocs at make.jl, you can temporarily disable errors and build regardless. This makes it easy to track down cross-reference errors by clicking a link and seeing what fails.
We do not allow warnonly=true to be used in production, so if used, this must be removed before a pull request is submitted.