ficdown/Ficdown.Parser/Render/Template.cs

33 lines
836 B
C#
Raw Normal View History

namespace Ficdown.Parser.Render
{
using System;
using System.IO;
2019-01-16 16:20:24 -06:00
using System.Reflection;
public static class Template
{
2019-01-16 16:20:24 -06:00
public static string BaseDir => Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath);
public static string Index
{
get { return GetFileContents("Views/index.html"); }
}
public static string Scene
{
get { return GetFileContents("Views/scene.html"); }
}
public static string Styles
{
get { return GetFileContents("Assets/styles.css"); }
}
private static string GetFileContents(string fname)
{
2019-01-16 16:20:24 -06:00
var path = Path.Combine(Template.BaseDir, "Render", fname);
return File.ReadAllText(path);
}
}
}