mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 15:36:07 +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] |         [DataMember] | ||||||
|         [Indexed] |         [Indexed] | ||||||
|         public string RootId { get; set; } |         public string RootId { get; set; } | ||||||
|  | 
 | ||||||
|         [DataMember] |         [DataMember] | ||||||
|         [Indexed] |         [Indexed] | ||||||
|         public string ParentId { get; set; } |         public string ParentLink { get; set; } | ||||||
|  | 
 | ||||||
|         [DataMember] |         [DataMember] | ||||||
|         public string Name { get; set; } |         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] |         [DataMember] | ||||||
|         public int NameLevel { get; set; } |         public int NameLevel { get; set; } | ||||||
|         [DataMember] |         [DataMember] | ||||||
|  |  | ||||||
|  | @ -75,7 +75,9 @@ namespace AideDeJeu.ViewModels | ||||||
|                         else if (IsNewItem(block)) |                         else if (IsNewItem(block)) | ||||||
|                         { |                         { | ||||||
|                             var subItem = ParseItem(source, ref enumerator, allItems); |                             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; |                             var propertyName = subItem.GetType().Name; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,10 @@ | ||||||
| 
 | 
 | ||||||
| <!--Generic--> | <!--Generic--> | ||||||
| 
 | 
 | ||||||
|  | > <!--ParentNameLink-->[Races](races_hd.md#races)<!--/ParentNameLink--> | ||||||
|  | 
 | ||||||
|  | --- | ||||||
|  | 
 | ||||||
| # <!--Name-->Aasimar<!--/Name--> | # <!--Name-->Aasimar<!--/Name--> | ||||||
| 
 | 
 | ||||||
| - Source: <!--Source-->(MDR p59)<!--/Source--> | - 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
	
	 Yan Maniez
						Yan Maniez