mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Ajout temporaire lien vo/vf, en attendant modifs composant markdown view
This commit is contained in:
		
							parent
							
								
									e7586e08c1
								
							
						
					
					
						commit
						bca32aa4a9
					
				
					 6 changed files with 30 additions and 8 deletions
				
			
		|  | @ -30,8 +30,9 @@ namespace AideDeJeu.Tools | |||
| 
 | ||||
|         public static string MarkdownToHtml(string md) | ||||
|         { | ||||
|             var pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build(); | ||||
|             return Markdown.ToHtml(md, pipeline); | ||||
|             //var pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build(); | ||||
|             //return Markdown.ToHtml(md, pipeline); | ||||
|             return md; | ||||
|         } | ||||
| 
 | ||||
|         public static IEnumerable<Spell> ToSpells(this Markdig.Syntax.MarkdownDocument document) | ||||
|  |  | |||
|  | @ -20,8 +20,9 @@ | |||
|             <skia:SKCanvasView PaintSurface="PaintHeaderBar" HorizontalOptions="FillAndExpand" HeightRequest="8" /> | ||||
|              | ||||
|             <Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" /> | ||||
|             <Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" /> | ||||
|             <Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" /> | ||||
|             <mdview:MarkdownView x:Name="mdNameVO" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.NameVO}" /> | ||||
|             <!--<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />--> | ||||
|             <!--<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />--> | ||||
| 
 | ||||
|             <!--<Label Text=" " />--> | ||||
| 
 | ||||
|  |  | |||
|  | @ -26,6 +26,7 @@ namespace AideDeJeu.Views | |||
| 
 | ||||
|             BindingContext = this.viewModel = viewModel; | ||||
| 
 | ||||
|             mdNameVO.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s); | ||||
|             mdSpecialFeatures.NavigateToLink = async(s) => await viewModel.Main.NavigateToLink(s); | ||||
|             mdActions.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s); | ||||
|             mdReactions.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s); | ||||
|  |  | |||
|  | @ -2,10 +2,12 @@ | |||
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | ||||
|              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||||
|              xmlns:tools="clr-namespace:AideDeJeu.Tools" | ||||
|              xmlns:mdview="clr-namespace:Xam.Forms.Markdown;assembly=Xam.Forms.MarkdownView" | ||||
|              x:Class="AideDeJeu.Views.SpellDetailPage" | ||||
|              Title="{Binding Title}"> | ||||
|     <ContentPage.Resources> | ||||
|         <ResourceDictionary> | ||||
|             <tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" /> | ||||
|             <tools:NullToFalseConverter x:Key="NullToFalseConverter" /> | ||||
|             <tools:HtmlNodeToFormattedStringConverter x:Key="HtmlNodeToFormattedStringConverter" /> | ||||
|             <tools:HtmlNodesToFormattedStringConverter x:Key="HtmlNodesToFormattedStringConverter" /> | ||||
|  | @ -14,8 +16,9 @@ | |||
|     <ScrollView> | ||||
|         <StackLayout Orientation="Vertical" Padding="15"> | ||||
|             <Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" /> | ||||
|             <Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" /> | ||||
|             <Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" /> | ||||
|             <mdview:MarkdownView x:Name="mdNameVO" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.NameVO}" /> | ||||
|             <!--<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />--> | ||||
|             <!--<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />--> | ||||
| 
 | ||||
|             <Label Text=" " /> | ||||
| 
 | ||||
|  | @ -64,7 +67,8 @@ | |||
|                 </ListView.ItemTemplate> | ||||
|             </ListView>--> | ||||
|             <!--<Label FormattedText="{Binding Description}" Style="{StaticResource Key=content}" />--> | ||||
|             <Label FormattedText="{Binding Item.DescriptionHtml, Converter={StaticResource HtmlNodeToFormattedStringConverter}}" IsVisible="{Binding Item.DescriptionHtml, Converter={StaticResource NullToFalseConverter}}" Style="{StaticResource Key=content}" /> | ||||
|             <!--<Label FormattedText="{Binding Item.DescriptionHtml, Converter={StaticResource HtmlNodeToFormattedStringConverter}}" IsVisible="{Binding Item.DescriptionHtml, Converter={StaticResource NullToFalseConverter}}" Style="{StaticResource Key=content}" />--> | ||||
|             <mdview:MarkdownView x:Name="mdDescription" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.DescriptionHtml}" IsVisible="{Binding Item.DescriptionHtml, Converter={StaticResource NullToFalseConverter}}" /> | ||||
| 
 | ||||
|             <Label Text="{Binding Item.Source}" Style="{StaticResource Key=content}" /> | ||||
|         </StackLayout> | ||||
|  |  | |||
|  | @ -16,6 +16,10 @@ namespace AideDeJeu.Views | |||
|             InitializeComponent(); | ||||
| 
 | ||||
|             BindingContext = this.viewModel = viewModel; | ||||
| 
 | ||||
|             mdNameVO.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s); | ||||
|             mdDescription.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s); | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|         public SpellDetailPage() | ||||
|  |  | |||
|  | @ -129,7 +129,18 @@ namespace AideDeJeuCmd | |||
|         { | ||||
|             string dataDir = @"..\..\..\..\..\Data\"; | ||||
| 
 | ||||
|             await CreateIndexes(); | ||||
|             var md = await LoadStringAsync(dataDir + "spells_vo.md"); | ||||
|             var items = AideDeJeu.Tools.MarkdownExtensions.MarkdownToSpells(md); | ||||
| 
 | ||||
|             var mdOut = string.Empty; | ||||
|             foreach (var item in items) | ||||
|             { | ||||
|                 mdOut += item.ToMarkdownString(); | ||||
|             } | ||||
| 
 | ||||
|             Console.WriteLine(mdOut); | ||||
| 
 | ||||
|             //await CreateIndexes(); | ||||
|             //var spellsVF = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_vf_full.json"); | ||||
|             //var spellsVO = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_vo_full.json"); | ||||
|             //var spellsHD = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_hd_full.json"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez