Skip to content

Commit

Permalink
HTML cleanup, better markdown/highlight settings
Browse files Browse the repository at this point in the history
  • Loading branch information
finwe committed Jun 2, 2016
1 parent 193582f commit dd39185
Show file tree
Hide file tree
Showing 76 changed files with 202 additions and 495 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ github_username: mpdf
# Build settings
markdown: kramdown

highlighter: rouge

redcarpet:
extensions: ['no_intra_emphasis', 'tables', 'autolink']

Expand All @@ -20,3 +22,5 @@ kramdown:
header_offset: 1
entity_output: as_char
smart_quotes: lsquo,rsquo,ldquo,rdquo
input: GFM
hard_wrap: false
6 changes: 3 additions & 3 deletions _data/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
slug: credits
parent_title: 'About mPDF'
-
title: Licence
title: License
url: index1652.html
permalink: /about-mpdf/licence.html
slug: licence
permalink: /about-mpdf/license.html
slug: license
parent_title: 'About mPDF'
-
title: 'Installation & Setup'
Expand Down
40 changes: 16 additions & 24 deletions about-mpdf/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,26 @@ modification_time: 2015-08-05T11:59:21+00:00

All credit is due to the following:

<ul>
<li>Olivier Plathey for the original FPDF class [<a href="http://www.fpdf.org/">http://www.fpdf.org</a>]</li>
<li>Renato Coelho for html2fpdf class [<a href="http://html2fpdf.sourceforge.net/">http://html2fpdf.sourceforge.net</a>]</li>
<li>Steven Wittens for the unicode fonts in UFPDF [<a href="http://acko.net/node/56">http://acko.net/node/56</a>]</li>
<li>Nicola Asuni for TCPDF [<a href="http://www.tcpdf.org/">http://www.tcpdf.org</a>]</li>
<li>Khaled Al-Sham'aa for ideas on joining Arabic letters [<a href="http://www.ar-php.org/">http://www.ar-php.org</a>]</li>
</ul>
- **Olivier Plathey** for the original FPDF class [<a href="http://www.fpdf.org/">http://www.fpdf.org</a>]
- **Renato Coelho** for html2fpdf class [<a href="http://html2fpdf.sourceforge.net/">http://html2fpdf.sourceforge.net</a>]
- **Steven Wittens** for the unicode fonts in UFPDF [<a href="http://acko.net/node/56">http://acko.net/node/56</a>]
- **Nicola Asuni** for TCPDF [<a href="http://www.tcpdf.org/">http://www.tcpdf.org</a>]
- **Khaled Al-Sham'aa** for ideas on joining Arabic letters [<a href="http://www.ar-php.org/">http://www.ar-php.org</a>]

Including from FPDF extensions:

<ul>
<li>Martin Hall-May  for WMF support

</li>
</ul>
- **Martin Hall-May** for WMF support

Including from HTML2FPDF:

<ul>
<li>Damon Kohler for the Flowing Block script</li>
<li>Clément Lavoillotte for HTML-oriented FPDF idea</li>
<li>Yamasoft for the gif.php class</li>
<li>Jérôme Fenal for the _parsegif() function</li>
<li>"VIETCOM" for the PDFTable code</li>
<li>Yukihiro O. for the SetDash() function</li>
<li>Ron Korving for the WordWrap() function</li>
<li>Michel Poulain for the DisplayPreferences() function</li>
<li>Seb for the _SetTextRendering() and SetTextOutline() functions</li>
<li>Klemen VODOPIVEC for FPDF_Protection</li>
</ul>
- **Damon Kohler** for the *Flowing Block* script
- **Clément Lavoillotte** for HTML-oriented FPDF idea
- **Yamasoft** for the `gif.php` class
- **Jérôme Fenal** for the `_parsegif()` function
- **"VIETCOM"** for the `PDFTable` code
- **Yukihiro O.** for the `SetDash()` function
- **Ron Korving** for the `WordWrap()` function
- **Michel Poulain** for the `DisplayPreferences()` function
- **Seb** for the `_SetTextRendering()` and `SetTextOutline()` functions
- **Klemen VODOPIVEC** for `FPDF_Protection`

60 changes: 25 additions & 35 deletions about-mpdf/features-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,31 @@ modification_time: 2015-08-05T11:59:20+00:00

# Main features

<ul>
<li>Accepts UTF-8 encoded HTML</li>
<li>Supports almost all languages including <acronym title="Right-to-Left document, used for Hebrew and Arabic languages">RTL</acronym> (arabic and hebrew), and <acronym title="Chinese-Japanese-Korean languages">CJK</acronym> - (chinese-japanese-korean)</li>
<li>Bookmarks</li>
<li>CSS stylesheets</li>
<li>Word spacing and character spacing for justification</li>
<li>Nested block-level elements (e.g. P, DIV) including margins, borders, padding, line-height, background colours etc.</li>
<li>Support (partial) for floating and fixed-position block-elements</li>
<li>Page layout and orientation</li>
<li>Text-justification and hyphenation</li>
<li>Page numbering</li>
<li>Odd and even paging with mirrored margins</li>
<li>Page headers &amp; footers</li>
<li>Columns</li>
<li>Tables - nested tables, rotated, or autosized to fit on a page</li>
<li>Table of contents</li>
<li>Index</li>
<li>Watermarks</li>
<li>Images in JPG, GIF, PNG, SVG, BMP or WMF format</li>
<li>Password protection</li>
<li>Annotations</li>
<li>Barcodes (EAN13, UPC-A/E, Code 11, 39, 93, 128, Codabar, MSI, IMB, Planet, Postnet, RM4SCC etc.)</li>
<li>Import another PDF file and use as a template</li>
<li>Embedded font subsets</li>
<li>PDF/A-1b support (ISO 19005-1:2005)</li>
<li>PDF/X-1a support</li>
</ul>
- Accepts UTF-8 encoded HTML
- Supports almost all languages including <acronym title="Right-to-Left document, used for Hebrew and Arabic languages">RTL</acronym> (arabic and hebrew), and <acronym title="Chinese-Japanese-Korean languages">CJK</acronym> - (chinese-japanese-korean)
- Bookmarks
- CSS stylesheets
- Word spacing and character spacing for justification
- Nested block-level elements (e.g. P, DIV) including margins, borders, padding, line-height, background colours etc.
- Support (partial) for floating and fixed-position block-elements
- Page layout and orientation
- Text-justification and hyphenation
- Page numbering
- Odd and even paging with mirrored margins
- Page headers &amp; footers
- Columns
- Tables - nested tables, rotated, or autosized to fit on a page
- Table of contents
- Index
- Watermarks
- Images in JPG, GIF, PNG, SVG, BMP or WMF format
- Password protection
- Annotations
- Barcodes (EAN13, UPC-A/E, Code 11, 39, 93, 128, Codabar, MSI, IMB, Planet, Postnet, RM4SCC etc.)
- Import another PDF file and use as a template
- Embedded font subsets
- PDF/A-1b support (ISO 19005-1:2005)
- PDF/X-1a support

# More Information

Expand All @@ -43,43 +41,35 @@ mPDF has a number of enhancements over the original FPDF, HTML2FPDF and UPDF scr
**UTF-8 encoded** HTML is accepted as the standard input.

<a href="{{ "/fonts-languages/arabic-rtl-text-v5-x.html" | prepend: site.baseurl }}">Right-to-left languages</a> are supported, with automatic detection of RTL characters within a document. Transposes: tables, lists, text justification and table cell alignment, as well as full text reversal for RTL characters. Automatically detects non-RTL characters and displays these in original order.

<a href="{{ "/what-else-can-i-do/bookmarks.html" | prepend: site.baseurl }}">Bookmarks</a> and <a href="{{ "/setting-pdf-file-properties/document-metadata.html" | prepend: site.baseurl }}">Meta tag information</a> are supported in all character sets.

A single CSS stylesheet can be used for all pages, with <a href="{{ "/fonts-languages/font-substitution-5-x.html" | prepend: site.baseurl }}">font substitution</a> automatically for CJK characters.

<a href="{{ "/fonts-languages/character-substitution.html" | prepend: site.baseurl }}">Character substitution</a> can optionally be used to automatically replace any characters that do not exist in the current font.

<a href="{{ "/what-else-can-i-do/text-justification.html" | prepend: site.baseurl }}">Word spacing and character spacing</a> are both used to justify text; works in unicode mode and CJK characters as well.

**Nested block-level elements** (e.g. P, DIV) are supported, with comprehensive CSS support e.g. margins, borders, padding, line-height, background colours etc.

<a href="{{ "/css-stylesheets/introduction.html" | prepend: site.baseurl }}">CSS style attributes</a> now fully support font, font-size, color, and background color (for highlighting) plus many more.

<a href="{{ "/tables/tables.html" | prepend: site.baseurl }}">Table</a> cell padding and borders are supported.

**Text-indent for 1st line of paragraph**, and hanging indents are supported.

**List indenting** can be defined.

<a href="{{ "/html-support/custom-html-tags.html" | prepend: site.baseurl }}">Custom tags</a> added - PAGEBREAK, COLUMNBREAK, INDEXENTRY

<a href="{{ "/what-else-can-i-do/columns.html" | prepend: site.baseurl }}">Multiple columns</a> can be started and stopped anywhere on the page with column height adjusted (and optionally aligned to justify).

<a href="{{ "/tables/tables.html" | prepend: site.baseurl }}">Tables</a> can be **rotated**, or **autosized** - font-size is reduced if required to fit the page. Background colour for TR rows is supported.

<a href="{{ "/paging/double-sided-documents.html" | prepend: site.baseurl }}">Odd and even paging</a> can be used with inner and outer margins alternated.

A more complex definition of <a href="{{ "/headers-footers/headers-footers.html" | prepend: site.baseurl }}">headers and footers</a> allows left/center/right parts to be defined, each with their own font-styles, and including code to allow the date/time to be inserted as well as page numbers.

A <a href="{{ "/what-else-can-i-do/table-of-contents.html" | prepend: site.baseurl }}">table of contents</a> can be generated automatically, which can be inserted at the front of the document, based on custom tags used throughout the HTML code. (Based on Richard Bondi's extension to FPDF.)

An <a href="{{ "/what-else-can-i-do/index.html" | prepend: site.baseurl }}">Index</a> can be generated at the end of the document based on custom tags used throughout the HTML code.

**Non-breaking space**   is supported when using fonts that have a character representing chr(160) (not all of them). 

<a href="{{ "/what-else-can-i-do/watermarks.html" | prepend: site.baseurl }}">Watermarks</a> as text or images can be used e.g. for 'DRAFT', and will appear as a transparency over other elements.

Intelligent <a href="{{ "/what-else-can-i-do/text-justification.html" | prepend: site.baseurl }}">word-wrapping</a> will avoid 'orphan' punctuation or superscript moving to the next line.

Automatic hyphenation is optional.
Expand Down
4 changes: 2 additions & 2 deletions about-mpdf/licence.md → about-mpdf/license.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
layout: page
title: Licence
title: License
parent_title: About mPDF
permalink: /about-mpdf/licence.html
permalink: /about-mpdf/license.html
modification_time: 2015-08-05T11:59:22+00:00
---

Expand Down
4 changes: 1 addition & 3 deletions about-mpdf/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ Blocks which are defined as position:absolute, fixed or float have only limited

# See Also

<ul>
<li><a href="{{ "/troubleshooting/known-issues.html" | prepend: site.baseurl }}">Known issues</a></li>
</ul>
- <a href="{{ "/troubleshooting/known-issues.html" | prepend: site.baseurl }}">Known issues</a>
2 changes: 1 addition & 1 deletion css-stylesheets/supported-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -2088,5 +2088,5 @@ medium|thin|thick are accepted for size - converted to 1px, 3px, 5px

<ul>
<li class="manual_boxlist"><a href="{{ "/what-else-can-i-do/backgrounds-borders.html" | prepend: site.baseurl }}">Backgrounds &amp; Borders (including Gradients)</a></li>
<li class="manual_boxlist"><a href="{{ "/html-support/html-attributes.html" | prepend: site.baseurl }}">HTML supported attributes</a> </li>
<li class="manual_boxlist"><a href="{{ "/html-support/html-attributes.html" | prepend: site.baseurl }}">HTML supported attributes</a></li>
</ul>
7 changes: 5 additions & 2 deletions css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ nav {
font-family: $font-family-monospace;
}

pre {
background-color: $code-bg;
code {
pre {
background-color: $code-bg;
padding: 0.3rem;
}
}

#content {
Expand Down
4 changes: 1 addition & 3 deletions fonts-languages/about-pdf-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ modification_time: 2015-08-05T11:59:26+00:00
In order for users to be able to read a PDF file, they need to be able to access the necessary fonts/characters. They can do this in three ways:

<ul>
<li>PDF files have certain standard fonts: Arial/Helvetica, Times and Courier in the win-1252 character set, and Zapfdingbats and Symbol character sets. These fonts should be available to any PDF reading program,and do not need to be embedded in the PDF document.

</li>
<li>PDF files have certain standard fonts: Arial/Helvetica, Times and Courier in the win-1252 character set, and Zapfdingbats and Symbol character sets. These fonts should be available to any PDF reading program,and do not need to be embedded in the PDF document.</li>
<li>Files using CJK (chinese-japanese-korean) characters can refer to standard fonts which are freely downloadable from the <a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html" target="_blank">Adobe website</a>. Users will need to download these font-packs to read the document. The four Asian fonts provided by Adobe contain all the characters in codepages: SHIFT_JIS, UHC (cp949), GBK, or BIG5.</li>
<li>Font information can be embedded in the file. It is possible to embed a subset of the font information selectively for only the characters used in the document, or the whole font file.</li>
</ul>
Expand Down
4 changes: 1 addition & 3 deletions fonts-languages/bidirectional-rtl-text-v6-x.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,5 @@ Using BDI will result in the following:
<ul>
<li class="manual_boxlist">

<a href="{{ "/fonts-languages/lang-v5-x.html" | prepend: site.baseurl }}">lang</a> - Information on mPDF support for the HTML attribute lang

</li>
<a href="{{ "/fonts-languages/lang-v5-x.html" | prepend: site.baseurl }}">lang</a> - Information on mPDF support for the HTML attribute lang</li>
</ul>
4 changes: 1 addition & 3 deletions headers-footers/method-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ Therefore to use any <span class="smallblock">RUNTIME</span> method you need to:

<ul>
<li>change the header before the page-break</li>
<li>change the footer after the page-break

</li>
<li>change the footer after the page-break</li>
</ul>

{% highlight php %}
Expand Down
36 changes: 17 additions & 19 deletions headers-footers/method-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $mpdf = new mPDF();
// Define the Header/Footer before writing anything so they appear on the first page
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">My document</div>');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">My document</div>');

$mpdf->SetHTMLFooter('

Expand Down Expand Up @@ -57,7 +57,7 @@ $mpdf->useOddEven = 1; // Use different Odd/Even headers and footers and mirr

// Define the Headers before writing anything so they appear on the first page

$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">My document</div>','O');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">My document</div>','O');

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;">My document</div>','E');

Expand Down Expand Up @@ -108,9 +108,7 @@ Therefore to use any <span class="smallblock">RUNTIME</span> method you need to:

<ul>
<li>change the header before the page-break</li>
<li>change the footer after the page-break

</li>
<li>change the footer after the page-break</li>
</ul>

{% highlight php %}
Expand All @@ -130,7 +128,7 @@ $mpdf->SetHTMLHeader('<div style="text-align: right; border-bottom: 1px solid #0

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000; font-weight: bold; font-size: 10pt;">Chapter 2</div>','E');



$mpdf->AddPage();

Expand Down Expand Up @@ -178,31 +176,31 @@ $mpdf->useOddEven = true;

// Set the headers/footers for the Introduction

$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Introduction</div>','O');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Introduction</div>','O');

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;">Introduction</div>','E');

$mpdf->SetHTMLFooter('<div style="font-weight: bold;">{PAGENO}</div>','O');
$mpdf->SetHTMLFooter('<div style="font-weight: bold;">{PAGENO}</div>','O');

$mpdf->SetHTMLFooter('<div style="text-align: right;">{PAGENO}</div>','E');
$mpdf->SetHTMLFooter('<div style="text-align: right;">{PAGENO}</div>','E');

$mpdf->AddPage('', '', 1, '', 'on'); // suppress page numbering for the introduction

$mpdf->WriteHTML('Introduction of document...');

$mpdf->AddPage('','E');

$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Main</div>','O');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Main</div>','O');

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;">Main</div>','E');

$mpdf->TOCpagebreak('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
$mpdf->TOCpagebreak('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',

$toc-preHTML, $toc-postHTML, $toc-bookmarkText, 1, 'A', 'off'); // sets numbering to start at A

$mpdf->SetHTMLFooter('<div style="font-weight: bold;">Main - {PAGENO}</div>','O');
$mpdf->SetHTMLFooter('<div style="font-weight: bold;">Main - {PAGENO}</div>','O');

$mpdf->SetHTMLFooter('<div style="text-align: right;">Main - {PAGENO}</div>','E');
$mpdf->SetHTMLFooter('<div style="text-align: right;">Main - {PAGENO}</div>','E');

$mpdf->WriteHTML('Main part of document...');

Expand All @@ -220,29 +218,29 @@ $mpdf->useOddEven = true;

// Set the headers/footers for the Introduction

$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Introduction</div>','O');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Introduction</div>','O');

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;">Introduction</div>','E');

$mpdf->SetHTMLFooter('<div style="font-weight: bold;">{PAGENO}</div>','O');
$mpdf->SetHTMLFooter('<div style="font-weight: bold;">{PAGENO}</div>','O');

$mpdf->SetHTMLFooter('<div style="text-align: right;">{PAGENO}</div>','E');
$mpdf->SetHTMLFooter('<div style="text-align: right;">{PAGENO}</div>','E');

$mpdf->AddPage('', '', 1, '', 'on'); // suppress page numbering for the introduction

$mpdf->WriteHTML('Introduction of document...');

$mpdf->AddPage('','E');

$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Main</div>','O');
$mpdf->SetHTMLHeader('<div style="text-align: right; font-weight: bold;">Main</div>','O');

$mpdf->SetHTMLHeader('<div style="border-bottom: 1px solid #000000;">Main</div>','E');

$mpdf->AddPage('', '', 1, 'i', 'off'); // sets page numbering to start here at 1

$mpdf->SetHTMLFooter('<div style="font-weight: bold;">Main - {PAGENO}</div>','O');
$mpdf->SetHTMLFooter('<div style="font-weight: bold;">Main - {PAGENO}</div>','O');

$mpdf->SetHTMLFooter('<div style="text-align: right;">Main - {PAGENO}</div>','E');
$mpdf->SetHTMLFooter('<div style="text-align: right;">Main - {PAGENO}</div>','E');

// Set some variables for the ToC - these are all now depracated

Expand Down
Loading

0 comments on commit dd39185

Please sign in to comment.