Skip to main content

Templates

Templates tell Shelv how to structure a specific type of document. They provide domain-specific conventions for naming, nesting, and organizing content.

Available Templates

TemplateDescriptionUse for
bookStructures content by parts, chapters, and sectionsBooks, manuals, long-form texts
legal-contractOrganizes by articles, clauses, schedules, and annexesContracts, agreements, regulatory filings
academic-paperSplits by abstract, sections, methodology, referencesResearch papers, journal articles, theses

Using a Template

Pass the template parameter when creating a shelf:
curl -X POST https://api.shelv.dev/api/shelves \
  -H "Authorization: Bearer sk_your_api_key" \
  -F "file=@paper.pdf" \
  -F "template=academic-paper"

Auto-Detection

If you don’t specify a template, Shelv analyzes the document and applies the most appropriate structuring strategy automatically. Specifying a template gives you more predictable, consistent results for known document types.

Template Output Examples

Book

part-01-foundations/
  chapter-01-introduction.md
  chapter-02-background.md
  chapter-03-methodology/
    3.1-approach.md
    3.2-data-collection.md
part-02-results/
  chapter-04-findings.md
  chapter-05-analysis.md
appendices/
  appendix-a-tables.md
definitions.md
article-01-parties.md
article-02-scope.md
article-03-obligations/
  3.1-seller.md
  3.2-buyer.md
clauses/
  force-majeure.md
  indemnity.md
  arbitration.md
schedules/
  annex-a-specifications.md
  annex-b-pricing.md

Academic Paper

abstract.md
01-introduction.md
02-literature-review.md
03-methodology.md
04-results.md
05-discussion.md
06-conclusion.md
references.md
appendices/
  appendix-a-supplementary-data.md