Open mahish opened 7 years ago
I agree this is much needed. Has anyone figured out a way to add notes to groups of materials (i.e. a materials folder)?
I ended up with a workaround. Basically I duplicated & modifed notes
functionality in fabricator-assembler/index.js
which you can find in node_modules
. Then used it once in the first material item within the group/collection in the same way as you would use notes. You just need to prepare your include templates.
// get material front-matter, omit `notes`
var localData = _.omit(fileMatter.data, ['notes', 'collectionNotes']);
// trim whitespace from material content
var content = fileMatter.content.replace(/^(\s*(\r?\n|\r))+|(\s*(\r?\n|\r))+$/g, '');
// capture meta data for the material
if (!isSubCollection) {
assembly.materials[collection].items[key] = {
filename: id,
name: toTitleCase(id),
notes: (fileMatter.data.notes) ? md.render(fileMatter.data.notes) : '',
data: localData
};
} else {
assembly.materials[parent].items[collection].items[key] = {
filename: id,
name: toTitleCase(id.split('.')[1]),
notes: (fileMatter.data.notes) ? md.render(fileMatter.data.notes) : '',
collectionNotes: (fileMatter.data.collectionNotes) ? md.render(fileMatter.data.collectionNotes) : '',
data: localData
};
}
Check the index.js, lines 325-345 in fabricator-assembler repo.
Hope it helps.
Hey, first let me thank you for this amazing framework. I do rly enjoy it:)
I would love to have possibility to show general notes for whole group of materials, e.g. notes for
lists
:Taken the logic behind the notes system (notes in front matter or in .md files with the same name), I would expect it should work something like this:
But actually I would like more this one:
Anyway, I didn't find a way to do it by myself. Any hint?