Skip to content

Commit

Permalink
Exclude tutorials in non-English language from PDF manual - close #381
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Apr 14, 2023
1 parent 1910c31 commit 28edd82
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/Tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ with pdf.table(TABLE_DATA):

## Table from pandas DataFrame

_cf._ https://pyfpdf.github.io/fpdf2/Maths.html#using-pandas
_cf._ [Maths documentation page](Maths.md#using-pandas)

## Using write_html

Expand Down Expand Up @@ -247,7 +247,7 @@ pdf.write_html(
pdf.output('table_html.pdf')
```

Note that `write_html` has [some limitations, notably regarding multi-lines cells](HTML.html#supported-html-features).
Note that `write_html` has [some limitations, notably regarding multi-lines cells](HTML.md#supported-html-features).

## "Parsabilty" of the tables generated

Expand Down
20 changes: 10 additions & 10 deletions docs/Text.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ For all text insertion methods, the relevant font related properties (eg. font/s
* [`.set_draw_color()`](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_draw_color) - for cell borders
* [`.set_fill_color()`](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_fill_color) - for the background

In addition, some of the methods can optionally use [markdown](TextStyling.html#markdowntrue) or [HTML](HTML.html) markup in the supplied text in order to change the font style (bold/italic/underline) of parts of the output.
In addition, some of the methods can optionally use [markdown](TextStyling.md#markdowntrue) or [HTML](HTML.md) markup in the supplied text in order to change the font style (bold/italic/underline) of parts of the output.

## Change in current position
`.cell()` and `.multi_cell()` let you specify where the current position (`.x`/`.y`) should go after the call.
This is handled by the parameters `new_x` and `new_y`.
Their values must one of the following enums values or an equivalent string:

* [`XPos`](https://pyfpdf.github.io/fpdf2/fpdf/enums.html#fpdf.enums.XPos)
* [`YPos`](https://pyfpdf.github.io/fpdf2/fpdf/enums.html#fpdf.enums.YPos)
* [`XPos`](fpdf/enums.html#fpdf.enums.XPos)
* [`YPos`](fpdf/enums.html#fpdf.enums.YPos)

## .text()
Prints a single-line character string. In contrast to the other text methods,
Expand All @@ -63,21 +63,21 @@ on the left of the first character, on the baseline. This method allows placing
a string with typographical precision on the page, but it is usually easier to
use the `.cell()`, `.multi_cell()` or `.write()` methods.

[Signature and parameters for .text()](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.text)
[Signature and parameters for .text()](fpdf/fpdf.html#fpdf.fpdf.FPDF.text)

## .cell()
Prints a cell (rectangular area) with optional borders, background color and
character string. The upper-left corner of the cell corresponds to the current
position. The text can be aligned or centered. After the call, the current
position moves to the selected `new_x`/`new_y` position. It is possible to put a link on the text.
If `markdown=True`, then minimal [markdown](TextStyling.html#markdowntrue)
If `markdown=True`, then minimal [markdown](TextStyling.md#markdowntrue)
styling is enabled, to render parts of the text in bold, italics, and/or
underlined.

If automatic page breaking is enabled and the cell goes beyond the limit, a
page break is performed before outputting.

[Signature and parameters for.cell()](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.cell)
[Signature and parameters for.cell()](fpdf/fpdf.html#fpdf.fpdf.FPDF.cell)

## .multi_cell()
Allows printing text with word or character based line breaks. Those can be automatic
Expand All @@ -93,7 +93,7 @@ useful to build tables with multiline text in cells.
In normal operation, returns a boolean indicating if page break was triggered.
When `split_only == True`, returns `txt` split into lines in an array (with any markdown markup removed).

[Signature and parameters for.multi_cell()](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell)
[Signature and parameters for.multi_cell()](fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell)

## .write()
Prints multi-line text between the page margins, starting from the current position.
Expand All @@ -107,12 +107,12 @@ Returns a boolean indicating if page break was triggered.

The primary purpose of this method is to print continuously wrapping text, where different parts may be rendered in different fonts or font sizes. This contrasts eg. with `.multi_cell()`, where a change in font family or size can only become effective on a new line.

[Signature and parameters for.write()](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write)
[Signature and parameters for.write()](fpdf/fpdf.html#fpdf.fpdf.FPDF.write)


## .write_html()
This method is very similar to `.write()`, but accepts basic HTML formatted text as input. See [html.py](HTML.html) for more details and the supported HTML tags.
This method is very similar to `.write()`, but accepts basic HTML formatted text as input. See [html.py](HTML.md) for more details and the supported HTML tags.

Note that when using data from actual web pages, the result may not look exactly as expected, because `.write_html()` prints all whitespace unchanged as it finds them, while webbrowsers rather collapse each run of consequitive whitespace into a single space character.

[Signature and parameters for .write_html()](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html)
[Signature and parameters for .write_html()](fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html)
2 changes: 1 addition & 1 deletion docs/Tutorial-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pdf.cell(60, 10, 'Powered by FPDF.', new_x="LMARGIN", new_y="NEXT", align='C')

[Текст Жюля Верна](https://github.com/PyFPDF/fpdf2/raw/master/tutorial/20k_c1.txt)

Метод [get_string_width](fpdf/fpdf.html#fpdf.fpdf.FPDF.get_string_width) позволяет определить длину строки в текущем шрифте, которая используется здесь для расчета положения и ширины рамки, окружающей заголовок. Затем устанавливаются цвета (через [set_draw_color](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_draw_color), [set_fill_color](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_fill_color) и [set_text_color](fpdf/fpdf. html#fpdf.fpdf.FPDF.set_text_color)), а толщина линии устанавливается в 1 мм (против 0,2 по умолчанию) с помощью [set_line_width](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_line_width). Наконец, мы выводим ячейку (последний параметр True указывает на то, что фон должен быть заполнен).
Метод [get_string_width](fpdf/fpdf.html#fpdf.fpdf.FPDF.get_string_width) позволяет определить длину строки в текущем шрифте, которая используется здесь для расчета положения и ширины рамки, окружающей заголовок. Затем устанавливаются цвета (через [set_draw_color](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_draw_color), [set_fill_color](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_fill_color) и [set_text_color](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_text_color)), а толщина линии устанавливается в 1 мм (против 0,2 по умолчанию) с помощью [set_line_width](fpdf/fpdf.html#fpdf.fpdf.FPDF.set_line_width). Наконец, мы выводим ячейку (последний параметр True указывает на то, что фон должен быть заполнен).

Для печати абзацев используется метод [multi_cell](fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell). Каждый раз, когда строка достигает правого края ячейки или встречается символ возврата каретки, выдается разрыв строки и автоматически создается новая ячейка под текущей. По умолчанию текст выравнивается по ширине.

Expand Down
14 changes: 12 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ plugins:
cover_subtitle: A minimalist PDF creation library for Python
author: ' '
copyright: ' '
exclude_pages:
- 'Tutorial-de'
- 'Tutorial-es'
- 'Tutorial-fr'
- 'Tutorial-gr'
- 'Tutorial-it'
- 'Tutorial-pt'
- 'Tutorial-ru'
- 'Tutorial-hi'
- 'Tutorial-bn'
- 'Tutorial-he'
- 'Tutorial-zh'
#cover: false
#back_cover: true
#custom_template_path: TEMPLATES PATH
Expand All @@ -75,8 +87,6 @@ plugins:
#ordered_chapter_level: 2
#excludes_children:
# - 'release-notes/:upgrading'
#exclude_pages:
# - 'appendix/contribute/'
#convert_iframe:
# - src: IFRAME SRC
# img: POSTER IMAGE URL
Expand Down

0 comments on commit 28edd82

Please sign in to comment.