;Код класса Options: Содержит код, дающий возможность задать необходимые для отчёта параметры, используя множество различных механизмов передачи параметров.
==Интерфейс создания структуры документа==
The Статья [[Report GenerationCоздание структуры документа]] article provides an overview of the 'содержит обзор всех интерфейсов модуля [https://gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin docgen' interfaces that are available for outputting documents], доступных для создания структуры документа.
The Статья [[Report APIИнтерфейс программирования отчетов]] article provides more details about the interfacesпредоставляет более детальную информацию об интерфейсах.
The developer Документация API(интерфейса программирования приложений) [https://gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin docgen] api documentation provides a detailed specification of the interfaces, предназначенная для разработчиков, содержит подробную спецификацию интерфейсов.
Gramps attempts to abstract the output document format away from the reportпытается абстрагировать формат вывода от содержимого отчета. By coding to the Если отчёт запрограммирован на основе классов [https://gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin docgen] class, the report can generate its output in the format desired by the end user. The document passed to the report (<tt>self.doc</tt>) could represent an HTML, OpenDocument, PDF or any of the other formats supported by the user. The report does not have to concern itself with the output format detailsвывод содержимого отчёта может осуществляться в том формате, since all details are handled by the document objectкоторый выберет пользователь.
A document is composed of paragraphsОбъект Документ (<code>self.doc</code>), переданный в отчёт, может выводить содержимое отчёта в формате HTML, tablesOpenDocument, and graphics objectsPDF или любом другом из поддерживаемых форматов, по выбору пользователя. Самому отчёту нет необходимости заботиться о формате вывода, т.к. Tables and graphics objects will not be covered in this tutorialвсе связанные с этим задачи выполняются объектом Документ.
The report defines a set of paragraph and font stylesСтруктура документа может быть составлена из абзацев, along with their default implementationтаблиц и графических объектов. The user can override the definition of each styleТаблицы и графические объекты не будут рассмотрены в этом учебнике. Каждый отчёт задает своё множество стилей для абзацев и шрифтов, вместе с их настройками по умолчанию. Пользователь может заменить определение каждого стиля, что, allowing the user to в свою очередь позволяет пользователю [[Gramps_{{man version}}_Wiki_Manual_-_Settings/ru#Customize_report_output_formatsРедактор_стилей|customize the reportнастроить отчёт под свои требования]]. Each paragraph style must be named uniquelyКаждый стиль абзаца должен иметь уникальное имя для того, to prevent collisions when printed in a book formatчтобы не возникало коллизий при использовании отчёта в формате Книги. It is recommended to prefix each paragraph style with a three letter code unique to the reportРекомендуется к имени каждого стиля для абзацев добавлять трех буквенный префикс, уникальный для отчёта. Cтили абзацев и шрифтов определяются в методе <tt>make_default_style()</tt> класса Options. Затем стили абзацев объединяются в стиль <tt> "по умолчанию"</tt>, который создается методом <tt>make_default_style()</tt>. Например, для отчета, который будет нами создан в этом учебнике (<tt>DbSummary</tt>), стили абзацев определены следующим образом:
Paragraph and font styles are defined in the <tt>make_default_style()</tt> function of the options class. The paragraphs are grouped into a <tt>StyleSheet</tt>, which the <tt>make_default_style()</tt> function defines. For the example report (<tt>DbSummary</tt>), the paragraph styles are defined as below:
{{stub}}<!-- need to check code is correct for Gramps 5.1.x -->
compare to <code>gramps\plugins\textreport\summary.py</code> starting at [https://github.com/gramps-project/gramps/blob/master/gramps/plugins/textreport/summary.py#L404 line 404]
<pre>
def make_default_style(self, default_style):