Definition lists
Definition lists can be used to document frequently asked questions (FAQ) with answers, problems with solutions, a reference of commands, options, methods, API endpoints and parameters, and UI elements with their descriptions.
To create definition lists, in Markdown specify the term on the first line, then on the next line, type a colon followed by a space and the definition.
In semantic markup, use <deflist>
tag.
- Second Term
This is the definition of the second term.
- First Term
This is the definition of the first term.
The deflist has the following attributes:
- style=[full|wide|medium|narrow|compact]
Specify the definition list layout.
Use the default style to document FAQs or troubleshooting guides, or whenever the definition list item titles are long.
- Can I use definition lists to document frequently asked questions (FAQs)?
Sure, you can.
- somePeculiarMethodWithReallyLongName()
This name probably won't fit if you use any other style for your definition list.
Render the definition list item's title and the corresponding description side-by-side at a 1:1 ratio. This can be a good choice for a reference of REST API endpoints.
- /customers
Get customers.
- /customers/{customerId}
Get customer by ID.
- /customers/{customerId}/accounts
Get the accounts of the specified customer.
Render the definition list item's title and the corresponding description side-by-side at a 1:2 ratio. This can be a good choice for a reference of methods or functions.
- getFoo()
Returns the current value of
Foo
.- setBar(String)
Assigns the provided string to
Bar
.- multiply(int, int)
Returns the product of two integers.
Render the definition list item's title and the corresponding description side-by-side at a 2:7 ratio. This can be a good choice for a reference of command-line options.
- --output
Specify where to save the output.
Print something
- --version
Show version.
Render the definition list item's title and the corresponding description side-by-side at a 1:8 ratio. This can be a good choice for a reference of abbreviations or single-letter options.
- --o
Specify where to save the output.
- --p
Print something.
- --v
Show version.
- collapsible=[true|false]
Add the
collapsible="true"
attribute to make a definition list collapsible. By default, a collapsible list renders with all elements in the collapsed state, and the user can click each element to expand it.- default-state=[collapsed|expanded|inherited]
If collapsible is set
true
, specify whether the default state is collapsed or expanded.- sorted=[asc|desc]
None is used by default. Specify the sorting order, a list will be sorted alphabetically by definition titles.
- id
Specify a unique identifier to use as a link anchor and generate a meaningful URL for this definition list. You can reference and reuse any element that has an ID.
- filter
Define a set of custom filters for conditionally including this definition list.
- instance
Define a set of instances for conditionally filtering this definition list.
- switcher-key
Make this definition list switchable depending on the selected key.
The definition has the following attributes:
- title
Define the title or use a
title
tag inside the definition instead.- collapsible=[true|false]
Add the
collapsible="true"
attribute to make a definition list collapsible. By default, a collapsible list renders with all elements in the collapsed state, and the user can click each element to expand it.- default-state=[collapsed|expanded|inherited]
If collapsible is set
true
, specify whether the default state is collapsed, expanded, or inherited from the parent<deflist>
tag.- id
Specify a unique identifier to use as a link anchor and generate a meaningful URL for this definition item. You can reference and reuse any element that has an ID.
- filter
Define a set of custom filters for conditionally including this definition item.
- instance
Define a set of instances for conditionally filtering this definition item.
- switcher-key
Make this definition item switchable depending on the selected key.