Implicit rules
==============

[[Parent]]: understanding.txt

This section describes the rules that are used to deduce descriptions 
and parents for documents for which they have not been explicitly
specified.

Unspecified descriptions
------------------------

Remark uses the following rules to deduce a description for a document
without an explicitly specified description.

 * Documents which reside in the same directory and have the same 
 filename without the extension share the same description.
 
 * If the above does not apply, then a document is given (if exists) 
 the description of the document which:
 	1. is in the same directory
 	2. has a description
 	3. without the extension has a filename which is the longest prefix 
 	of the name of the to-be-described file.

* If no description can be found, a warning is emitted to inform
about the missing description.

Unspecified parents
-------------------

Remark uses the following rules to deduce a parent for
a document without an explicitly specified parent. 

 * If the document's type is RemarkPage, the orphan document is assigned
 as the parent.

 * Otherwise, among the documents which have a parent, a document with the longest 
 prefix is searched from the same directory (excluding the document itself). 

	 * If no such document can be found, the orphan document is assigned as the parent.

	 * If there is a unique such document, that document is assigned as the parent.

	 * If there are multiple such documents, priority is given to files with the 
	 RemarkPage document type. If there is now a unique such document, that document
	 is assigned as the parent.
 
	 * Otherwise one of the files is picked arbitrarily, and a warning is emitted 
	 to inform about the ambiguity.
 

 


