Jeff-Lewis / nhaml

Automatically exported from code.google.com/p/nhaml
0 stars 0 forks source link

Possibility to add custom markuprules? #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In order to register custom markup rules it would suffice to create a 
class that inherits from MarkupRule and then register it by adding by 
running AddRule on NHamlMvcViewEngine.TemplateEngine.Options.

If I'm not mistaking currently this is impossible from outside the 
NHamlMvcViewEngine because Template engine is protected.

By simply either making the TemplateEngine property public (get only) or 
by propagating the AddRule method somewhere we could enable run-time 
adding of custom rules.

This allows me to do 

    var nHamlMvcViewEngine = new NHamlMvcViewEngine();
    nHamlMvcViewEngine.TemplateEngine.Options.AddRule(
        new Boris.NHaml.Rules.MyCustomMarkupRule());
    ViewEngines.Engines.Add(nHamlMvcViewEngine);

Original issue reported on code.google.com by Boris.Ca...@gmail.com on 9 Nov 2009 at 9:02

GoogleCodeExporter commented 9 years ago
done
go here for latest build
http://teamcity.codebetter.com/viewLog.html?buildId=lastSuccessful&buildTypeId=b
t43&tab=artifacts

Original comment by simon.cropp@gmail.com on 10 Nov 2009 at 6:22

GoogleCodeExporter commented 9 years ago
Nice :)

Original comment by Boris.Ca...@gmail.com on 10 Nov 2009 at 8:30

GoogleCodeExporter commented 9 years ago
Nice :)

Original comment by Boris.Ca...@gmail.com on 10 Nov 2009 at 8:31