Skip to content

Commit

Permalink
Merge pull request #9 from TSchmiedlechner/master
Browse files Browse the repository at this point in the history
#10222 - Use Trebuchet MS for generated PDF
  • Loading branch information
StefanKert committed May 22, 2019
2 parents f352607 + f0ab69e commit 05804b8
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -21,6 +21,7 @@ target/
.vscode/
.vs/
_exported_templates/
tools/

###############
# temp file #
Expand Down
34 changes: 25 additions & 9 deletions README.md
@@ -1,9 +1,21 @@
# fiskaltrust interface documentation
_Welcome to the open source documentation of the fiskaltrust interface!_

Welcome to the open source documentation of fiskaltrust interface. Please review this README file to understand how you can assist in contributing to the fiskaltrust interface documentation.
The technical specification of the data interface described in this document provides information regarding the following areas:
1. Access to the fiskaltrust.Service
2. Integration into the receipt based cash register workflow
3. The data structure
4. Function structure of the interface
5. Types of communication with fiskaltrust.Service
6. Operating categories
Interface specification is provided by fiskaltrust.Interface nuget package, which can be found at https://www.nuget.org/packages/fiskaltrust.interface

## Repository structure
Official PDF documents that are built from the source in this repository can be found on the [Releases page](https://github.com/fiskaltrust/interface-doc/releases).

## Contributions
If you want to contribute to this documentation, please review this README file to understand how it is structured and which tools are used.

### Repository structure
All documentation files are stored within the `/doc` folder in this repository (markdown, images, other static content).

- One sub-directory and one or more markdown file(s) per chapter should be created (e.g. `general/general.md`.)
Expand All @@ -12,21 +24,18 @@ All documentation files are stored within the `/doc` folder in this repository (
- You may also use multiple files per chapter, but keep in mind that a page-break is created by DocFx after every markdown file.
- Images must be stored within a folder called `images`. Multiple image folders in different sub-directories are supported, DocFx just scans for the directory name.

## Tools

### DocFx
### Tools

#### DocFx
[DocFx](https://dotnet.github.io/docfx) is a documentation generation tool that creates HTML and PDF documentation from markdown files. It's e.g. be used by Microsoft to generate docs.microsoft.com.

Use either chocolatey or nuget.exe to install DocFx, as described [here](https://github.com/docascode/docfx-seed/blob/master/README.md).

### wkhtmltopdf

#### wkhtmltopdf
[wkhtmltopdf](https://wkhtmltopdf.org/) is used internally by DocFx to convert HTML files to PDF. Download and install it from the website linked above.
> Please note that wkhtmltopdf 0.12.5 has a bug that prevents the creation of TOCs. Use either the previous (0.12.4) or any newer version.
### PlantUML

#### PlantUML
- This documentation supports the PlantUML notation, which will be converted to SVG images and embedded into the PDF during the build.
- Please add the `skinparam shadowing false` to your diagram. wkhtmltopdf has currently some issues with the transparency caused by the shading.
- The notation for a PlantUML section in the markdown files changed with the new tooling.
Expand All @@ -39,3 +48,10 @@ skinparam shadowing false
Diagram
```
````

### Release
To create a release, clone the repository locally and run the following commands:
```console
git tag <version>
git push origin --tags
```
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -53,6 +53,10 @@ steps:
nuget install DocFx.Plugins.PlantUml -ExcludeVersion -OutputDirectory .
displayName: 'Install prerequisites'

- task: PowerShell@2
inputs:
filePath: 'set-chapter-numbers.ps1'

- powershell: |
Start-Process docfx -Wait -RedirectStandardError $(Build.ArtifactStagingDirectory)/docfx-err.log -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/docfx-out.log
displayName: Run docfx
Expand Down
13 changes: 9 additions & 4 deletions cover.html
Expand Up @@ -4,7 +4,7 @@
<style>
body {
padding-top: 40%;
font-family: 'Segoe UI', Tahoma, Helvetica, sans-serif;
font-family: "Trebuchet MS" !important;
text-align: center;
}

Expand All @@ -15,21 +15,26 @@
}

h1 {
font-size: 3em;
font-size: 4em;
}

h2 {
font-size: 2em;
font-size: 2.5em;
}
.version {
font-size: 0.8em;
font-size: 1em;
}

.address-container {
position: absolute;
left: 5%;
bottom: 5%;
text-align: left;
font-size: 1.2em;
}

.address-container img {
height: 4em;
}
</style>
</head>
Expand Down
Binary file modified doc/images/fiskaltrust.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docfx.json
Expand Up @@ -20,7 +20,7 @@
"pdf": {
"keepRawFiles": true,
"wkhtmltopdf": {
"additionalArguments": "--footer-center [page] --margin-top 25 --margin-bottom 25 --margin-left 30 --margin-right 30 cover cover.html toc --xsl-style-sheet style.xsl"
"additionalArguments": "--dpi 200 --zoom 0.78 --footer-center [page] --margin-top 25 --margin-bottom 25 --margin-left 30 --margin-right 30 cover cover.html toc --xsl-style-sheet style.xsl"
},
"content": [
{
Expand Down
7 changes: 7 additions & 0 deletions set-chapter-numbers.ps1
@@ -0,0 +1,7 @@
# Get chapter numbering tool from GitHub
New-Item -Name "tools" -ItemType Directory -Force
Invoke-WebRequest -Uri https://github.com/TSchmiedlechner/DocFxChapterNumbers/releases/download/v1.0.2/DocFxChapterNumbers-v1.0.2.zip -OutFile "./tools/DocFxChapterNumbers.zip"
Expand-Archive "./tools/DocFxChapterNumbers.zip" -DestinationPath "./tools/DocFxChapterNumbers" -Force

Rename-Item ./doc ./doc_prev
./tools/DocFxChapterNumbers/DocFxChapterNumbers.exe ./doc_prev/toc.md ./doc --force
18 changes: 3 additions & 15 deletions style.xsl
Expand Up @@ -10,34 +10,22 @@
h1 {
text-align: center;
font-size: 20px;
font-family: arial;
font-family: "Trebuchet MS" !important;
}

div {border-bottom: 1px dashed rgb(200,200,200); }
span {float: right;}
li {list-style: none; margin: 5px 0;}

ul {
font-size: 20px;
font-family: arial;
font-size: 18px;
font-family: "Trebuchet MS" !important;
}

ul ul {font-size: 100%; }
ul {padding-left: 0em;}
ul ul {padding-left: 1em;}
a {text-decoration:none; color: black;}


body ul {
counter-reset: item;
}


li div a:before {
content: counters(item, ".") ". ";
counter-increment: item;
}

</style>
</head>
<body>
Expand Down
21 changes: 6 additions & 15 deletions templates/fiskaltrust.pdf/styles/main.css
Expand Up @@ -2,19 +2,10 @@
display: none !important;
}

body {counter-reset: h1}
h1 {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
h5 {counter-reset: h6}

h1:before {counter-increment: h1; content: counter(h1) ". "}
h2:before {counter-increment: h2; content: counter(h1) "." counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h1) "." counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "}
h5:before {counter-increment: h5; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}
h6:before {counter-increment: h6; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "}
h6:before {counter-increment: h6; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "}
body, h3, h4, h5, h6 {
font-family: "Trebuchet MS" !important;
}

h1.nocount:before, h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before { content: ""; counter-increment: none }
.hljs {
font-size: 1.5em !important;
}

0 comments on commit 05804b8

Please sign in to comment.