Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cs/Markdown/Interfaces/IParser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Markdown.Interfaces;

public interface IParser

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интерфейсы принято хранить радом с их имплементациями

{
IEnumerable<Token> Parse(string markdown);
}
6 changes: 6 additions & 0 deletions cs/Markdown/Interfaces/IRender.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Markdown.Interfaces;

public interface IRender
{
string Render(IEnumerable<Token> tokens);
}
9 changes: 9 additions & 0 deletions cs/Markdown/Interfaces/ITokenHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Markdown.Parsers;

namespace Markdown.Interfaces;

public interface ITokenHandler
{
bool CanHandle(char currentChar, char next, ParserContext context);
public void Handle(ParserContext context);
}
9 changes: 9 additions & 0 deletions cs/Markdown/Interfaces/ITokenRender.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
global using Markdown.Tokens;
using System.Text;

namespace Markdown.Interfaces;

public interface ITokenRender
{
void Render(Token token, StringBuilder result);
}
15 changes: 15 additions & 0 deletions cs/Markdown/Markdown.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="8.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="NUnit" Version="4.4.0" />
</ItemGroup>

</Project>
Loading