mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Parsing
This commit is contained in:
		
							parent
							
								
									5b3251ab59
								
							
						
					
					
						commit
						7064f78cbc
					
				
					 1 changed files with 22 additions and 3 deletions
				
			
		|  | @ -482,6 +482,10 @@ namespace AideDeJeuCmd | ||||||
|             public void OutputMarkdown(FullText fullText) |             public void OutputMarkdown(FullText fullText) | ||||||
|             { |             { | ||||||
|                 bool started = false; |                 bool started = false; | ||||||
|  |                 var page = fullText.Where(l => l.FirstOrDefault().Style.Contains("font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);"))?.FirstOrDefault()?.FirstOrDefault()?.Text; | ||||||
|  |                 Console.ForegroundColor = ConsoleColor.Yellow; | ||||||
|  |                 Console.WriteLine($"Page : {page}"); | ||||||
|  |                 Console.ForegroundColor = ConsoleColor.White; | ||||||
|                 foreach (var line in fullText) |                 foreach (var line in fullText) | ||||||
|                 { |                 { | ||||||
|                     var keySpan = line.FirstOrDefault(); |                     var keySpan = line.FirstOrDefault(); | ||||||
|  | @ -495,11 +499,14 @@ namespace AideDeJeuCmd | ||||||
|                         string value = ""; |                         string value = ""; | ||||||
|                         if (line.Count > 1) |                         if (line.Count > 1) | ||||||
|                         { |                         { | ||||||
|                             value = line.Skip(1).Select(p => p.Text).Aggregate((p1, p2) => p1 + p2); |                             value = line.Skip(1).Select(p => p.Text).Aggregate((p1, p2) => p1.Trim() + " " + p2.Trim()); | ||||||
|                         } |                         } | ||||||
|                         if (keySpan.Style.Contains("font-size:11px")) |                         if (keySpan.Style.Contains("font-size:11px")) | ||||||
|                         {   // nom |                         {   // nom | ||||||
|  |                             Console.ForegroundColor = ConsoleColor.Cyan; | ||||||
|                             Console.WriteLine($"# <!--Name-->{keySpan.Text}<!--/Name-->"); |                             Console.WriteLine($"# <!--Name-->{keySpan.Text}<!--/Name-->"); | ||||||
|  |                             Console.WriteLine($""); | ||||||
|  |                             Console.WriteLine($"- Source: <!--Source-->(LDM p{page})<!--/Source-->"); | ||||||
|                         } |                         } | ||||||
|                         else if (!keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;") && CloseKeyValue()) |                         else if (!keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;") && CloseKeyValue()) | ||||||
|                         { |                         { | ||||||
|  | @ -507,15 +514,27 @@ namespace AideDeJeuCmd | ||||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && keySpan.Text.Contains("taille")) |                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && keySpan.Text.Contains("taille")) | ||||||
|                         {   // type / size / alignment |                         {   // type / size / alignment | ||||||
|                             // todo : découper type / size / alignment |                             // todo : découper type / size / alignment | ||||||
|  |                             Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             Console.WriteLine($"-  <!--Type-->{keySpan.Text}<!--/Alignment-->"); |                             Console.WriteLine($"-  <!--Type-->{keySpan.Text}<!--/Alignment-->"); | ||||||
|                         } |                         } | ||||||
|                         else if (keySpan.Style.Contains("rgba(121,27,16,1)")) |                         else if (keySpan.Style.Contains("rgba(121,27,16,1)")) | ||||||
|                         {   // key / value |                         {   // key / value | ||||||
|                             Console.WriteLine($"- **{keySpan.Text}** {value}"); |                             Console.ForegroundColor = ConsoleColor.Blue; | ||||||
|  |                             Console.Write($"- **{keySpan.Text.Trim()}**"); | ||||||
|  |                             Console.ForegroundColor = ConsoleColor.White; | ||||||
|  |                             Console.WriteLine($" {value}"); | ||||||
|  |                         } | ||||||
|  |                         else if(keySpan.Style.Contains("color:rgba(203,0,0,1)")) | ||||||
|  |                         {   // bloodmark | ||||||
|  | 
 | ||||||
|  |                         } | ||||||
|  |                         else if (keySpan.Style.Contains("font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);")) | ||||||
|  |                         {   // page | ||||||
|  | 
 | ||||||
|                         } |                         } | ||||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;")) |                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;")) | ||||||
|                         { |                         { | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                             Console.ForegroundColor = ConsoleColor.Green; | ||||||
|                             Console.Write($"{keySpan.Text}"); |                             Console.Write($"{keySpan.Text}"); | ||||||
|                             Console.ForegroundColor = ConsoleColor.White; |                             Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             Console.WriteLine($" {value}"); |                             Console.WriteLine($" {value}"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez