API Documentation
Write and review XML API documentation for SkiaSharp.
File Locations
code
docs/SkiaSharpAPI/ ├── SkiaSharp/ # Main namespace │ ├── SKCanvas.xml # One XML file per type │ ├── SKPaint.xml │ ├── SKImage.xml │ └── ... ├── HarfBuzzSharp/ # HarfBuzz namespace ├── SkiaSharp.Views.*/ # Platform-specific views └── index.xml # Extension methods (auto-synced, don't edit)
Writing Documentation
- •Find the type's XML file in
docs/SkiaSharpAPI/<Namespace>/<TypeName>.xml - •Edit
<summary>,<param>,<returns>,<value>tags within<Docs>sections - •Follow patterns in references/patterns.md
- •After editing a file, validate XML syntax (see XML Validation below)
- •Run
dotnet cake --target=docs-format-docsto validate and format
Reviewing Documentation
- •Search for issues using grep patterns below
- •Classify by severity using references/checklist.md
- •Fix issues following references/patterns.md
- •Run
dotnet cake --target=docs-format-docsto validate
Quick Issue Search
bash
# Find placeholders grep -r "To be added" docs/SkiaSharpAPI/ # Find empty tags (self-closing) grep -rE "<(summary|value|returns)\s*/>" docs/SkiaSharpAPI/ # Find empty tags (open/close with optional whitespace) grep -rE "<(summary|value|returns)>\s*</" docs/SkiaSharpAPI/ # Find spelling errors (common ones) grep -riE "teh|recieve|seperate|occured|paramter" docs/SkiaSharpAPI/ # Find whitespace issues grep -rE " </| </" docs/SkiaSharpAPI/
Resources
- •references/patterns.md - XML syntax and examples
- •references/checklist.md - Review severity criteria
XML Validation
CRITICAL: After completing all edits to an XML file, validate its XML syntax before moving to the next file.
Validation Command
bash
# Validate a single file
xmllint --noout docs/SkiaSharpAPI/SkiaSharp/SKCanvas.xml
# Validate all XML files in a namespace
find docs/SkiaSharpAPI/SkiaSharp -name "*.xml" -exec xmllint --noout {} \;
# Validate entire docs directory
find docs/SkiaSharpAPI -name "*.xml" -exec xmllint --noout {} \;
Common XML Errors to Avoid
- •Duplicate closing tags:
</param></param>- happens when copy/pasting - •Mismatched tags:
<summary>...</param>- tag names must match - •Unescaped characters:
<,>,&must be<,>,& - •Missing closing tags:
<summary>textwithout</summary>
Workflow
- •Make all edits to a file
- •Run
xmllint --noout <file>to validate - •If errors, fix them before proceeding
- •Move to next file