Difference between revisions of "Project structure"

From Wiki
Jump to navigation Jump to search
(Corrected spelling, i.e. "ore" to "or".)
(corrected and clarified project/product according to Hans' mail from 2006-04-09)
Line 1: Line 1:
< [[The ConTeXt Way]], [[Structurals]]
+
< [[The ConTeXt Way]] | [[Structurals]] >
  
ConTeXt knows no document classes (as LaTeX does). You can define your layout yourself. If you use the same layout for several projects, save it as an '''environment''' file.
+
ConTeXt knows no document classes (as LaTeX does). You can define your [[Layout|layout]] yourself. If you use the same layout for several products, save it as an '''environment''' file.
  
 
How to split up a large project, say a book, in several handy parts? – Use ConTeXt's project management facilities.
 
How to split up a large project, say a book, in several handy parts? – Use ConTeXt's project management facilities.
  
* a '''project''' contains one or more '''products'''
+
* a '''project''' links one or more '''products''' to their environment
 
* a '''product''' contains several '''component'''s
 
* a '''product''' contains several '''component'''s
 
* an '''environment''' defines the common layout (etc.) of a project
 
* an '''environment''' defines the common layout (etc.) of a project
  
The environment could also contain different versions ([[Modes]]) of the layout, e.g. print and screen (like Pragma's manuals) or final and correction etc.
+
The environment could also contain [[Modes|different versions]] of the layout, e.g. print and screen (like Pragma's manuals) or final and correction etc.
  
 
Example 1: Magazine
 
Example 1: Magazine
Line 17: Line 17:
  
 
Example 2: Book
 
Example 2: Book
* project: book
+
* project: a series of books
* product: part of the book
+
* product: one book
* component: chapter
+
* component: part or chapter
  
 
[[Image:project-structure.png]]
 
[[Image:project-structure.png]]
  
If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the settings of the project's environment are used.
+
If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the environment file of the project is used.
[[User:Hraban|Hraban]] uses the following naming conventions
+
 
 +
[[User:Hraban|Hraban]] uses and suggests the following naming conventions
 
* project_foo
 
* project_foo
 
* prd_foo
 
* prd_foo
Line 81: Line 82:
 
</texcode>
 
</texcode>
  
There's a Perl script <tt>makeproject.pl</tt> at Hraban's site [http://www.ramm.ch/fiee/texnique/?menu=0-1-3&lang=en ''fiëé teXnique''] to help creating the files (.ini files can be used for initial content).
+
There's a Perl script <tt>makeproject.pl</tt> at Hraban's site [http://www.ramm.ch/fiee/texnique/?menu=0-1-3&lang=en ''fiëé teXnique''] to help creating the files (.ini files can be used for initial content). This functionality would be nice to be integrated in any editor supporting ConTeXt...

Revision as of 12:19, 9 April 2006

< The ConTeXt Way | Structurals >

ConTeXt knows no document classes (as LaTeX does). You can define your layout yourself. If you use the same layout for several products, save it as an environment file.

How to split up a large project, say a book, in several handy parts? – Use ConTeXt's project management facilities.

  • a project links one or more products to their environment
  • a product contains several components
  • an environment defines the common layout (etc.) of a project

The environment could also contain different versions of the layout, e.g. print and screen (like Pragma's manuals) or final and correction etc.

Example 1: Magazine

  • project: magazine
  • product: one volume of the magazine
  • component: an single article

Example 2: Book

  • project: a series of books
  • product: one book
  • component: part or chapter

File:project-structure.png

If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the environment file of the project is used.

Hraban uses and suggests the following naming conventions

  • project_foo
  • prd_foo
  • c_foo
  • env_foo

Project

\startproject project_mymag
\environment env_mymag % only mentioned here!

\product prd_year2004-01
\product prd_year2004-02
\product prd_year2004-03
\product prd_year2004-04

\completetableofcontents

\stopproject

Environment

\startenvironment env_mymag

\setuplayout[...]
% all setups...

\stopenvironment

Product

\startproduct prd_year2004-01
\project project_mymag

\component c_editorial
\component c_article01
\component c_article_by_me
% ...

\stopproduct

Component

\startcomponent c_editorial
\product prd_year2004-01 % but you can use it in other products anyway
\project project_mymag

\title{Editorial}

Dear reader...

\stopcomponent

There's a Perl script makeproject.pl at Hraban's site fiëé teXnique to help creating the files (.ini files can be used for initial content). This functionality would be nice to be integrated in any editor supporting ConTeXt...