mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-12-16 23:29:47 +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)
|
public static string MarkdownToHtml(string md)
|
||||||
{
|
{
|
||||||
var pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build();
|
//var pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build();
|
||||||
return Markdown.ToHtml(md, pipeline);
|
//return Markdown.ToHtml(md, pipeline);
|
||||||
|
return md;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<Spell> ToSpells(this Markdig.Syntax.MarkdownDocument document)
|
public static IEnumerable<Spell> ToSpells(this Markdig.Syntax.MarkdownDocument document)
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,9 @@
|
||||||
<skia:SKCanvasView PaintSurface="PaintHeaderBar" HorizontalOptions="FillAndExpand" HeightRequest="8" />
|
<skia:SKCanvasView PaintSurface="PaintHeaderBar" HorizontalOptions="FillAndExpand" HeightRequest="8" />
|
||||||
|
|
||||||
<Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" />
|
<Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" />
|
||||||
<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />
|
<mdview:MarkdownView x:Name="mdNameVO" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.NameVO}" />
|
||||||
<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />
|
<!--<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />-->
|
||||||
|
<!--<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />-->
|
||||||
|
|
||||||
<!--<Label Text=" " />-->
|
<!--<Label Text=" " />-->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ namespace AideDeJeu.Views
|
||||||
|
|
||||||
BindingContext = this.viewModel = viewModel;
|
BindingContext = this.viewModel = viewModel;
|
||||||
|
|
||||||
|
mdNameVO.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s);
|
||||||
mdSpecialFeatures.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);
|
mdActions.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s);
|
||||||
mdReactions.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"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
xmlns:tools="clr-namespace:AideDeJeu.Tools"
|
||||||
|
xmlns:mdview="clr-namespace:Xam.Forms.Markdown;assembly=Xam.Forms.MarkdownView"
|
||||||
x:Class="AideDeJeu.Views.SpellDetailPage"
|
x:Class="AideDeJeu.Views.SpellDetailPage"
|
||||||
Title="{Binding Title}">
|
Title="{Binding Title}">
|
||||||
<ContentPage.Resources>
|
<ContentPage.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
|
<tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" />
|
||||||
<tools:NullToFalseConverter x:Key="NullToFalseConverter" />
|
<tools:NullToFalseConverter x:Key="NullToFalseConverter" />
|
||||||
<tools:HtmlNodeToFormattedStringConverter x:Key="HtmlNodeToFormattedStringConverter" />
|
<tools:HtmlNodeToFormattedStringConverter x:Key="HtmlNodeToFormattedStringConverter" />
|
||||||
<tools:HtmlNodesToFormattedStringConverter x:Key="HtmlNodesToFormattedStringConverter" />
|
<tools:HtmlNodesToFormattedStringConverter x:Key="HtmlNodesToFormattedStringConverter" />
|
||||||
|
|
@ -14,8 +16,9 @@
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<StackLayout Orientation="Vertical" Padding="15">
|
<StackLayout Orientation="Vertical" Padding="15">
|
||||||
<Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" />
|
<Label Text="{Binding Item.NamePHB}" Style="{StaticResource Key=subsection}" />
|
||||||
<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />
|
<mdview:MarkdownView x:Name="mdNameVO" Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Item.NameVO}" />
|
||||||
<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />
|
<!--<Label Text="{Binding Item.NameVO}" Style="{StaticResource Key=content}" />-->
|
||||||
|
<!--<Label Text="{Binding Item.Name}" Style="{StaticResource Key=content}" />-->
|
||||||
|
|
||||||
<Label Text=" " />
|
<Label Text=" " />
|
||||||
|
|
||||||
|
|
@ -64,7 +67,8 @@
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
</ListView>-->
|
</ListView>-->
|
||||||
<!--<Label FormattedText="{Binding Description}" Style="{StaticResource Key=content}" />-->
|
<!--<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}" />
|
<Label Text="{Binding Item.Source}" Style="{StaticResource Key=content}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@ namespace AideDeJeu.Views
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
BindingContext = this.viewModel = viewModel;
|
BindingContext = this.viewModel = viewModel;
|
||||||
|
|
||||||
|
mdNameVO.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s);
|
||||||
|
mdDescription.NavigateToLink = async (s) => await viewModel.Main.NavigateToLink(s);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SpellDetailPage()
|
public SpellDetailPage()
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,18 @@ namespace AideDeJeuCmd
|
||||||
{
|
{
|
||||||
string dataDir = @"..\..\..\..\..\Data\";
|
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 spellsVF = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_vf_full.json");
|
||||||
//var spellsVO = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_vo_full.json");
|
//var spellsVO = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_vo_full.json");
|
||||||
//var spellsHD = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_hd_full.json");
|
//var spellsHD = LoadJSon<IEnumerable<Spell>>(dataDir + "spells_hd_full.json");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue