toRawShelf function
Src --> Raw
Implementation
RawShelf toRawShelf(
SrcShelf srcShelf,
String dataFolderPath,
CometYaml cometYaml,
) {
// Shelf: src --> raw
final codeName = toCodeName(srcShelf.name);
final folderPath = '$dataFolderPath/$codeName';
final filePath = '$folderPath$dartExt';
final List<RawBook> rawBooks = [];
for (final srcBook in srcShelf.books) {
final rawBook = toRawBook(srcBook, folderPath);
rawBooks.add(rawBook);
}
final dart = toDartShelf(srcShelf, cometYaml);
final rawShelf = RawShelf(
books: rawBooks,
fileContent: dart,
folderPath: folderPath,
filePath: filePath,
);
return rawShelf;
}