Complete production-quality documentation for the IIIF Presentation API 2.0 manifest serialization library.
All 27 README files have been created following the comprehensive template with:
- ✅ Anchor-linked table of contents
- ✅ 2-5 sentence overview with IIIF context
- ✅ Files table (file | types | LOC | responsibility)
- ✅ Types & Members table
- ✅ Per-type details
- ✅ Mermaid diagrams (class hierarchies, sequence flows)
- ✅ Realistic IIIF examples with JSON output
- ✅ Cross-linked See Also sections
- Helpers – Utility methods for collections, JSON parsing, date handling, manifest metadata
- Shared – Foundation types: TrackableObject, BaseItem, BaseNode, BaseContent hierarchies
- Nodes – IIIF domain model: Manifest, Sequence, Canvas, Structure, annotations
- Properties – IIIF metadata properties: Label, Description, Metadata, Service, etc.
- Shared/Trackable – TrackableObject pattern with ModifiedProperties tracking
- Shared/BaseItem – @context/@id/@type/service foundation
- Shared/BaseNode – 15+ metadata fields (label, description, thumbnail, etc.)
- Shared/Content – BaseContent hierarchy for annotations
- Shared/Content/Resources – BaseResource foundation for content resources
- Shared/Exceptions – Custom JSON validation exceptions
- Shared/FormatableItem – Items with format field
- Shared/ValuableItem – Simple string property wrappers
- Nodes/Manifest – Top-level IIIF resource with sequences, structures
- Nodes/Sequence – Ordered canvas collection with viewing direction
- Nodes/Canvas – Painting surface with dimensions, images
- Nodes/Structure – Hierarchical navigation (ranges)
- Nodes/Content – Annotation types overview
- Nodes/Content/Image – Painting annotations linking ImageResource
- Nodes/Content/Image/Resource – Image resources with IIIF Image Service
- Nodes/Content/Embedded – Embedded text annotations
- Nodes/Content/Embedded/Resource – Text resources with chars/language
- Nodes/Content/Segment – Region annotations with selectors
- Nodes/Content/Segment/Resource – Segment resources
- Nodes/Content/Segment/Selector – xywh region selectors
- Nodes/Content/OtherContent – External annotation list links
- Properties/Description – Multi-language descriptions
- Properties/Metadata – Label-value metadata pairs
- Properties/Metadata/MetadataValue – Individual metadata values
- Properties/Rendering – Alternative format links (PDF, EPUB)
- Properties/Service – IIIF Image API service descriptors
- Properties/Tile – Deep-zoom tile specifications
- Properties/Within – Parent collection links
- Properties/Interfaces – IDimenssionSupport, IViewingDirectionSupport
All domain types inherit from TrackableObject<T> which provides:
- SetPropertyValue: Reflection-based immutable property mutation
- ModifiedProperties: Dictionary tracking changed fields
- INotifyPropertyChanged/INotifyPropertyChanging: Change notification events
manifest.AddLabel(new Label("Title"))
.SetThumbnail(thumbnail)
.AddSequence(sequence); // Fluent chainingCustom converters enforce IIIF validation:
- TrackableObjectJsonConverter → clears ModifiedProperties, forces indented formatting
- BaseItemJsonConverter → validates @context/@id/@type required fields
- BaseNodeJsonConverter → parses 15+ metadata fields
- Domain converters → enforce resource/on/dimension requirements
Manifest (top-level)
└─ Sequence (ordered views)
└─ Canvas (painting surface with dimensions)
├─ Image (painting annotation)
│ └─ ImageResource (with Service for deep-zoom)
├─ EmbeddedContent (text annotations)
├─ Segment (region annotations with Selector)
└─ OtherContent (external annotation lists)
- IIIF Presentation API 2.0 Compliance: Full spec implementation with validation
- Immutable Properties: All mutations through fluent SetPropertyValue pattern
- Change Tracking: ModifiedProperties dictionary for dirty field detection
- Single-or-Array Serialization: Converters emit arrays only when count > 1
- Multi-Language Support: Description, MetadataValue with @value/@language
- IIIF Image Service: Deep-zoom via Service/Tile with scaleFactors
- Flexible Annotations: Image painting, embedded text, segment regions
- Hierarchical Navigation: Structure/Range with canvas/range collections
using IIIF.Manifest.Serializer.Net;
// Create manifest
var manifest = new Manifest(
"https://example.org/manifest",
new Label("16th Century Manuscript")
).SetViewingDirection(ViewingDirection.RightToLeft);
// Add sequence with canvas
var sequence = new Sequence("https://example.org/seq1");
var canvas = new Canvas(
"https://example.org/canvas/1",
new Label("Folio 1r"),
2000, // height
1500 // width
);
// Add image with IIIF Image Service
var imageResource = new ImageResource(
"https://example.org/image.jpg",
"image/jpeg"
).SetHeight(2000).SetWidth(1500);
var service = new Service(
"http://iiif.io/api/image/2/context.json",
"https://example.org/iiif/img1",
"http://iiif.io/api/image/2/level1.json"
).AddTile(new Tile(512, new[] { 1, 2, 4, 8 }));
imageResource.SetService(service);
var image = new Image(
"https://example.org/anno/1",
imageResource,
canvas.Id
);
canvas.AddImage(image);
sequence.AddCanvas(canvas);
manifest.AddSequence(sequence);
// Serialize to JSON
string json = JsonConvert.SerializeObject(manifest);Each README includes:
- Anchor TOC – Quick navigation to all sections
- Overview – 2-5 sentences explaining purpose and IIIF context
- Files Table – File paths, primary types, LOC, responsibilities
- Types & Members Table – Type, kind, summary, inheritance, key members
- Per-Type Details – Focused explanations of each type's role
- Mermaid Diagrams – Class hierarchies and sequence flows
- Examples – Realistic C# code with JSON output
- See Also – Cross-links to parent/sibling/related documentation
- netstandard2.0 – Broad compatibility
- net451 – Legacy .NET Framework support
- Newtonsoft.Json – JSON serialization with custom converters
# Build library
dotnet build IIIF.Manifest.Serializer.Net.sln
# Run sample/benchmark
dotnet run --project src/IIIF.Manifest.Serializer.Net.TestWhen extending the library:
- Inherit from appropriate base – TrackableObject → BaseItem → BaseNode → domain type
- Use SetPropertyValue – All mutations through helper to track ModifiedProperties
- Create custom JsonConverter – Validate required tokens, parse/write fields
- Follow fluent pattern – Return
thisfrom all setters for chaining - Update documentation – Maintain README consistency across all folders
See LICENSE file in repository root.
Documentation Generated: Complete production-quality documentation set for IIIF.Manifest.Serializer.Net
Total README Files: 27
Coverage: All folders with comprehensive sections, diagrams, examples, cross-links