frctl / fractal

A tool to help you build and document website component libraries and design systems.
https://fractal.build
MIT License
2.11k stars 171 forks source link

Razor view adapter #388

Closed nickdunn closed 6 years ago

nickdunn commented 7 years ago

From time to time I have to create templates that will be integrated into ASP.NET projects with CMS like Sitecore or Episerver. Rather than getting the CMS to render handlebars (a big challenge) I'm exploring writing a Razor (https://docs.microsoft.com/en-us/aspnet/web-pages/overview/getting-started/introducing-razor-syntax-c) adapter for Fractal. Now that .NET core will run on a Mac (https://www.microsoft.com/net/core#macos) I think an integration is within reach.

My current thought is to write a small command line app (.NET core) that accepts a template string and a data model and returns HTML (e.g. http://www.codemag.com/article/1312081). The Razor adapter would simply shell out to this.

Are you aware of any Fractal integrations with other templating engines beyond Handlebars and what Consolidate offers that could be used as a reference?

mattsalmon commented 6 years ago

I'd be interested in whether you've gotten any further with that @nickdunn - seems like a good idea for Microsoft based shops who want to use fractal.

nickdunn commented 6 years ago

I didn't get a chance, and the project need has since subsided. But I'm sure it will keep coming back with .NET CMS projects that don't currently have a component library architecture. There are big projects out there in the Sitecore/Episerver/Umbraco space where Fractal could become the go-to tool if we can solve the Razor integration.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

AlbertoLeon commented 4 years ago

I didn't get a chance, and the project need has since subsided. But I'm sure it will keep coming back with .NET CMS projects that don't currently have a component library architecture. There are big projects out there in the Sitecore/Episerver/Umbraco space where Fractal could become the go-to tool if we can solve the Razor integration.

Sounds a super idea. In fact, I think it is necessary to lead Sitecore one step ahead on front-end