Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'razor-feature' into unstable. Fixes #1
- Loading branch information
Showing
26 changed files
with
430 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
using Mulder.Base.Domain; | ||
|
||
namespace Mulder.Base.Compilation | ||
{ | ||
public class FilterContext | ||
{ | ||
public IConfiguration Configuration { get; set; } | ||
public dynamic Layout { get; set; } | ||
public dynamic Item { get; set; } | ||
public string Content { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ public enum Filters | |
{ | ||
LIQUID, | ||
MARKDOWN, | ||
LESS | ||
LESS, | ||
RAZOR | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Dynamic; | ||
|
||
namespace Mulder.Base.Extensions | ||
{ | ||
public static class DictionaryExtensions | ||
{ | ||
public static ExpandoObject ToExpando(this IDictionary<string, object> dictionary) | ||
{ | ||
var expando = new ExpandoObject(); | ||
var expandoDictionary = (IDictionary<string, object>)expando; | ||
|
||
foreach (var kvp in dictionary) { | ||
if (kvp.Value is IDictionary<string, object>) { | ||
var expandoValue = ((IDictionary<string, object>)kvp.Value).ToExpando(); | ||
expandoDictionary.Add(kvp.Key, expandoValue); | ||
} | ||
else if (kvp.Value is ICollection) { | ||
var itemList = new List<object>(); | ||
foreach (var item in (ICollection)kvp.Value) { | ||
if (item is IDictionary<string, object>) { | ||
var expandoItem = ((IDictionary<string, object>) item).ToExpando(); | ||
itemList.Add(expandoItem); | ||
} | ||
else { | ||
itemList.Add(item); | ||
} | ||
} | ||
|
||
expandoDictionary.Add(kvp.Key, itemList); | ||
} | ||
else { | ||
expandoDictionary.Add(kvp); | ||
} | ||
} | ||
|
||
return expando; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using Mulder.Base.Compilation; | ||
|
||
namespace Mulder.Base.Filters | ||
{ | ||
public interface IFilter | ||
{ | ||
string Execute(string source, IDictionary<string, object> arguments); | ||
string Execute(string source, FilterContext filterContext); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.