using CefSharp;
using CefSharp.WinForms;
using Markdig;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Security.Policy;
namespace MintHTML
{
public partial class Form1 : Form
{
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string markfile;
string htmlfile = "
Welcome to MintHTML
Open a markdown file and press \"Render preview\" to see the output here.
";
string csssuffix = @"
";
string logo = @"
";
string css;
bool extraInstance = false;
int extraNum = 0;
// Custom functions
private void convert()
{
htmlfile = Markdown.ToHtml(markfile);
}
// Custom functions end
public Form1()
{
if (File.Exists(appdata + "/SweeZero/MintHTML/Caches/Instance/lockfile"))
{
extraInstance = true;
extraNum = 1;
while (File.Exists(appdata + "/SweeZero/MintHTML/Caches/Instance" + extraNum.ToString() + "/lockfile"))
{
extraNum++;
}
var settings = new CefSettings()
{
RootCachePath = appdata + "/SweeZero/MintHTML/Caches/Instance" + extraNum.ToString(),
WindowlessRenderingEnabled = true,
};
Cef.Initialize(settings);
}
else
{
var settings = new CefSettings()
{
RootCachePath = appdata + "/SweeZero/MintHTML/Caches/Instance",
WindowlessRenderingEnabled = true,
};
Cef.Initialize(settings);
}
InitializeComponent();
css = @"