Releases: foo-ogawa/embedoc
Releases · foo-ogawa/embedoc
v0.11.0
Changes
Custom Datasource Types
- New
defineDatasource()API for creating custom datasource types in TypeScript - Custom types are loaded from
.embedoc/datasources/index.tsand usable inembedoc.config.yaml DatasourceConfig.typenow accepts arbitrary strings (not limited to built-in types)
Custom Inline Format Parsers
- Export
inlineFormatsfrom.embedoc/datasources/index.tsto register custom parsers - Custom formats work with
@embedoc-datamarkers (e.g.,format="toml")
.embedoc/ Directory Structure
- All custom code now defaults to
.embedoc/subdirectory:.embedoc/renderers/(was./embeds/).embedoc/datasources/(new).embedoc/templates/(was./templates/)
embedoc init Command
- New
embedoc initcommand scaffolds project structure - Creates
embedoc.config.yaml,.embedoc/directories with starter files - Adds
embedoc:build,embedoc:watch,embedoc:generatescripts topackage.json - Supports
--forceto overwrite existing files
Renames (backward compatible)
EmbedifyConfig->EmbedocConfig(old name exported as deprecated alias)embeds_dir->renderers_dirconfig key (old key still works with deprecation warning)
Internal
createDatasource()/initializeDatasources()are now async- 7 new unit tests (159 total)
v0.10.2
What's New
format="js" support for inline datasources
Inline data blocks can now use format="js" to define data as JavaScript object literals, including template literal strings.
/*@embedoc-data:prompts format="js"*/{
greeting: `Hello,
world!`,
nested: {
value: `multi-line
template literal`
}
}/*@embedoc-data:end*/This is useful when embedding data in TypeScript/JavaScript source files where strict JSON (double-quoted strings, no trailing commas) is impractical. The JS expression is evaluated at build time via new Function().
v0.10.1
Changes
New Features
- Existing content preservation: Return
nullorundefinedfromrender()to keep existing content unchanged ctx.existingContent: Access the current content between markers for conditional logic
Use Case
Graceful degradation when external data sources (databases, APIs) are unavailable:
async render(ctx) {
try {
const data = await fetchFromDatabase(ctx.params['id']);
return { content: formatData(data) };
} catch (error) {
// On error, keep existing content
return { content: null };
}
}Documentation
- Added "Error Recovery / Graceful Degradation" section to README
- Updated type definitions for
EmbedContextandEmbedResult
v0.10.0
New Features
Inline Datasource Location Metadata
getMeta(propertyPath?)- Get definition location for a specific propertygetAllMeta()- Get all definition locations as an array- Automatically calculates
relativePathfrom target document
Inline Marker Attribute
inline="true"attribute suppresses newlines around generated content- Essential for embedding values within Markdown tables
Bug Fixes
- Fixed frontmatter line offset calculation for accurate line numbers
Documentation
- Updated README.md with Location Metadata and Inline Mode sections
- Updated API documentation with InlineDatasource details
v0.9.2
v0.9.1
What's Changed
Features
- Add Embed API documentation with typedoc
- Add npm workspaces support for examples directory
- Enhanced TSDoc comments for all Embed API types
Documentation
- Add
docs/api/README.mdwith detailed API reference - Add link to API documentation in main README
- Include
docsdirectory in npm package
Developer Experience
- Update examples/embeds imports to use
'embedoc'package name - Add
npm run docscommand for documentation generation
API Reference
Detailed documentation for:
defineEmbedfunctionEmbedDefinitioninterfaceEmbedContextinterfaceEmbedResultinterfaceDatasourceinterfaceMarkdownHelperinterfaceQueryResulttype
Full Changelog: v0.9.0...v0.9.1
v0.9.0 - Initial Release
🎉 Initial Release - embedoc
Features
- In-place document generation: Auto-update marker blocks while preserving manual edits
- Multiple comment styles: HTML, block, line, hash, SQL comments supported
- Datasources: SQLite, CSV, JSON, YAML, glob file patterns
- Programmable embeds: TypeScript/JavaScript functions with
defineEmbedAPI - Inline datasources: Define data directly in documents with
@embedoc-datamarkers - Dot-path access: Navigate nested data structures (e.g.,
project.author.name) - Code fence support: Write inline data in fenced code blocks for syntax highlighting
- File generation: Generate multiple files from datasource records using Handlebars templates
- Watch mode: Monitor file changes with incremental rebuilds
- Dependency tracking: Smart rebuilds based on document-embed-datasource relationships
- Frontmatter support: YAML metadata accessible by embeds
- Markdown helpers: Built-in functions for tables, lists, code blocks, links, etc.
CLI Commands
embedoc build- Process all target filesembedoc watch- Watch mode with live reloadembedoc generate- Generate files from datasourcesembedoc deps- Analyze dependency graph
Requirements
- Node.js >= 18.0.0