Browse Source

Changes:

Implements #14
Added changes so HTML generated for some elements in the ExtraMode
extensions work with the CSS in themes.
Added dl/dt CSS statements
Bumped version to 0.9.0
tags/0.9.0
Frans Bouma 10 years ago
parent
commit
be61985ed9
9 changed files with 122 additions and 101 deletions
  1. +102
    -82
      Themes/Default/Destination/css/theme.css
  2. +2
    -2
      src/DocNet/Properties/AssemblyInfo.cs
  3. +2
    -2
      src/DocNet/SimpleNavigationElement.cs
  4. +11
    -10
      src/DocNet/Utils.cs
  5. +1
    -1
      src/MarkdownDeep/TableSpec.cs
  6. +1
    -1
      src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).html
  7. +1
    -1
      src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).html
  8. +1
    -1
      src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).html
  9. +1
    -1
      src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).html

+ 102
- 82
Themes/Default/Destination/css/theme.css View File

@@ -220,14 +220,31 @@ code.code-large {
font-size: 90%;
}

dd {
margin: 0;
}

dfn {
font-style: italic;
}

dl {
margin-bottom: 24px;
}

dl dt {
font-weight: bold;
}

dl p, dl table, dl ul, dl ol {
margin-bottom: 12px !important;
}

dl dd {
margin: 0 0 12px 24px;
}

dl:not(.docutils) {
margin-bottom: 24px;
}


figure {
margin: 0;
}
@@ -317,23 +334,23 @@ input {
*vertical-align: middle;
}

input[type="text"] {
-webkit-appearance: none;
padding: 6px;
display: inline-block;
border: 1px solid;
font-size: 80%;
box-shadow: inset 0 1px 3px #ddd;
border-radius: 0;
-webkit-transition: border 0.3s linear;
-moz-transition: border 0.3s linear;
transition: border 0.3s linear;
}
input[type="text"] {
-webkit-appearance: none;
padding: 6px;
display: inline-block;
border: 1px solid;
font-size: 80%;
box-shadow: inset 0 1px 3px #ddd;
border-radius: 0;
-webkit-transition: border 0.3s linear;
-moz-transition: border 0.3s linear;
transition: border 0.3s linear;
}

/* For chrome, to avoid ugly bar around search box*/
input:focus {
outline: none;
}
/* For chrome, to avoid ugly bar around search box*/
input:focus {
outline: none;
}

