Template (data processing)

from Wikipedia, the free encyclopedia
The article template (data processing) , format template and text module thematically overlap. Help me to better differentiate or merge the articles (→  instructions ) . To do this, take part in the relevant redundancy discussion . Please remove this module only after the redundancy has been completely processed and do not forget to include the relevant entry on the redundancy discussion page{{ Done | 1 = ~~~~}}to mark. WinfriedSchneider ( discussion ) 8:51 p.m., Jan. 14, 2017 (CET)

A template ( English template ) is used in the data processing for the creation of documents or document portions. It represents a kind of "framework" that defines part of the content or the design of the document. By inserting the missing components, the template is completed to a complete document. They are mainly used for DTP or word processing programs and websites .

Working with templates

A document template itself remains unaffected when it is called up or applied. This means that it can be used over and over and delivers the same result every time. A work file (the file that contains the actual text and possibly also images, which is ultimately intended for publication) is either created on the basis of a document template, or the document template is later assigned to the work file. In any case, such a work file has all the formal characteristics of the document template.

Types of templates

Templates can be templates for complete documents or for document parts.

In addition to format templates for certain paragraph and character formats, a document template contains information for the layout of the document (also generally usable text parts and graphic elements), possibly text modules and macros as well as any special adjustments in the user interface (e.g. definitions of menus, keyboard layouts, etc.) .).

Templates for complete documents

Templates for complete documents can specify sections or fields that should appear in each document and their order. You can also define aspects of the design that should be the same in every document. For example, the sequence of definitions is often specified in templates for source files so that they are the same in all source files in a project.

Modern word processing programs support templates for complete documents in the form of document templates.

In the case of layout programs, document templates are usually structured on several levels: the level of the master pages is located between the overall structure of the file and the paragraph and font format templates. Typical master page elements are empty text frames (often with multiple columns), running headings, and page numbers.

In Microsoft Word , the document template is a file with the extension .dot [in newer versions .dotx or .dotm ] that is stored in a separate folder. The standard document template is named normal.dot [corresponding to normal.dotx or normal.dotm ]; all formats defined there are globally valid, so they are available to all documents. Under OpenOffice.org 1. *, the template of a text document has the suffix “stw” instead of the file extension “dot”. Under LibreOffice and OpenOffice.org 2. *, the document templates of a text document have the file extension “ott”.

For spreadsheets , the file extensions of document templates are "xlt" for Microsoft Excel and "stc" for OpenOffice.org 1. *. Under LibreOffice and OpenOffice.org 2. *, the document templates of a table have the file extension "ots".

Templates for document parts

Templates for document parts can also define components and their order or design.

For source texts within a programming project, a template for function definitions is often used, with which it is to be ensured that certain comments are available for each subroutine. (For example, the function of the subroutine, meaning of the parameters, preconditions and postconditions for the call, complexity of the algorithm used.)

Templates for document parts can also be found in the form of specifications on how cited literature is to be listed in bibliographies.

Modern word processing programs support templates for document parts in the form of format templates .

Templates for source files for programming languages

A template for source text files gives the developer a meaningful structure and sequence for the arrangement of the individual recurring language elements in the source file. This facilitates and accelerates the creation of new modules and contributes to compliance with the coding standard .

The structuring of the source text file and the determination of the order make it easier to find information within the file. In addition, a sensible sequence ensures that dependencies between the language elements do not lead to conflicts.

A meaningful structure of the language elements for the programming language C is:

For the source file:

  1. Include files (e.g. #include <stdio.h>)
  2. Constants (e.g. #define MAX_USERS 10)
  3. Macros (e.g. #define GET_VALUE (data))
  4. Data type definitions (e.g. typedefs)
  5. Prototypes for static functions
  6. Static variables
  7. Function definitions

For the header file:

  1. Include files (e.g. #include <stdio.h>)
  2. Constants (e.g. #define MAX_USERS 10)
  3. Macros (e.g. #define GET_VALUE (data))
  4. Data type definitions (e.g. typedefs)
  5. Prototypes for external functions of the module

See also