Compare commits

..

No commits in common. "264129b1e99c449aac7da41f9134926d6260d704" and "53344de6eaffa1896e5e17b7a96696bb60277906" have entirely different histories.

4 changed files with 8 additions and 10 deletions

View File

@ -158,7 +158,7 @@ class Program
siteFiles.Add(new SiteFile(x)); siteFiles.Add(new SiteFile(x));
Log.Debug("Found file {file}",x.FullName); Log.Debug("Found file {file}",x.FullName);
}); });
Log.Information("SiteFiles Found {count}", siteFiles.Count); Log.Information("SiteFiles Found {count}", siteFiles, siteFiles.Count);
Console.WriteLine($"Converting {siteFiles.Count} files from {settings.InputDirectory.FullName} to {settings.OutputDirectory.FullName}"); Console.WriteLine($"Converting {siteFiles.Count} files from {settings.InputDirectory.FullName} to {settings.OutputDirectory.FullName}");

View File

@ -112,7 +112,7 @@ public static class Conversions{
string tmpFile = string.Empty; string tmpFile = string.Empty;
if (StringReplaceFiletypes.Contains(file.Extension)) if (StringReplaceFiletypes.Contains(file.Extension))
{ {
Log.Information("calling string replace for file {f}",file.FullName); Log.Information("Replacing baseurl for file {f}",file.FullName);
tmpFile = Path.Join(Path.GetTempPath(),"pandoc",file.Name); tmpFile = Path.Join(Path.GetTempPath(),"pandoc",file.Name);
Directory.CreateDirectory(Path.GetDirectoryName(tmpFile)!); // NOTE: It is practially impossible that this would actually return null Directory.CreateDirectory(Path.GetDirectoryName(tmpFile)!); // NOTE: It is practially impossible that this would actually return null
File.Create(tmpFile).Close(); // TODO: Use the filestream provided by File.Create within a using block to write the text File.Create(tmpFile).Close(); // TODO: Use the filestream provided by File.Create within a using block to write the text
@ -120,7 +120,7 @@ public static class Conversions{
if (template is not null) if (template is not null)
{ {
Log.Information("calling string replace for template file"); Log.Information("Replacing baseurl in template file");
string tmpTemplateFile = Path.Join(Path.GetTempPath(),"pandoc",template.Name); string tmpTemplateFile = Path.Join(Path.GetTempPath(),"pandoc",template.Name);
Directory.CreateDirectory(Path.GetDirectoryName(tmpTemplateFile)!); // NOTE: It is practially impossible that this would actually return null Directory.CreateDirectory(Path.GetDirectoryName(tmpTemplateFile)!); // NOTE: It is practially impossible that this would actually return null
File.Create(tmpTemplateFile).Close(); // TODO: Use the filestream provided by File.Create within a using block to write the text File.Create(tmpTemplateFile).Close(); // TODO: Use the filestream provided by File.Create within a using block to write the text
@ -150,12 +150,6 @@ public static class Conversions{
Log.Warning("Pandoc template for {file} not found",file.Name); Log.Warning("Pandoc template for {file} not found",file.Name);
} }
pandocArgs += " --from markdown+raw_attribute ";
if (!string.IsNullOrEmpty(settings.SiteName))
{
// This is used in my template to add the sitename to the title element.
pandocArgs += $" --metadata=\"SiteName:{settings.SiteName}\"";
}
if (!Directory.Exists(Path.GetDirectoryName(GetNewName(file,settings,".html")))) if (!Directory.Exists(Path.GetDirectoryName(GetNewName(file,settings,".html"))))
{ {
Directory.CreateDirectory(Path.GetDirectoryName(GetNewName(file,settings,".html"))!); Directory.CreateDirectory(Path.GetDirectoryName(GetNewName(file,settings,".html"))!);

View File

@ -29,7 +29,7 @@ public partial class SiteFile
{ {
info = fileInfo; info = fileInfo;
Log.Debug("{file} extension is {ext}",fileInfo.FullName, fileInfo.Extension); Log.Information("{file} extension is {ext}",fileInfo.FullName, fileInfo.Extension);
// Using this Ensures that the ConverterFunction is Always set. // Using this Ensures that the ConverterFunction is Always set.
// ConverterFunctions ALWAYS accept just the FileInfo, and ProjectSettings passed at convert time. // ConverterFunctions ALWAYS accept just the FileInfo, and ProjectSettings passed at convert time.
ConverterFunction = Conversions.Mappings.GetValueOrDefault(info.Extension, Conversions.RawCpy); ConverterFunction = Conversions.Mappings.GetValueOrDefault(info.Extension, Conversions.RawCpy);

4
TODO
View File

@ -1,5 +1,9 @@
- UPDATE README
- Make the code such that the metadata file knows what source file an output file came from, this will allow us to delete files from source - Make the code such that the metadata file knows what source file an output file came from, this will allow us to delete files from source
and force consistency by removing them from the dst directory too. and force consistency by removing them from the dst directory too.
- Add a pre-commit or other type of hook to ensure that the Testing directory is properly cleaned and reset before commit. - Add a pre-commit or other type of hook to ensure that the Testing directory is properly cleaned and reset before commit.
- Ensure that the .gitkeep file is placed into Testing/dst - Ensure that the .gitkeep file is placed into Testing/dst
- Look into the possiblity of using a TemplateTemplate, And generating the pandoc template on the fly making it possible to switch out domian/prefix stuff