processFile function
Future<void>
processFile(
- FileSystemEntity f,
- String outputPath,
- String includesPath,
- String templatesPath,
Implementation
Future<void> processFile(final FileSystemEntity f, final String outputPath,
final String includesPath, String templatesPath) async {
final name = p.basename(f.path);
print("found input file: $name");
if (p.extension(f.path).toLowerCase() == '.md') {
print("processing: $name");
final markdown = (f as File).readAsStringSync();
final title = p.basenameWithoutExtension(f.path);
final html = await processMarkdown(
markdown,
title,
includesPath,
templatesPath,
);
final outputFile = File(p.join(outputPath, "$title.html"));
outputFile.writeAsStringSync(html);
print("wrote output to: $outputPath");
}
}