Skip to content

Commit

Permalink
fixing #126 and #125
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMelcher committed Oct 11, 2022
1 parent 4f530f4 commit d51dbfc
Show file tree
Hide file tree
Showing 7 changed files with 456 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"args": [
"--verbose",
//"-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\DeepLink",
"-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\1k",
//"-s..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\Code\\Another-Page.md",
// "--attachments-path=..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki\\.attachments\\",
// "-p..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\Code",
// "-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Azure-Platform-Design",
Expand All @@ -30,8 +30,8 @@
// "--footer-template=<div style='padding-right: 10px; padding-top:2px; margin: 0; -webkit-print-color-adjust: exact; border-top:1px solid grey; color: grey; width: 100%; text-align: right; font-size: 6px;'>Print: <span class='date'></span> Page: </span><span class='pageNumber'></span>/<span class='totalPages'></span></div>",
//"--css=..\\doc\\styles.css", //not needed, its the default now.
"--open",
"--footer-template-path=..\\doc\\example-footer.html",
"--header-template-path=..\\doc\\example-header.html",
//"--footer-template-path=..\\doc\\example-footer.html",
//"--header-template-path=..\\doc\\example-header.html",
"--no-frontmatter",
//"-s..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Real\\AzureDevOps.WikiPDFExport\\TEST%2DPAGE.md"
//"-s..\\AzureDevOps.WikiPDFExport.Test\\test-data\\Inputs\\TEST%2DPAGE.md",
Expand Down
2 changes: 2 additions & 0 deletions AzureDevOps.WikiPDFExport.Test/WikiPDFExporterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class WikiPDFExporterTests
ILoggerExtended _dummyLogger = Substitute.For<ILoggerExtended>();

[Theory]
[InlineData("SingleFileNoOrder")]
[InlineData("Code")]
[InlineData("DeepLink")]
[InlineData("Dis-ordered")]
Expand Down Expand Up @@ -51,6 +52,7 @@ public async void ExportWiki_IncludeUnlistedPages_Succeeds(string wikiToExport)
[InlineData("EmptyOrderFile")]
[InlineData("Flat")]
[InlineData("WellFormed")]
[InlineData("SingleFileNoOrder")]
public async void ExportWiki_OnlyOrderListedPages_Succeeds(string wikiToExport)
{
var options = new Options
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head><body><a id="singlefile">&nbsp;</a><p><img src="/.attachments/index-hero.jpg" alt="image.png" />
<img src=".attachments/index-hero.jpg" alt="image.png" /></p>
<h2 id="smileys">Smileys</h2>
<p>😁♥️🎈✅💻🎥🧾⚖️🏎️😲🎯⚙️</p>
<h2 id="math">Math</h2>
<p>Area of a circle is $\pi r^2$</p>
<p>And, the area of a triangle is:</p>
<p b="" h="">$$
A_=\frac{1}{2}(\cdot)
$$</p>
<h2 id="admin-layout">Admin Layout</h2>
<p>When the package is installed, a default admin layout is applied on all of the admin pages. Default Admin Layout now support Sidebar and Top Navigation, but only one can be enabled at a time. Default Admin Layout has the following configurations in the sampletoGlobalConfig table:</p>
<p><strong>AdminLayout:</strong>
This key is used to set the Default Layout page for Admin pages. The default value is:</p>
<blockquote>
<p>~/Areas/Admin/Views/Layouts/_AdminLayout.cshtml</p>
</blockquote>
<p><strong>AdminLogo:</strong>
This key is used to set the Logo on the Admin pages. The default value is:</p>
<blockquote>
<p>/Areas/Admin/Content/Images/sample_logo.png</p>
</blockquote>
<p><strong>AdminName:</strong>
This key is used to set the App Name on the Admin pages. The default value is:</p>
<blockquote>
<p>sampleto Admin Panel</p>
</blockquote>
<p><strong>EnableAdminSideBar:</strong>
This key is used to enable/disable Sidebar on Admin on the Admin pages. The default value is:</p>
<blockquote>
<p>true</p>
</blockquote>
<h2 id="custom-admin-layout">Custom Admin Layout</h2>
<p>There is an option to change the Layout for Admin pages and design it according to your Web Application. There are few things which you first need to set.</p>
<p><strong>NOTE: The admin layout body is designed in Bootstrap 3. So, you must design your custom admin layout in Bootstrap 3.</strong></p>
<h3 id="changing-layout-page">Changing Layout Page</h3>
<p>To change the Layout page, you need to change the default Admin Layout. Change the value for Global Config: 'AdminLayout'. Set its value to the path of your new layout page.</p>
<h3 id="admin-bundles">Admin Bundles</h3>
<p>You should add the following CSS and Javascript bundles in your admin layout:</p>
<h4 id="css-bundles">- CSS Bundles:</h4>
<p>Add the following bundles in the header tag of your Layout page:</p>
<pre><code class="language-cs">@Styles.Render(&quot;~/bundles/sampletoBootstrap3css&quot;)
@Styles.Render(&quot;~/bundles/sampletocommoncss&quot;)
@Styles.Render(&quot;~/bundles/sampletoSitecss&quot;)
</code></pre>
<h4 id="javscript-bundles">- Javscript Bundles:</h4>
<p>Add the following bundles at the end of body tag in your Layout page:</p>
<pre><code class="language-cs">@Scripts.Render(&quot;~/bundles/sampletocommonscripts&quot;)
@Scripts.Render(&quot;~/bundles/sampletoBootstrap3js&quot;)
@Scripts.Render(&quot;~/bundles/sampletoTemplateCommonscripts&quot;)
</code></pre>
<p>For more details, see the <a href="https://sample.visualstudio.com/sampleto%20Framework/_wiki/wikis/sampleto%20Documentation?pagePath=%2Fsampleto%20Framework%20Manual%2FBuilding%20an%20App%20with%20sampleto%20Framework%2FBundling%20and%20Optimization&amp;pageId=103&amp;wikiVersion=GBmaster">Bundles and Optimzation</a>.</p>
<h3 id="admin-sections">Admin Sections</h3>
<p>You should add the following CSS and Script sections in your admin layout:</p>
<h4 id="css-section">- CSS Section:</h4>
<p>Add the following section in the header tag of your Layout page:</p>
<pre><code class="language-cs">@RenderSection(&quot;css&quot;, required: false)
</code></pre>
<h4 id="script-section">- Script Section:</h4>
<p>Add the following section at the end of body tag in your Layout page:</p>
<pre><code class="language-cs">@RenderSection(&quot;scripts&quot;, required: false)
</code></pre>
<h3 id="getting-logo-and-app-name">Getting Logo and App Name</h3>
<p>To show the Logo and App Name, you have to get the following Global Configs from <a href="https://sample.visualstudio.com/sampleto%20Framework/_wiki/wikis/sampleto%20Documentation?pagePath=%2Fsampleto%20Framework%20Manual%2FBuilding%20an%20App%20with%20sampleto%20Framework%2FApplication%20Configurations&amp;pageId=18&amp;wikiVersion=GBmaster">sampleto Configuration Provider</a>.</p>
<ol>
<li>Admin Logo and App Name
<ul>
<li>'<em>AdminLogo</em>' will contain the Admin App Logo</li>
<li>'<em>AdminName</em>' will contain the Admin App Name</li>
</ul>
</li>
<li>Client Logo and App Name
<ul>
<li>'<em>ClientLogo</em>' will contain the Client Web App Logo</li>
<li>'<em>ClientName</em>' will contain the Client Web App Name</li>
</ul>
</li>
</ol>
<p>Example:</p>
<pre><code class="language-html">&lt;a class=&quot;navbar-brand&quot; href=&quot;/&quot;&gt;
@{
var logo = sampleto.Framework.Core.Config.ConfigurationProvider.GetConfig(&quot;AdminLogo&quot;);

if (string.IsNullOrEmpty(logo))
{
logo = &quot;/Areas/Admin/Content/sampleto/Images/sample_logo.png&quot;;
}

&lt;img onerror=&quot;this.onerror = null; this.src='/Areas/Admin/Content/sampleto/Images/sample_logo.png';&quot; src=&quot;@logo&quot; width=&quot;40&quot; alt=&quot;logo&quot; /&gt;

var clientName = sampleto.Framework.Core.Config.ConfigurationProvider.GetConfig(&quot;AdminName&quot;);

if (string.IsNullOrEmpty(clientName))
{
clientName = &quot;sampleto Framework Web&quot;;
}
&lt;span&gt;@clientName&lt;/span&gt;
}

&lt;/a&gt;
</code></pre>
<h3 id="getting-navigations">Getting Navigations</h3>
<h4 id="default-navigation-view">- Default Navigation View:</h4>
<p>You can use the default navigations or create your own view for navigations. In order to use the default view, you must add the following line of code:</p>
<pre><code class="language-cs">@Html.Action(&quot;GetMenuParital&quot;, &quot;Menu&quot;, new { menuTypeId = &quot;PRIMARY&quot;, viewName = &quot;~/Areas/Admin/Views/Shared/AdminLayout/_top_menu.cshtml&quot;, appId = @sampleto.Framework.Web.Constant.Constants.AdminAppId })
</code></pre>
<h4 id="custom-navigation-view">- Custom Navigation View:</h4>
<p>In order to create your own view for navigation, you must follow these instructions:</p>
<ol>
<li>Create a Partial View and strongly bind it with IEnumerable of 'MenuItemvm':</li>
</ol>
<pre><code class="language-cs">@model IEnumerable&lt;sampleto.Framework.ViewModels.Navigation.MenuItemVm&gt;
</code></pre>
<ol start="2">
<li>Design your Navigtion as per your design requirements.</li>
<li>Use the following line of code inorder to show display your navigations:</li>
</ol>
<pre><code class="language-cs">@Html.Action(&quot;GetMenuParital&quot;, &quot;Menu&quot;, new { menuTypeId = &quot;PRIMARY&quot;, viewName = [Path_To_Your_Navigations_PartialView], appId = @sampleto.Framework.Web.Constant.Constants.AdminAppId })
</code></pre>
<h3 id="global-hidden-variables">Global Hidden Variables</h3>
<p>There are few global variables which are needed on every admin page. These variables contain the Multilingual Texts in the form of the hidden field. These contain confirmation alert texts, buttons texts, etc. Add the following line of code at the start of body tag in your Layout page.</p>
<pre><code class="language-cs">@Html.Partial(&quot;~/Areas/Admin/Views/Shared/AdminLayout/_top_global_vars.cshtml&quot;)
</code></pre>
<p>Following variables are included in the above partial view:</p>
<table>
<thead>
<tr>
<th>Input</th>
<th>Usage (C#)</th>
<th>Resource File</th>
<th>en Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;NoneText&quot; value=&quot;@Global.NoneText&quot; /&gt;</code></td>
<td>Global.NoneText</td>
<td>Global.resx</td>
<td>None</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;NoDataFoundText&quot; value=&quot;@Global.NoDataFoundText&quot; /&gt;</code></td>
<td>Global.NoDataFoundText</td>
<td>Global.resx</td>
<td>No Data found</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ActivateText&quot; value=&quot;@Global.ActivateText&quot; /&gt;</code></td>
<td>Global.ActivateText</td>
<td>Global.resx</td>
<td>Activate</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;DeactivateText&quot; value=&quot;@Global.DeactivateText&quot; /&gt;</code></td>
<td>Global.DeactivateText</td>
<td>Global.resx</td>
<td>Deactivate</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ActiveText&quot; value=&quot;@Global.ActiveText&quot; /&gt;</code></td>
<td>Global.ActiveText</td>
<td>Global.resx</td>
<td>Active</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;InactiveText&quot; value=&quot;@Global.InActiveText&quot; /&gt;</code></td>
<td>Global.InActiveText</td>
<td>Global.resx</td>
<td>Inactive</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;EditText&quot; value=&quot;@Global.EditText&quot; /&gt;</code></td>
<td>Global.EditText</td>
<td>Global.resx</td>
<td>Edit</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;DeleteText&quot; value=&quot;@Global.DeleteText&quot; /&gt;</code></td>
<td>Global.DeleteText</td>
<td>Global.resx</td>
<td>Delete</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ConfirmDeleteRecordText&quot; value=&quot;@Global.ConfirmDeleteRecordText&quot; /&gt;</code></td>
<td>Global.ConfirmDeleteRecordText</td>
<td>Global.resx</td>
<td>Are you sure to Delete the selected record?</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ConfirmDeactivateRecordText&quot; value=&quot;@Global.ConfirmDeactivateRecordText&quot; /&gt;</code></td>
<td>Global.ConfirmDeactivateRecordText</td>
<td>Global.resx</td>
<td>Are you sure to Deactive the selected record?</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ConfirmActivateRecordText&quot; value=&quot;@Global.ConfirmActivateRecordText&quot; /&gt;</code></td>
<td>Global.ConfirmActivateRecordText</td>
<td>Global.resx</td>
<td>Are you sure to Activate the selected record?</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;OperationFailedText&quot; value=&quot;@Messages.OperationFailedText&quot; /&gt;</code></td>
<td>Messages.OperationFailedText</td>
<td>Messages.resx</td>
<td>Operation Failed</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;OperationPerformedSuccessfullyText&quot; value=&quot;@Messages.OperationPerformedSuccessfullyText&quot; /&gt;</code></td>
<td>Messages.OperationPerformedSuccessfullyText</td>
<td>Messages.resx</td>
<td>Operation Performed Successfully</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;ConfirmClearLoginHistoryText&quot; value=&quot;@Messages.ConfirmClearLoginHistoryText&quot; /&gt;</code></td>
<td>Messages.ConfirmClearLoginHistoryText</td>
<td>Messages.resx</td>
<td>Are you sure to clear Login History?</td>
</tr>
<tr>
<td><code>&lt;input type=&quot;hidden&quot; id=&quot;MissingRequiredFields&quot; value=&quot;@Messages.MissingRequiredFields&quot; /&gt;</code></td>
<td>Messages.MissingRequiredFields</td>
<td>Messages.resx</td>
<td>Validation Failed, Please Provide Required Fields</td>
</tr>
</tbody>
</table>
<h3 id="azure-devops-work-item-link">Azure Devops Work Item link</h3>
<p>#7</p>
<ul>
<li>Working link in list</li>
<li>#8</li>
</ul>
<p>Working link between #7 text</p>
<p>#6 - A bug</p>
<p>#NotAWorkItemId</p>
<p>Non working link#7
#7Non working link
Definitly#7Non working link</p>
<footer><style></style></footer></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head><body><footer><style></style></footer></body></html>
Loading

0 comments on commit d51dbfc

Please sign in to comment.