All in one to be converted to json
This commit is contained in:
parent
61f5fa20de
commit
c8da883a88
@ -405,9 +405,12 @@ internal abstract class PersonContainer
|
|||||||
string personKeyFormatted;
|
string personKeyFormatted;
|
||||||
string lowerHyphenFullName;
|
string lowerHyphenFullName;
|
||||||
string pattern = "[^a-z0-9-]";
|
string pattern = "[^a-z0-9-]";
|
||||||
|
DateTime dateTime = new(ticks);
|
||||||
|
List<string> allFrontMatter = new();
|
||||||
Calendar calendar = new CultureInfo("en-US").Calendar;
|
Calendar calendar = new CultureInfo("en-US").Calendar;
|
||||||
Models.GenealogicalDataCommunication genealogicalDataCommunication;
|
Models.GenealogicalDataCommunication genealogicalDataCommunication;
|
||||||
GenealogicalDataCommunicationLines? genealogicalDataCommunicationLines;
|
GenealogicalDataCommunicationLines? genealogicalDataCommunicationLines;
|
||||||
|
string weekOfYear = calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00");
|
||||||
ReadOnlyDictionary<string, string> personKeyFormattedToPersonFullName = GetPersonKeyFormattedToPersonFullName(personBirthdayFormat, personContainers);
|
ReadOnlyDictionary<string, string> personKeyFormattedToPersonFullName = GetPersonKeyFormattedToPersonFullName(personBirthdayFormat, personContainers);
|
||||||
ReadOnlyDictionary<int, List<GenealogicalDataCommunicationRelation>> familyIndexToCollection = GetFamilyIndexToCollection(genealogicalDataCommunicationRelations);
|
ReadOnlyDictionary<int, List<GenealogicalDataCommunicationRelation>> familyIndexToCollection = GetFamilyIndexToCollection(genealogicalDataCommunicationRelations);
|
||||||
foreach (Models.PersonContainer personContainer in personContainers.OrderByDescending(l => l.Key))
|
foreach (Models.PersonContainer personContainer in personContainers.OrderByDescending(l => l.Key))
|
||||||
@ -441,8 +444,14 @@ internal abstract class PersonContainer
|
|||||||
frontMatter = MarkDown.GetFrontMatter(ticks, fullName, lowerHyphenFullName, genealogicalDataCommunication);
|
frontMatter = MarkDown.GetFrontMatter(ticks, fullName, lowerHyphenFullName, genealogicalDataCommunication);
|
||||||
if (!frontMatter.Any())
|
if (!frontMatter.Any())
|
||||||
continue;
|
continue;
|
||||||
|
allFrontMatter.AddRange(frontMatter);
|
||||||
MarkDown.WriteFile(personKeyFormatted, ticks, genealogicalDataCommunicationRelations, a2PeopleContentDirectory, calendar, pattern, personKeyFormattedToPersonFullName, familyIndexToCollection, genealogicalDataCommunication, fullName, lowerHyphenFullName, frontMatter);
|
MarkDown.WriteFile(personKeyFormatted, ticks, genealogicalDataCommunicationRelations, a2PeopleContentDirectory, calendar, pattern, personKeyFormattedToPersonFullName, familyIndexToCollection, genealogicalDataCommunication, fullName, lowerHyphenFullName, frontMatter);
|
||||||
}
|
}
|
||||||
|
directory = Path.Combine(a2PeopleContentDirectory, $"{dateTime.Year}-Markdown", $"{dateTime.Year}-Week-{weekOfYear}", ticks.ToString());
|
||||||
|
if (!Directory.Exists(directory))
|
||||||
|
_ = Directory.CreateDirectory(directory);
|
||||||
|
string text = string.Join(Environment.NewLine, allFrontMatter);
|
||||||
|
_ = IPath.WriteAllText(Path.Combine(directory, $"{ticks}.md"), text, updateDateWhenMatches: false, compareBeforeWrite: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user