Skip to content

Commit 543dffd

Browse files
feat(RevisionBlock): replace dir="v" to vertical attribute
1 parent 598376a commit 543dffd

File tree

6 files changed

+33
-37
lines changed

6 files changed

+33
-37
lines changed

src/components/revision/RevisionBlock.astro

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ import RevisionTags from "./RevisionTags.astro";
33
import { autoRev } from ".";
44
import type { RevisionInfo } from "./types";
55
6-
type LayoutDirection = "h" | "v";
7-
86
interface Props extends RevisionInfo {
97
noborder?: boolean;
10-
dir?: LayoutDirection;
8+
vertical?: boolean;
119
}
1210
1311
const { since, until, noborder } = Astro.props;
14-
const dir = Astro.props.dir ?? "h";
15-
16-
const horizontal = dir === "h";
17-
const vertical = dir === "v";
12+
const vertical = Astro.props.vertical ?? false;
13+
const horizontal = !vertical;
1814
---
1915

2016
<div

src/content/docs/c/library/headers/index.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The interface of C standard library is defined by the following collection of he
2424
</Desc>
2525

2626
<Desc autorevSince="C99">
27-
<RevisionBlock slot="item" noborder since="C99" dir="v">
27+
<RevisionBlock slot="item" noborder since="C99" vertical>
2828
<CHeader name="complex" />
2929
</RevisionBlock>
3030
Complex number arithmetic
@@ -41,7 +41,7 @@ The interface of C standard library is defined by the following collection of he
4141
</Desc>
4242

4343
<Desc autorevSince="C99">
44-
<RevisionBlock slot="item" noborder since="C99" dir="v">
44+
<RevisionBlock slot="item" noborder since="C99" vertical>
4545
<CHeader name="fenv" />
4646
</RevisionBlock>
4747
Floating-point environment
@@ -53,14 +53,14 @@ The interface of C standard library is defined by the following collection of he
5353
</Desc>
5454

5555
<Desc autorevSince="C99">
56-
<RevisionBlock slot="item" noborder since="C99" dir="v">
56+
<RevisionBlock slot="item" noborder since="C99" vertical>
5757
<CHeader name="inttypes" />
5858
</RevisionBlock>
5959
Format conversion of integer types
6060
</Desc>
6161

6262
<Desc autorevSince="C95">
63-
<RevisionBlock slot="item" noborder since="C95" dir="v">
63+
<RevisionBlock slot="item" noborder since="C95" vertical>
6464
<CHeader name="iso646" />
6565
</RevisionBlock>
6666
Alternative operator spellings
@@ -96,7 +96,7 @@ The interface of C standard library is defined by the following collection of he
9696
slot="item"
9797
noborder
9898
since="C11"
99-
dir="v"
99+
vertical
100100
traits={[ { trait: "deprecated", since: "C23" } ]}
101101
>
102102
<CHeader name="stdalign" />
@@ -110,14 +110,14 @@ The interface of C standard library is defined by the following collection of he
110110
</Desc>
111111

112112
<Desc autorevSince="C11">
113-
<RevisionBlock slot="item" noborder since="C11" dir="v">
113+
<RevisionBlock slot="item" noborder since="C11" vertical>
114114
<CHeader name="stdatomic" />
115115
</RevisionBlock>
116116
Atomic operations
117117
</Desc>
118118

119119
<Desc autorevSince="C23">
120-
<RevisionBlock slot="item" noborder since="C23" dir="v">
120+
<RevisionBlock slot="item" noborder since="C23" vertical>
121121
<CHeader name="stdbit" />
122122
</RevisionBlock>
123123
Macros to work with the byte and bit representations of types
@@ -128,7 +128,7 @@ The interface of C standard library is defined by the following collection of he
128128
slot="item"
129129
noborder
130130
since="C99"
131-
dir="v"
131+
vertical
132132
traits={[ { trait: "deprecated", since: "C23" } ]}
133133
>
134134
<CHeader name="stdbool" />
@@ -137,7 +137,7 @@ The interface of C standard library is defined by the following collection of he
137137
</Desc>
138138

139139
<Desc autorevSince="C23">
140-
<RevisionBlock slot="item" noborder since="C23" dir="v">
140+
<RevisionBlock slot="item" noborder since="C23" vertical>
141141
<CHeader name="stdckdint" />
142142
</RevisionBlock>
143143
Macros for performing checked integer arithmetic
@@ -149,7 +149,7 @@ The interface of C standard library is defined by the following collection of he
149149
</Desc>
150150

