Compare commits
5 Commits
53344de6ea
...
264129b1e9
| Author | SHA1 | Date | |
|---|---|---|---|
| 264129b1e9 | |||
| 80aee52a61 | |||
| 0666436a59 | |||
| ca84cafbdb | |||
| 5d79026135 |
|
|
@ -158,7 +158,7 @@ class Program
|
|||
siteFiles.Add(new SiteFile(x));
|
||||
Log.Debug("Found file {file}",x.FullName);
|
||||
});
|
||||
Log.Information("SiteFiles Found {count}", siteFiles, siteFiles.Count);
|
||||
Log.Information("SiteFiles Found {count}", siteFiles.Count);
|
||||
|
||||
Console.WriteLine($"Converting {siteFiles.Count} files from {settings.InputDirectory.FullName} to {settings.OutputDirectory.FullName}");
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public static class Conversions{
|
|||
string tmpFile = string.Empty;
|
||||
if (StringReplaceFiletypes.Contains(file.Extension))
|
||||
{
|
||||
Log.Information("Replacing baseurl for file {f}",file.FullName);
|
||||
Log.Information("calling string replace for file {f}",file.FullName);
|
||||
tmpFile = Path.Join(Path.GetTempPath(),"pandoc",file.Name);
|
||||
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
|
||||
|
|
@ -120,7 +120,7 @@ public static class Conversions{
|
|||
|
||||
if (template is not null)
|
||||
{
|
||||
Log.Information("Replacing baseurl in template file");
|
||||
Log.Information("calling string replace for template file");
|
||||
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
|
||||
File.Create(tmpTemplateFile).Close(); // TODO: Use the filestream provided by File.Create within a using block to write the text
|
||||
|
|
@ -150,6 +150,12 @@ public static class Conversions{
|
|||
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"))))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(GetNewName(file,settings,".html"))!);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public partial class SiteFile
|
|||
{
|
||||
info = fileInfo;
|
||||
|
||||
Log.Information("{file} extension is {ext}",fileInfo.FullName, fileInfo.Extension);
|
||||
Log.Debug("{file} extension is {ext}",fileInfo.FullName, fileInfo.Extension);
|
||||
// Using this Ensures that the ConverterFunction is Always set.
|
||||
// ConverterFunctions ALWAYS accept just the FileInfo, and ProjectSettings passed at convert time.
|
||||
ConverterFunction = Conversions.Mappings.GetValueOrDefault(info.Extension, Conversions.RawCpy);
|
||||
|
|
|
|||
4
TODO
4
TODO
|
|
@ -1,9 +1,5 @@
|
|||
- 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
|
||||
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.
|
||||
- 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user