A convention is a sort of preference setting which changes the normal way a web is woven, tangled, or simply read in. There are relatively few of these, and the generic values are usually sensible, so most webs will never need to change them.

The currently applicable conventions can be seen using inweb inspect -conventions:

$ inweb inspect -conventions smorgasbord
web "Sorting Smorgasbord" (Python program in MarkdownCode notation): 2 sections : 10 paragraphs : 114 lines
(generic)  paragraph numbers are visible
(generic)  namespaces are unenforced
(generic)  sections are not numbered sequentially

...and so forth. For example, paragraph numbers are visible is a convention. (generic) means that it applies because this generically applies to every web, unless Inweb is given any instructions to the contrary.

Conventions can be specified on the contents page of a web. For example, we could rewrite Contents.inweb for smorgasbord to read:

Title: Sorting Smorgasbord
Author: Various Artists
Notation: MarkdownCode
Language: Python

Sections
	Counting Sort
	Quick Sort

Conventions {
	sections are numbered sequentially
}

Note that conventions appear after the contents rundown, and in braces. (That's because this is technically a declaration: see Resources and Declarations.) We then see:

$ inweb inspect -conventions smorgasbord
web "Sorting Smorgasbord" (Python program in MarkdownCode notation): 2 sections : 10 paragraphs : 114 lines
(generic)  paragraph numbers are visible
(generic)  namespaces are unenforced
(web)      sections are numbered sequentially

...and so on. Note that (web), showing that the web makes the convention this time. (For the effect this change actually has, see below.)

Conventions can be made, in fact, in five ways:

In this list, later sources beat earlier ones. (inweb inspect -conventions -fuller shows exactly how this trail is resolved.)

So, for example, if you have many unrelated programs which you want to set some common preferences for, or if you want to set preferences for a single-file web which has no contents page, the best way is probably to create a standalone preferences file — called, say, prefs.inweb. This could for example read:

Conventions {
	namespaces are enforced
	holon names are written between ▶️ and ◀️
}

Whereupon inweb weave program.c.md -using prefs.inweb would have these conventions applied, but inweb weave program.c.md would not.

On the other hand, if you want to apply some conventions across a set of programs which are closely related, it's probably better to create a colony for them (see Colonies) and then include conventions at the foot of the colony file.

Conventions changing how webs are read in

Conventions affecting weaving

Conventions affecting tangling

Conventions affecting tangling of C and related languages

See Special C Features for a proper explanation of these. Note that these conventions take effect only for languages declared as being "C-like"; using them on, say, a Python web would do nothing.