151151
<Desc autorevSince="C99">
152-
<RevisionBlock slot="item" noborder since="C99" dir="v">
152+
<RevisionBlock slot="item" noborder since="C99" vertical>
153153
<CHeader name="stdint" />
154154
</RevisionBlock>
155155
Fixed-width integer types
@@ -166,7 +166,7 @@ The interface of C standard library is defined by the following collection of he
166166
</Desc>
167167

168168
<Desc autorevSince="C29">
169-
<RevisionBlock slot="item" noborder since="C29" dir="v">
169+
<RevisionBlock slot="item" noborder since="C29" vertical>
170170
<CHeader name="stdmchar" />
171171
</RevisionBlock>
172172
Text transcode
@@ -177,7 +177,7 @@ The interface of C standard library is defined by the following collection of he
177177
slot="item"
178178
noborder
179179
since="C11"
180-
dir="v"
180+
vertical
181181
traits={[ { trait: "deprecated", since: "C23" } ]}
182182
>
183183
<CHeader name="stdnoreturn" />
@@ -191,14 +191,14 @@ The interface of C standard library is defined by the following collection of he
191191
</Desc>
192192

193193
<Desc autorevSince="C99">
194-
<RevisionBlock slot="item" noborder since="C99" dir="v">
194+
<RevisionBlock slot="item" noborder since="C99" vertical>
195195
<CHeader name="tgmath" />
196196
</RevisionBlock>
197197
Type-generic math (macros wrapping <CHeader name="math" /> and <CHeader name="complex" />)
198198
</Desc>
199199

200200
<Desc autorevSince="C11">
201-
<RevisionBlock slot="item" noborder since="C11" dir="v">
201+
<RevisionBlock slot="item" noborder since="C11" vertical>
202202
<CHeader name="threads" />
203203
</RevisionBlock>
204204
Thread library
@@ -210,21 +210,21 @@ The interface of C standard library is defined by the following collection of he
210210
</Desc>
211211

212212
<Desc autorevSince="C11">
213-
<RevisionBlock slot="item" noborder since="C11" dir="v">
213+
<RevisionBlock slot="item" noborder since="C11" vertical>
214214
<CHeader name="uchar" />
215215
</RevisionBlock>
216216
UTF-16 and UTF-32 character utilities
217217
</Desc>
218218

219219
<Desc autorevSince="C95">
220-
<RevisionBlock slot="item" noborder since="C95" dir="v">
220+
<RevisionBlock slot="item" noborder since="C95" vertical>
221221
<CHeader name="wchar" />
222222
</RevisionBlock>
223223
Extended multibyte and wide character utilities
224224
</Desc>
225225

226226
<Desc autorevSince="C95">
227-
<RevisionBlock slot="item" noborder since="C95" dir="v">
227+
<RevisionBlock slot="item" noborder since="C95" vertical>
228228
<CHeader name="wctype" />
229229
</RevisionBlock>
230230
Functions to determine the type contained in wide character data

src/content/docs/c/library/strings/byte/memcpy.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ dst = "\0\0\0\0\0yxyxy", r = 22
161161
<DescList>
162162
<Desc kind="function" autorevSince="C23">
163163
<DescItem slot="item">
164-
<RevisionBlock noborder since="C23" dir="v"><Missing>`memccpy`</Missing></RevisionBlock>
164+
<RevisionBlock noborder since="C23" vertical><Missing>`memccpy`</Missing></RevisionBlock>
165165
</DescItem>
166166
copies one buffer to another, stopping after the specified delimiter
167167
</Desc>
@@ -171,17 +171,17 @@ dst = "\0\0\0\0\0yxyxy", r = 22
171171
<Missing>`memmove`</Missing>
172172
</DescItem>
173173
<DescItem slot="item" autorevSince="C11">
174-
<RevisionBlock noborder since="C11" dir="v"><Missing>`memmove_s`</Missing></RevisionBlock>
174+
<RevisionBlock noborder since="C11" vertical><Missing>`memmove_s`</Missing></RevisionBlock>
175175
</DescItem>
176176
moves one buffer to another
177177
</Desc>
178178
179179
<Desc kind="function" autorevSince="C95">
180180
<DescItem slot="item">
181-
<RevisionBlock noborder since="C95" dir="v"><Missing>`wmemcpy`</Missing></RevisionBlock>
181+
<RevisionBlock noborder since="C95" vertical><Missing>`wmemcpy`</Missing></RevisionBlock>
182182
</DescItem>
183183
<DescItem slot="item" autorevSince="C11">
184-
<RevisionBlock noborder since="C11" dir="v"><Missing>`wmemcpy_s`</Missing></RevisionBlock>
184+
<RevisionBlock noborder since="C11" vertical><Missing>`wmemcpy_s`</Missing></RevisionBlock>
185185
</DescItem>
186186
copies a certain amount of wide characters between two non-overlapping arrays
187187
</Desc>