ins {
text-decoration: none;
@@ -496,17 +513,21 @@ td {
text-align: center;
}

.toc-footer hr {
width: 100%;
display: block;
height: 1px;
border: 0;
border-top: 1px solid;
margin-left: auto;
margin-right: auto;
padding-bottom: 0;
margin-bottom: 5px;
}
.toc-footer hr {
width: 100%;
display: block;
height: 1px;
border: 0;
border-top: 1px solid;
margin-left: auto;
margin-right: auto;
padding-bottom: 0;
margin-bottom: 5px;
}

.footnotes {
font-size:smaller;
}

/* #endregion */

@@ -538,52 +559,51 @@ td {
margin-bottom: 24px;
}

.table caption {
font-size: 85%;
font-style: italic;
padding: 1em 0;
text-align: center;
}
.table caption {
font-size: 85%;
font-style: italic;
padding: 1em 0;
text-align: center;
}

.table td, .table th {
font-size: 90%;
margin: 0;
overflow: visible;
padding: 8px 16px;
}
.table td, .table th {
font-size: 90%;
margin: 0;
overflow: visible;
padding: 8px 16px;
}

.table td:first-child, .table th:first-child {
border-left-width: 0;
}
.table td:first-child, .table th:first-child {
border-left-width: 0;
}

.table thead {
text-align: left;
vertical-align: bottom;
white-space: nowrap;
}
.table thead {
text-align: left;
vertical-align: bottom;
white-space: nowrap;
}

.table thead th {
font-weight: bold;
border-bottom: solid 2px;
}
.table thead th {
font-weight: bold;
border-bottom: solid 2px;
}

.table td {
background-color: transparent;
vertical-align: middle;
}
.table td {
background-color: transparent;
}

.table td p {
line-height: 18px;
}
.table td p {
line-height: 18px;
}

.table td p:last-child {
margin-bottom: 0;
}
.table td p:last-child {
margin-bottom: 0;
}

.table .table-cell-min {
width: 1%;
padding-right: 0;
}
.table .table-cell-min {
width: 1%;
padding-right: 0;
}

.table-secondary {
font-size: 90%;
@@ -597,14 +617,14 @@ td {
border: 1px solid;
}

.table-bordered-all td {
border-bottom: 1px solid;
border-left: 1px solid;
}
.table-bordered-all td {
border-bottom: 1px solid;
border-left: 1px solid;
}

.table-bordered-all tbody > tr:last-child td {
border-bottom-width: 0;
}
.table-bordered-all tbody > tr:last-child td {
border-bottom-width: 0;
}

.table-bordered {
border: 1px solid;
@@ -637,13 +657,13 @@ td {
overflow: auto;
}

.table-responsive table {
margin-bottom: 0 !important;
}
.table-responsive table {
margin-bottom: 0 !important;
}

.table-responsive table td, .table-responsive table th {
white-space: nowrap;
}
.table-responsive table td, .table-responsive table th {
white-space: nowrap;
}
/* #endregion*/

/* #region Tabs*/


+ 2
- 2
src/DocNet/Properties/AssemblyInfo.cs View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.8.1.0")]
[assembly: AssemblyFileVersion("0.8.1")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0")]

+ 2
- 2
src/DocNet/SimpleNavigationElement.cs View File

@@ -65,7 +65,7 @@ namespace Docnet
if(File.Exists(sourceFile))
{
this.MarkdownFromFile = File.ReadAllText(sourceFile);
content = Utils.ConvertMarkdownToHtml(this.MarkdownFromFile, _relativeH2LinksOnPage);
content = Utils.ConvertMarkdownToHtml(this.MarkdownFromFile, Path.GetDirectoryName(destinationFile), activeConfig.Destination, _relativeH2LinksOnPage);
}
else
{
@@ -87,7 +87,7 @@ namespace Docnet
defaultMarkdown.AppendFormat("* [{0}]({1}){2}", sibling.Name, HttpUtility.UrlPathEncode(sibling.TargetURL), Environment.NewLine);
}
defaultMarkdown.Append(Environment.NewLine);
content = Utils.ConvertMarkdownToHtml(defaultMarkdown.ToString(), _relativeH2LinksOnPage);
content = Utils.ConvertMarkdownToHtml(defaultMarkdown.ToString(), Path.GetDirectoryName(destinationFile), activeConfig.Destination, _relativeH2LinksOnPage);
}
else
{


+ 11
- 10
src/DocNet/Utils.cs View File

@@ -31,15 +31,16 @@ namespace Docnet
{
public static class Utils
{
public static string ConvertMarkdownToHtml(string toConvert, List<Tuple<string, string>> createdAnchorCollector)
/// <summary>
/// Converts the markdown to HTML.
/// </summary>
/// <param name="toConvert">The markdown string to convert.</param>
/// <param name="documentPath">The document path (without the document filename).</param>
/// <param name="siteRoot">The site root.</param>
/// <param name="createdAnchorCollector">The created anchor collector, for ToC sublinks for H2 headers.</param>
/// <returns></returns>
public static string ConvertMarkdownToHtml(string toConvert, string documentPath, string siteRoot, List<Tuple<string, string>> createdAnchorCollector)
{
//var parser = new Markdown(new MarkdownOptions() { EmptyElementSuffix = ">"});
//var toReturn = parser.Transform(toConvert);
//if(createdAnchorCollector != null)
//{
// createdAnchorCollector.AddRange(parser.CollectedH2AnchorNameTuples);
//}

var parser = new MarkdownDeep.Markdown
{
ExtraMode = true,
@@ -47,10 +48,10 @@ namespace Docnet
AutoHeadingIDs = true,
NewWindowForExternalLinks = true,
DocNetMode = true,
DocumentLocation = documentPath,
DocumentRoot = siteRoot,
};

#warning SET DocumentRoot and DocumentLocation for image features.

var toReturn = parser.Transform(toConvert);
createdAnchorCollector.AddRange(parser.CreatedH2IdCollector);
return toReturn;


+ 1
- 1
src/MarkdownDeep/TableSpec.cs View File

@@ -117,7 +117,7 @@ namespace MarkdownDeep
public void Render(Markdown m, StringBuilder b)
{
b.Append("<table>\n");
b.Append("<table class=\"table table-bordered-all table-responsive\">\n");
if (Headers != null)
{
b.Append("<thead>\n<tr>\n");


+ 1
- 1
src/MarkdownDeepTests/testfiles/extramode/Issue26(ExtraMode).html View File

@@ -1,6 +1,6 @@
<p>pre</p>

<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Fruit</th>


+ 1
- 1
src/MarkdownDeepTests/testfiles/extramode/TableAlignment(ExtraMode).html View File

@@ -1,6 +1,6 @@
<p>pre</p>

<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Unspecified</th>


+ 1
- 1
src/MarkdownDeepTests/testfiles/extramode/TableFormatting(ExtraMode).html View File

@@ -1,5 +1,5 @@
<p>pre</p>
<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Fruit</th>


+ 1
- 1
src/MarkdownDeepTests/testfiles/extramode/Tables(ExtraMode).html View File

@@ -1,6 +1,6 @@
<p>pre</p>

<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Fruit</th>


Loading…
Cancel
Save