Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FransBouma committed Feb 17, 2016
1 parent 257203f commit be61985
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 101 deletions.
184 changes: 102 additions & 82 deletions Themes/Default/Destination/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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%;
Expand All @@ -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;
Expand Down Expand Up @@ -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*/
Expand Down
4 changes: 2 additions & 2 deletions src/DocNet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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")]
4 changes: 2 additions & 2 deletions src/DocNet/SimpleNavigationElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public override void GenerateOutput(Config activeConfig, NavigatedPath activePat
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
{
Expand All @@ -87,7 +87,7 @@ public override void GenerateOutput(Config activeConfig, NavigatedPath activePat
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
{
Expand Down
21 changes: 11 additions & 10 deletions src/DocNet/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@ 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,
GitHubCodeBlocks = true,
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;
Expand Down
2 changes: 1 addition & 1 deletion src/MarkdownDeep/TableSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ internal void RenderRow(Markdown m, StringBuilder b, List<string> row, string ty

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");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>pre</p>

<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Fruit</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>pre</p>

<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Unspecified</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>pre</p>
<table>
<table class="table table-bordered-all table-responsive">
<thead>
<tr>
<th>Fruit</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>pre</p>

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

0 comments on commit be61985

Please sign in to comment.