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.0tags/0.9.0
| @@ -220,14 +220,31 @@ code.code-large { | |||||
| font-size: 90%; | font-size: 90%; | ||||
| } | } | ||||
| dd { | |||||
| margin: 0; | |||||
| } | |||||
| dfn { | dfn { | ||||
| font-style: italic; | 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 { | figure { | ||||
| margin: 0; | margin: 0; | ||||
| } | } | ||||
| @@ -317,23 +334,23 @@ input { | |||||
| *vertical-align: middle; | *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 { | ins { | ||||
| text-decoration: none; | text-decoration: none; | ||||
| @@ -496,17 +513,21 @@ td { | |||||
| text-align: center; | 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 */ | /* #endregion */ | ||||
| @@ -538,52 +559,51 @@ td { | |||||
| margin-bottom: 24px; | 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 { | .table-secondary { | ||||
| font-size: 90%; | font-size: 90%; | ||||
| @@ -597,14 +617,14 @@ td { | |||||
| border: 1px solid; | 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 { | .table-bordered { | ||||
| border: 1px solid; | border: 1px solid; | ||||
| @@ -637,13 +657,13 @@ td { | |||||
| overflow: auto; | 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*/ | /* #endregion*/ | ||||
| /* #region Tabs*/ | /* #region Tabs*/ | ||||
| @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | |||||
| // You can specify all the values or you can default the Build and Revision Numbers | // You can specify all the values or you can default the Build and Revision Numbers | ||||
| // by using the '*' as shown below: | // by using the '*' as shown below: | ||||
| // [assembly: AssemblyVersion("1.0.*")] | // [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")] | |||||
| @@ -65,7 +65,7 @@ namespace Docnet | |||||
| if(File.Exists(sourceFile)) | if(File.Exists(sourceFile)) | ||||
| { | { | ||||
| this.MarkdownFromFile = File.ReadAllText(sourceFile); | this.MarkdownFromFile = File.ReadAllText(sourceFile); | ||||
| content = Utils.ConvertMarkdownToHtml(this.MarkdownFromFile, _relativeH2LinksOnPage); | |||||
| content = Utils.ConvertMarkdownToHtml(this.MarkdownFromFile, Path.GetDirectoryName(destinationFile), activeConfig.Destination, _relativeH2LinksOnPage); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -87,7 +87,7 @@ namespace Docnet | |||||
| defaultMarkdown.AppendFormat("* [{0}]({1}){2}", sibling.Name, HttpUtility.UrlPathEncode(sibling.TargetURL), Environment.NewLine); | defaultMarkdown.AppendFormat("* [{0}]({1}){2}", sibling.Name, HttpUtility.UrlPathEncode(sibling.TargetURL), Environment.NewLine); | ||||
| } | } | ||||
| defaultMarkdown.Append(Environment.NewLine); | defaultMarkdown.Append(Environment.NewLine); | ||||
| content = Utils.ConvertMarkdownToHtml(defaultMarkdown.ToString(), _relativeH2LinksOnPage); | |||||
| content = Utils.ConvertMarkdownToHtml(defaultMarkdown.ToString(), Path.GetDirectoryName(destinationFile), activeConfig.Destination, _relativeH2LinksOnPage); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -31,15 +31,16 @@ namespace Docnet | |||||
| { | { | ||||
| public static class Utils | 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 | var parser = new MarkdownDeep.Markdown | ||||
| { | { | ||||
| ExtraMode = true, | ExtraMode = true, | ||||
| @@ -47,10 +48,10 @@ namespace Docnet | |||||
| AutoHeadingIDs = true, | AutoHeadingIDs = true, | ||||
| NewWindowForExternalLinks = true, | NewWindowForExternalLinks = true, | ||||
| DocNetMode = true, | DocNetMode = true, | ||||
| DocumentLocation = documentPath, | |||||
| DocumentRoot = siteRoot, | |||||
| }; | }; | ||||
| #warning SET DocumentRoot and DocumentLocation for image features. | |||||
| var toReturn = parser.Transform(toConvert); | var toReturn = parser.Transform(toConvert); | ||||
| createdAnchorCollector.AddRange(parser.CreatedH2IdCollector); | createdAnchorCollector.AddRange(parser.CreatedH2IdCollector); | ||||
| return toReturn; | return toReturn; | ||||
| @@ -117,7 +117,7 @@ namespace MarkdownDeep | |||||
| public void Render(Markdown m, StringBuilder b) | 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) | if (Headers != null) | ||||
| { | { | ||||
| b.Append("<thead>\n<tr>\n"); | b.Append("<thead>\n<tr>\n"); | ||||
| @@ -1,6 +1,6 @@ | |||||
| <p>pre</p> | <p>pre</p> | ||||
| <table> | |||||
| <table class="table table-bordered-all table-responsive"> | |||||
| <thead> | <thead> | ||||
| <tr> | <tr> | ||||
| <th>Fruit</th> | <th>Fruit</th> | ||||
| @@ -1,6 +1,6 @@ | |||||
| <p>pre</p> | <p>pre</p> | ||||
| <table> | |||||
| <table class="table table-bordered-all table-responsive"> | |||||
| <thead> | <thead> | ||||
| <tr> | <tr> | ||||
| <th>Unspecified</th> | <th>Unspecified</th> | ||||
| @@ -1,5 +1,5 @@ | |||||
| <p>pre</p> | <p>pre</p> | ||||
| <table> | |||||
| <table class="table table-bordered-all table-responsive"> | |||||
| <thead> | <thead> | ||||
| <tr> | <tr> | ||||
| <th>Fruit</th> | <th>Fruit</th> | ||||
| @@ -1,6 +1,6 @@ | |||||
| <p>pre</p> | <p>pre</p> | ||||
| <table> | |||||
| <table class="table table-bordered-all table-responsive"> | |||||
| <thead> | <thead> | ||||
| <tr> | <tr> | ||||
| <th>Fruit</th> | <th>Fruit</th> | ||||