Skip to content

Commit b1b145e

Browse files
committed
a little bit of documentation.
1 parent 84f4b11 commit b1b145e

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

.vscode/launch.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"args": [
1414
"-v",
1515
"-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki",
16-
"--attachments-path=..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki\\.attachments\\",
16+
// "--attachments-path=..\\AzureDevOps.WikiPDFExport.Test\\Tests\\AzureDevOps.WikiPDFExport.wiki\\.attachments\\",
1717
// "-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Code",
1818
// "-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Azure-Platform-Design",
1919
// "-p..\\AzureDevOps.WikiPDFExport.Test\\Tests\\1k",
@@ -29,19 +29,18 @@
2929
"--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>",
3030
//"--css=styles.css", //not needed, its the default now.
3131
"--open",
32-
//"--footer-hide-line"
3332
//"--footer-url=C:\\Git\\AzureDevOps.WikiPDFExport\\AzureDevOps.WikiPDFExport\\bin\\Debug\\netcoreapp3.1\\example-footer.html",
3433
//"--header-url=C:\\Git\\AzureDevOps.WikiPDFExport\\AzureDevOps.WikiPDFExport\\bin\\Debug\\netcoreapp3.1\\example-header.html"
3534
//"-s..\\AzureDevOps.WikiPDFExport.Test\\Tests\\Real\\AzureDevOps.WikiPDFExport\\TEST%2DPAGE.md"
3635
//"-s..\\AzureDevOps.WikiPDFExport\\TEST%2DPAGE.md",
3736
//"--mermaidjs-path=mermaid.min.js",
3837
//"--chrome-path=c:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
39-
//"--disableTelemetry",
38+
"--disableTelemetry",
4039
"--mermaid",
4140
//"--filter=tags:test,tags:license"
42-
// "-c"
43-
// "--organization=https://dev.azure.com/mmelcher",
44-
"--pat=7dmhcnemllrx6rn2z5zoh35res6nnl5xnfkyzput3pueaoqrvwr" //add a 'q' to the end. valid until August 2022.
41+
"--highlight-code",
42+
"--organization=https://dev.azure.com/mmelcher",
43+
"--pat=wdsenlsthdajotbtmej3t7pcqq2zqudf57at352ely4blsdjesfa" //add a 'a' to the end. valid until August 2022.
4544
],
4645
"cwd": "${workspaceFolder}/AzureDevOps.WikiPDFExport",
4746
"console": "internalConsole",

AzureDevOps.WikiPDFExport/WikiPDFExporter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ public async Task Export()
240240
{
241241
var css = File.ReadAllText(cssPath);
242242
var style = $"<style>{css}</style>";
243-
header.Add(style);
243+
244+
//adding the css to the footer to overwrite the mermaid, katex, highlightjs styles.
245+
footer.Add(style);
244246
}
245247

246248
//build the html for rendering

AzureDevOps.WikiPDFExport/devopswikistyle.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ html >*:last-child {
3333
margin: 0 0 16px 0
3434
}
3535

36+
pre {
37+
white-space: pre-wrap !important; /* needed to wrap long code lines */
38+
}
39+
40+
table td
41+
{
42+
word-break: break-all !important; /* need to wrap large tables */
43+
}
44+
3645
table {
3746
border-collapse: collapse;
3847
border-spacing: 0;

AzureDevOps.WikiPDFExport/export.pdf

2.97 KB
Binary file not shown.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ If you need more control over the output, please see the Configuration Options b
2121
The tool currently supports the following:
2222
* Export all wiki pages (and sub pages) in the correct order including styles and formatting.
2323
* Includes pictures (remote and relative urls)
24-
* Creates PDF bookmarks to all pages for easier navigation within the PDF
2524
* If you link to other wiki pages, the link in the PDF will work, too.
2625
* Everything self-contained. Download the .exe file, run it, done.
26+
* It is fast. A PDF with 160 pages is created in less than a second.
2727
* Tool can be used as part of a build, see [BuildTask](AzureDevOps.WikiPDFExport/Build-Task.md)
2828
* Supports emoticons :) ⚠ ℹ
29-
* It is fast. A PDF with 160 pages is created in less than a second. 1000 pages in ~8 seconds.
29+
* Mermaid supported
30+
* Workitems can be referenced and will be included in the pdf as link with the current status, e.g. #7.
31+
* Math/Latex formulas are rendered
3032

3133
## 🛰 Requirements
3234

@@ -95,6 +97,7 @@ So far the following limitations are known:
9597
* The tool, sometimes shows an error "Qt: Could not initialize OLE (error 80010106)" - this can be ignored.
9698
* If headers are not formatted properly (#Header instead of # Header), they are rendered incorrectly. I might fix that in the future.
9799
* The tool lacks proper testing because I only have two realistic wikis available. Want to contribute one?
100+
* Currently, no pdf bookmarks are created (see [chromium issue](https://bugs.chromium.org/p/chromium/issues/detail?id=781797)).
98101

99102
## ⚖ License
100103
See [license](/AzureDevOps.WikiPDFExport/License.md)

0 commit comments

Comments
 (0)