mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
Suite parent links
This commit is contained in:
parent
2aec1c8c37
commit
0c980c745e
5 changed files with 38 additions and 3 deletions
|
|
@ -105,11 +105,40 @@ namespace AideDeJeuLib
|
|||
[DataMember]
|
||||
[Indexed]
|
||||
public string RootId { get; set; }
|
||||
|
||||
[DataMember]
|
||||
[Indexed]
|
||||
public string ParentId { get; set; }
|
||||
public string ParentLink { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public string ParentName { get; set; }
|
||||
[IgnoreDataMember]
|
||||
[Ignore]
|
||||
public string ParentNameLink
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ParentName != null && ParentLink != null)
|
||||
{
|
||||
return $"<!--ParentNameLink-->[{ParentName}]({ParentLink})<!--/ParentNameLink-->";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
var regex = new Regex("\\[(?<name>.*?)\\]\\((?<link>.*?)\\)");
|
||||
var match = regex.Match(value);
|
||||
ParentName = match.Groups["name"].Value;
|
||||
ParentLink = match.Groups["link"].Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DataMember]
|
||||
public int NameLevel { get; set; }
|
||||
[DataMember]
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ namespace AideDeJeu.ViewModels
|
|||
else if (IsNewItem(block))
|
||||
{
|
||||
var subItem = ParseItem(source, ref enumerator, allItems);
|
||||
subItem.ParentId = GetNewAnchorId(source, currentItem.Name, allItems);
|
||||
subItem.ParentLink = GetNewAnchorId(source, currentItem.Name, allItems);
|
||||
subItem.ParentName = currentItem.Name;
|
||||
subItem.Markdown = $"> {subItem.ParentNameLink}\n\n---\n\n{subItem.Markdown}";
|
||||
|
||||
var propertyName = subItem.GetType().Name;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
|
||||
<!--Generic-->
|
||||
|
||||
> <!--ParentNameLink-->[Races](races_hd.md#races)<!--/ParentNameLink-->
|
||||
|
||||
---
|
||||
|
||||
# <!--Name-->Aasimar<!--/Name-->
|
||||
|
||||
- Source: <!--Source-->(MDR p59)<!--/Source-->
|
||||
|
|
|
|||
BIN
Data/library.db
BIN
Data/library.db
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
5
|
||||
8
|
||||
Loading…
Add table
Add a link
Reference in a new issue