Merge pull request #51 from erri120/better-html

Better HTML with CSS
This commit is contained in:
Timothy Baldridge 2019-09-25 21:41:36 -06:00 committed by GitHub
commit 6447fe44e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 1 deletions

View File

@ -276,6 +276,15 @@ namespace Wabbajack
private void GenerateReport()
{
string css = "";
using (Stream cssStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Wabbajack.css-min.css"))
{
using (StreamReader reader = new StreamReader(cssStream))
{
css = reader.ReadToEnd();
}
}
using (var fs = File.OpenWrite($"{ModList.Name}.md"))
{
fs.SetLength(0);
@ -285,7 +294,8 @@ namespace Wabbajack
}
}
ModList.ReportHTML = CommonMarkConverter.Convert(File.ReadAllText($"{ModList.Name}.md"));
ModList.ReportHTML = "<style>"+css+"</style>"
+CommonMarkConverter.Convert(File.ReadAllText($"{ModList.Name}.md"));
}
/// <summary>

View File

@ -265,6 +265,12 @@
<ItemGroup>
<Resource Include="square_transparent_icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="css.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="css-min.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="banner.png" />
</ItemGroup>

1
Wabbajack/css-min.css vendored Normal file
View File

@ -0,0 +1 @@
*{margin:0;padding:0;border:0;font-size:100%;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;vertical-align:baseline;-webkit-text-size-adjust:none;padding-left:10px;padding-right:10px}ul{list-style:none}q{quotes:none}q:after,q:before{content:'';content:none}h1,h2,h3,h4,h5,h6{color:#555;font-weight:400;line-height:1.5;margin:0}h3{margin:1em 0 1em .5em;text-align:left;text-decoration:underline}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:inherit;text-decoration:none}h2{font-size:1.85em;font-weight:300}h3{font-size:1.75em}h4{font-size:1.5em}h5{font-size:.9em}h6{font-size:.7em}a{color:#6cc091;text-decoration:underline}a:hover{text-decoration:none}code{background:rgba(144,144,144,.075);border-radius:0;border:solid 1px #dbdbdb;font-family:"Courier New",monospace;font-size:.9em}

67
Wabbajack/css.css Normal file
View File

@ -0,0 +1,67 @@
* {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
vertical-align: baseline;
-webkit-text-size-adjust: none;
padding-left: 10px;
padding-right: 10px;
}
ul {
list-style: none;
}
q {
quotes: none;
}
q:before , q:after {
content: '';
content: none;
}
h1, h2, h3, h4, h5, h6 {
color: #555;
font-weight: 400;
line-height: 1.5;
margin: 0 0 0 0;
}
h3 {
margin: 1em 0 1em 0.5em;
text-align: left;
text-decoration: underline;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: inherit;
text-decoration: none;
}
h2 {
font-size: 1.85em;
font-weight: 300;
}
h3 {
font-size: 1.75em;
}
h4 {
font-size: 1.5em;
}
h5 {
font-size: 0.9em;
}
h6 {
font-size: 0.7em;
}
a {
color: #6cc091;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
code {
background: rgba(144, 144, 144, 0.075);
border-radius: 0;
border: solid 1px #dbdbdb;
font-family: "Courier New", monospace;
font-size: 0.9em;
}