Skip to content

Commit 3965d16

Browse files
committed
Display all variations of format
It's useful to be able to see all the possible values of format, for reference, rather than just a few examples.
1 parent c279757 commit 3965d16

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

dotcom-rendering/src/devServer/docs/article.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import {
2+
ArticleDesign,
3+
ArticleDisplay,
4+
ArticleSpecial,
5+
Pillar,
6+
} from '../../lib/articleFormat';
17
import { Available } from './available';
28
import { descriptionLinks } from './styles';
39

@@ -89,37 +95,41 @@ const Examples = () => (
8995
</>
9096
);
9197

98+
const formatValues = (a: object): string =>
99+
Object.values(a)
100+
.filter((v) => typeof v !== 'number')
101+
.join(', ');
102+
92103
const Format = () => (
93104
<>
94105
<h2>Format</h2>
95106
<p>
96107
The <code>ArticleFormat</code>, sometimes known as just "Format",
97108
determines the kind of article being rendered. It influences what
98-
content and features the article will contain, and what the design
99-
will look like. It's broken down into three dimensions:
109+
content and features the article will contain, and what the
110+
ArticleDesign will look like. It's broken down into three
111+
dimensions:
100112
</p>
101113
<dl>
102114
<dt>Design</dt>
103115
<dd>
104116
Primarily influences the content, structure and features of an
105117
article. It's the most important of the three, and is often used
106-
as a shorthand to describe the "kind" of article. Examples
107-
include <code>Liveblog</code>, <code>Feature</code> and{' '}
108-
<code>Gallery</code>.
118+
as a shorthand to describe the "kind" of article. The values
119+
are: {formatValues(ArticleDesign)}.
109120
</dd>
110121
<dt>Display</dt>
111122
<dd>
112-
Primarily influences the layout of an article. Examples include{' '}
113-
<code>Immersive</code>, <code>Showcase</code> and{' '}
114-
<code>NumberedList</code>.
123+
Primarily influences the layout of an article. The values are:{' '}
124+
{formatValues(ArticleDisplay)}.
115125
</dd>
116126
<dt>Theme</dt>
117127
<dd>
118128
Primarily influences the fonts and colours of an article. It can
119129
can be thought of as a superset of "pillar", i.e. all the
120130
pillars are considered themes, but there are some additional
121-
themes that are not pillars. Examples include <code>News</code>,{' '}
122-
<code>Sport</code> and <code>Labs</code>.
131+
themes that are not pillars. The values are:{' '}
132+
{formatValues(Pillar)}, {formatValues(ArticleSpecial)}.
123133
</dd>
124134
</dl>
125135
<p>

0 commit comments

Comments
 (0)