Versiyon 3

This commit is contained in:
hOLOlu
2025-09-08 01:12:04 +03:00
parent 150b68e44c
commit 62ce7d6930
15 changed files with 78 additions and 178 deletions

View File

@@ -18,25 +18,21 @@ namespace hMarkdown
{
public partial class Form1 : Form
{
public Form1()
public Form1(string fn)
{
InitializeComponent();
this.AllowDrop = true;
if (fn.Length>0) {
tbDosya.Text = fn;
DosyaAc(); }
}
private void tbGozat_Click(object sender, EventArgs e)
private void DosyaAc()
{
openFileDialog.Filter = "(*.md)|*.md|Tüm Dosyalar (*.*)|*.*";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
tbDosya.Text = openFileDialog.FileName;
string contents = File.ReadAllText(@tbDosya.Text);
var result = Markdown.ToHtml(contents);
var bas= @"<html><style type = ""text/css"">
var bas = @"<html><style type = ""text/css"">
.markdown-body {
color-scheme: light;
-ms-text-size-adjust: 100%;
@@ -50,13 +46,25 @@ namespace hMarkdown
word-wrap: break-word;}
</style><body> <div id = ""output"" class=""markdown-body"">";
result = bas + result + "</div></body></html>";
webBrowser.DocumentText = result;
result = bas + result + "</div></body></html>";
webBrowser.DocumentText = result;
//webBrowser.Document.Body.Style.font = "font-family: Tahoma, Threbucet, Verdana; font-size: large;";
//webBrowser.Document.ExecCommand("SelectAll", false, "null");
//webBrowser.Document.ExecCommand("font-family", false, "Tahoma");
//webBrowser.Document.ExecCommand("Unselect", false, "null");
}
private void tbGozat_Click(object sender, EventArgs e)
{
openFileDialog.Filter = "(*.md)|*.md|Tüm Dosyalar (*.*)|*.*";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
tbDosya.Text = openFileDialog.FileName;
DosyaAc();
}
}