Pelican "Could not process" reStructuredText in CI
Pelican renders reStructuredText with docutils. A malformed directive, an unknown role, or a severe markup error makes docutils fail, and Pelican logs "Could not process" for that file and aborts on errors.
What this error means
pelican prints "Could not process content/X.rst" with a docutils message such as "Unknown directive type" or "Severe error", and the build fails (especially with warnings treated as errors).
ERROR: Could not process content/post.rst
Unknown directive type "code-block".
CRITICAL: Could not process content/post.rstCommon causes
An unknown directive or role
The article uses a directive (code-block) that needs Pygments or an extension that is not available, so docutils does not recognize it.
Malformed rST markup
Bad indentation under a directive or an unterminated block makes docutils raise a severe error.
How to fix it
Provide the directive's dependency
Install Pygments so code-block and highlighting directives resolve, then rebuild.
pip install Pygments
pelican content -s pelicanconf.pyFix the rST markup the error names
- Open the file at the reported error.
- Correct the directive name and the indentation under it.
- Re-run pelican to confirm the file processes.
How to prevent it
- Install Pygments for code directives.
- Validate rST locally before committing.
- Keep directive indentation consistent.