pageJson method
Implementation
Map<String, dynamic> pageJson(BookPage page, {bool withContent = true}) {
final file = page.filename;
final article = summary.byPath(file);
final attributes = page.attributes;
return {
'page': {
if (withContent) 'content': page.content,
'dir': page.dir,
if (attributes != null) ...attributes,
if (article != null) ...navJson(article),
},
'file': {
'path': file,
},
};
}