Code Monkey home page Code Monkey logo

markdownviewengine's Introduction

Markdown View Engine

Disclaimer: This is not a replacement of MVC Razor View Engine

What is this?

This is just a prototype for building a new view engine for MVC in ASP.NET Core that uses Markdown .md instead of .cshtml.

Can I use it in Production?

Short answer is Not Yet, because the project is still prototype, and it's under development, all of you 're welcome to contribute to the source code.

What are the plans for this project?

The project is still in the early stages, but I have some point to share:

  • Support layout pages aka master pages
  • Add _ViewStart.md to set the layout for all the markdown views
  • Ability to use mustache template
  • Using some directive such as @model with different flavour
  • Share data bewteen the layouts & view

markdownviewengine's People

Contributors

hishamco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

yoyofx basimf empowr

markdownviewengine's Issues

Feature request: CommonMarkSettings

I need to be able to resolve some custom URIs ("noda-type://" etc) - I believe I can do this with CommonMarkSettings but there's no way of providing any in MarkdownViewEngine. This could be a property in MarkdownViewEngineOptions, then passed along in MarkdownPage.

Support layout and page title in same page?

I have two different layouts I need to support: one for the user guide, and one for a developer guide.

Ideally, I could default to the user guide but have a file in the developer directory that changes the layout. However, failing that, it wouldn't be awful to have:

@layout DeveloperLayout.md
@page title="Foo"

in each developer guide page. But at the moment, I think only a single directive is supported per file. Perhaps it should read a line at a time until it finds something which isn't a directive (and processing the directives as it goes), and then concatenate the rest of the file with that...

Page directive can throw exceptions

I'm in the habit of putting spaces in assignments, so I had

@page title = "Foo"

... at which point Substring fails. Perhaps the regex for the values should just capture the key/value pairs with regex groups? That would be simpler.

The mustache nuggets must respect the Model Properties casing

Now if we have a model like this:

@model firstName="Jon" lastName="Doe"

This will work {{FirstName}}, but {{firstName}} doesn't

So the mustache nugget case should respect the case of the model property, in above example this {{firstName}} should work fine

Dead code in MarkdownPage

This code in MarkdownPage does nothing useful:

if (!String.IsNullOrEmpty(markdown))
{
    markdown.Remove(0, directiveLine.Length - 1);
}

I suspect the intention was markdown = markdown.Remove(...) but that would do the wrong thing anyway - this code should just be removed.

(Sorry for reporting it like this - I'll gear up to create pull requests soon. :)

Razor layout, Markdown body?

Using HTML in Markdown is slightly painful - if you have blank lines followed by indented HTML, they're treated as code, for example. Additionally, quite a lot of what I'd personally like to include code for would be in the layout rather than the body - and while this is planned for MDVE, it's not there yet.

How feasible would it be to load a layout in regular Razor, but then render the body of the view in Markdown? MDVE would still be responsible for finding the right Markdown file - and even the right layout file - to start with, but then ask Razor to render the layout, calling back into MDVE (possibly with a tag helper?) for the body.

I don't know much about the Razor details, and it may be infeasible or impractical, but it would be great if possible.

No licence?

This looks like exactly the project I'm looking for in order to serve the Noda Time user guides. However, in order to contribute to it - and even use it as a nuget package - I'd need there to be a suitable licence stating how it can be used. (I'd personally appreciate either Apache 2.0, MIT, or BSD, but obviously YMMV.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.