src/content/docs/cpp/library/utilities/move.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ The contents of the vector are {"Salut", "Salut"}
133133
<DescList>
134134
<Desc kind="function template">
135135
<Fragment slot="item">
136-
<RevisionBlock noborder since="C++11" dir="v"><Missing>`forward`</Missing></RevisionBlock>
136+
<RevisionBlock noborder since="C++11" vertical><Missing>`forward`</Missing></RevisionBlock>
137137
</Fragment>
138138
forwards a function argument and use the type template argument to preserve its value category
139139
</Desc>
140140

141141
<Desc kind="function template">
142142
<Fragment slot="item">
143-
<RevisionBlock noborder since="C++11" dir="v"><Missing>`move_if_noexcept`</Missing></RevisionBlock>
143+
<RevisionBlock noborder since="C++11" vertical><Missing>`move_if_noexcept`</Missing></RevisionBlock>
144144
</Fragment>
145145
converts the argument to an xvalue if the move constructor does not throw
146146
</Desc>
147147

148148
<Desc kind="function template">
149149
<Fragment slot="item">
150-
<RevisionBlock noborder since="C++11" dir="v"><Missing>`move`</Missing></RevisionBlock>
150+
<RevisionBlock noborder since="C++11" vertical><Missing>`move`</Missing></RevisionBlock>
151151
</Fragment>
152152
moves a range of elements to a new location
153153
</Desc>

src/content/docs/development/guide/doc-everything.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ import { RevisionBlock } from "@components/revision";
201201
</Desc>
202202

203203
<Desc autorevSince="C99">
204-
<RevisionBlock slot="item" noborder since="C99" dir="v">
204+
<RevisionBlock slot="item" noborder since="C99" vertical>
205205
<CHeader name="complex" />
206206
</RevisionBlock>
207207
Complex number arithmetic
@@ -222,7 +222,7 @@ import { RevisionBlock } from "@components/revision";
222222
</Desc>
223223

224224
<Desc autorevSince="C99">
225-
<RevisionBlock slot="item" noborder since="C99" dir="v">
225+
<RevisionBlock slot="item" noborder since="C99" vertical>
226226
<CHeader name="complex" />
227227
</RevisionBlock>
228228
Complex number arithmetic
@@ -236,7 +236,7 @@ import { RevisionBlock } from "@components/revision";
236236
</Card>
237237

238238
<Aside type="tip">
239-
We strongly recommend you to specify the `dir="v"` attribute on the `RevisionBlock` component inside a `Decl`. This would render to a more mobile-friendly output.
239+
We strongly recommend you to specify the `vertical` attribute on the `RevisionBlock` component inside a `Decl`. This would render to a more mobile-friendly output.
240240
</Aside>
241241

242242
<Aside type="tip">

src/content/docs/development/guide/revision.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ Some more paragraphs.
138138

139139
### Vertical Layout
140140

141-
By default, `RevisionBlock` has a left-to-right layout: the content sits at the left, and the revision information sits at the right. In addition, you can set the layout direction of `RevisionBlock` to top-to-bottom by setting the `dir` attribute to `v`:
141+
By default, `RevisionBlock` has a left-to-right layout: the content sits at the left, and the revision information sits at the right. In addition, you can set the layout direction of `RevisionBlock` to top-to-bottom by setting the `vertical` attribute to `true`:
142142

143143
```mdx {2}
144144
<RevisionBlock
145-
dir="v"
145+
vertical
146146
since="C++11"
147147
traits={[{ trait: "deprecated", since: "C++20" }]}
148148
removed="C++26"
@@ -154,7 +154,7 @@ By default, `RevisionBlock` has a left-to-right layout: the content sits at the
154154

155155
<Card title="Preview">
156156
<RevisionBlock
157-
dir="v"
157+
vertical
158158
since="C++11"
159159
traits={[{ trait: "deprecated", since: "C++20" }]}
160160
removed="C++26"

0 commit comments

Comments
 (0)