Org Markdown : Markdig
This commit is contained in:
parent
4bca36906e
commit
3632ed0ceb
7 changed files with 55 additions and 31 deletions
34
src/Yavsc.Org.Tests/MarkdownTests.cs
Normal file
34
src/Yavsc.Org.Tests/MarkdownTests.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using DotMarkdown.Linq;
|
||||
using Markdig;
|
||||
using Xunit;
|
||||
using static DotMarkdown.Linq.MFactory;
|
||||
|
||||
|
||||
public class MarkdownTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestMarkdownRendering()
|
||||
{
|
||||
MDocument document = Document(
|
||||
Heading1("Markdown Sample"),
|
||||
Heading2("Bullet List"),
|
||||
BulletList(
|
||||
"text",
|
||||
Bold("bold text")),
|
||||
HorizontalRule(),
|
||||
Heading2("IndentedCodeBlock"),
|
||||
IndentedCodeBlock("string s = null;"));
|
||||
|
||||
Console.WriteLine(document.ToString());
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestAnotherMarkdownRendering()
|
||||
{
|
||||
var result = Markdown.ToHtml("This is a text with some *emphasis*");
|
||||
|
||||
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
|
||||
using System.Web;
|
||||
using AsciiDocSharp;
|
||||
using AsciiDocSharp.Converters.Html;
|
||||
using Markdig;
|
||||
using Microsoft.AspNetCore.Html;
|
||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
public class AsciidocTagHelper : TagHelper
|
||||
public class MarkdownTagHelper : TagHelper
|
||||
{
|
||||
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
|
||||
{
|
||||
|
|
@ -18,6 +17,7 @@ namespace Yavsc.Helpers
|
|||
|
||||
if (string.IsNullOrWhiteSpace(text)) return;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (context.AllAttributes.ContainsName("summary"))
|
||||
|
|
@ -34,16 +34,10 @@ namespace Yavsc.Helpers
|
|||
}
|
||||
}
|
||||
}
|
||||
var processor = new AsciiDocProcessor(
|
||||
|
||||
);
|
||||
var htmlConverter = new HtmlDocumentConverter();
|
||||
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
|
||||
var result = Markdown.ToHtml(text, pipeline);
|
||||
|
||||
var document = processor.ParseFromText(text);
|
||||
var htmlResult = processor.ConvertDocument(document, htmlConverter);
|
||||
|
||||
|
||||
output.Content.AppendHtml(htmlResult);
|
||||
output.Content.AppendHtml(result);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
**Version de Development**
|
||||
|
||||
<asciidoc>
|
||||
== L'objectif
|
||||
<markdown>
|
||||
## L'objectif
|
||||
|
||||
Cette application est construite pour mettre en relation des artistes du domaine musical avec leur public.
|
||||
|
||||
== Le fonctionnement
|
||||
## Le fonctionnement
|
||||
|
||||
Les utilisateurs du site sont soit artiste, soit client, soit administrateur. ils ont tous droit à leur blog.
|
||||
Pour les artistes, c'est un moyen de promouvoir leur activité.
|
||||
|
|
@ -45,7 +45,7 @@ Une fois sa prestation associée exécutée, les paiements relatifs sont effectu
|
|||
|
||||
Pour un contrat exécuté et non honoré par le client, le processus de poursuite en recouvrement est engagé, sinon, le contrat est archivé, des attestations de paiement sont disponibles pour l'artiste et la facture est marquée payée, puis repostée au client.
|
||||
|
||||
=== Pour l'artiste
|
||||
## Pour l'artiste
|
||||
|
||||
L'artiste choisit plusieurs paramètres qui vont faire son profil :
|
||||
|
||||
|
|
@ -55,19 +55,20 @@ L'artiste choisit plusieurs paramètres qui vont faire son profil :
|
|||
* Un agenda Google optionnel, à consulter pour établir sa disponibilité
|
||||
* Des paramètres supplémentaires en fonctions de son type d'activité par exemple, pour les ensembles, leur taille, le cas échéant, leur répertoire ou des indications sur le style de leur musique)
|
||||
|
||||
=== Pour le client
|
||||
## Pour le client
|
||||
|
||||
Il choisit un lieu et une date pour déclarer un événement avenir (il peut bien-sûr en programmer autant qu'il le veut).
|
||||
|
||||
|
||||
Il peut, parcourir les publications des artistes, et entamer, sur la base d'un de ses projets événementiel, la négociation d'un contrat de prestation.
|
||||
|
||||
Il a accès à la connaissance des journées connues comme libres des artistes par le système.
|
||||
|
||||
== La confidentialité
|
||||
## La confidentialité
|
||||
|
||||
À aucun moment, aucune adresse postale, aucune adresse e-mail ni aucun numéro de téléphone ne sont transmis ni aux clients, ni aux artistes. Seul le système a accès à ces informations.
|
||||
|
||||
De plus, le droit de retrait est permanent et sa mise en oeuvre immédiate.
|
||||
Les artistes comme les clients peuvent demander leur désinscription, qui désactive immédiatement les publications associées à leurs informations, et programme la suppression complète de ces dites informations dans les quinze jours à compter de la demande, sauf demande contradictoire.
|
||||
L'opération est annulable, jusqu'à deux semaines après sa programmation.
|
||||
</asciidoc>
|
||||
</markdown>
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@
|
|||
<Version>1.1.0-feat-sign-estimate.1</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotMarkdown" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8.AspNetIdentity" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8.EntityFramework" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8.EntityFramework.Storage" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8.Security" />
|
||||
<PackageReference Include="HigginsSoft.IdentityServer8.Storage" />
|
||||
<PackageReference Include="Markdig" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue