forked from hphan9/shinny-ssg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileText.cs
32 lines (29 loc) · 827 Bytes
/
FileText.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace shinny_ssg
{
class FileText
{
private string sourcePath;
private string folder;
private string name;
private Page page;
public FileText(string source, string folder, string cssString)
{
this.sourcePath = source;
this.folder = folder;
var fi1 = new FileInfo(source);
name = fi1.Name;
var text = File.ReadAllText(source);
page = new Page(text, cssString);
}
public void saveFile()
{
var newPath = $"{folder}\\{name.Replace("txt","html")}";
Console.WriteLine(newPath);
File.WriteAllText(newPath , page.getPage());
}
}
}