jitbit /
AspNetSaml
Very simple SAML 2.0 consumer module for ASP.NET/C#
85/100 healthLoading repository data…
antoinebidault / repository
A very simple html to amp converter for ASP.NET Core 2
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This project is intended to provide a lightweight html to AMP converter for article html produced by WYSIWING editors like TinyMCE, CKEditor... It uses HtmlAgilityPack for sanitizing html.
ASP.NET Core 2.1 or higher
Install the nuget package
install-package HtmlToAmpConverter
In your startup.cs ConfigureServices void, register the HtmlToAmp service :
services.AddHtmlToAmpConverter();
And then in your controller MVC :
private HtmlToAmp _htmlToAmp;
public HomeController(HtmlToAmp htmlToAmp)
{
_htmlToAmp = htmlToAmp;
}
public IActionResult Index() {
string htmlAMP = _htmlToAmp.ConvertToAmp(html);
return Ok(htmlAMP);
}
.amp-iframe .amp-img .amp-youtube .script & styles tag removing
you can control the layout used for objects by setting the value of DefaultObjectLayout in the options file
services.AddHtmlToAmpConverter(options=> options.DefaultObjectLayout = AmpObjectLayout.fill
Available options are responsive (default option), fill and cover
you can use the fill option if you have images, or iframes with unknown width and height to ensure aspect ratio is maintened
When using the fill options, you must add the following styling rules to your stylesheet
[layout="fill"] { position: relative; display: block; width: 100%; height: 300px; }
[layout="fill"] > img { object-fit: contain; }
Create a custom Sanitizer It is recommended to use HtmlAgilityPack for manipulating the html document
// Example
public class MyCustomSanitizer : IHtmlToAmpSanitizer
{
public void ConvertToAmp(HtmlDocument html)
{
// Manipulate the dom with HtmlAgilityPack here
// See the docs : https://html-agility-pack.net/documentation
}
}
You register the sanitizer as following :
services.AddHtmlToAmpConverter(options=> {
options.AddSanitizer<MyCustomSanitizer>();
});
Selected from shared topics, language and repository description—not editorial ratings.
jitbit /
Very simple SAML 2.0 consumer module for ASP.NET/C#
85/100 healthfarrukhmpk /
MIT License. A very simple sample ASP .NET Core and C# .NET Core based RESTful application and web API, i.e., a REST Service.
31/100 healthswapnil233 /
A very simple CRUD webapp created following the "ASP.NET Core Crash Course - C# App in One Hour" tutorial offered by freeCodeCamp. Follows an MVC structure and uses ASP.NET Core with C#. Features authorization.
shahgrishma123 /
I designed a very simple WebRTC video-conferencing application following the MVC pattern in C# (ASP.Net Core 3.1)
27/100 healthameksike /
It is a demo written on TypeScript and C Sharp over Microsoft .NET platform. Is very simple project with one used: Angular, ASP.NET Core, SQL Server, etc.
15/100 healthAlbertArakelyan /
A very simple beginner-friendly pet project with role-based and JWT authentication, organizations, many CRUD operations and file uploads written in C# ASP.NET Core Web API.
26/100 health