Skip to content

Commit bbc07e6

Browse files
committed
fixup!
1 parent 30e06b7 commit bbc07e6

8 files changed

Lines changed: 4 additions & 38 deletions

File tree

src/generators/jsx-ast/__tests__/generate.test.mjs

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,32 +67,6 @@ describe('jsx-ast generate', () => {
6767
assert.equal('sectionEntries' in content, false);
6868
});
6969

70-
it('omits the core index entry and appends enabled synthetic pages', async () => {
71-
await setConfig({});
72-
73-
const seenItems = [];
74-
const results = await collect(
75-
generate(
76-
[createEntry('index', 'Index'), createEntry('fs', 'File system')],
77-
createWorker(seenItems)
78-
)
79-
);
80-
81-
assert.deepEqual(
82-
seenItems.map(({ head }) => head.api),
83-
['fs']
84-
);
85-
assert.deepEqual(
86-
results.map(({ data }) => data.api),
87-
['fs', 'all', 'index', '404']
88-
);
89-
90-
for (const entry of results.slice(1)) {
91-
assert.equal(entry.data.synthetic, true);
92-
assert.equal(entry.data.hideViewAs, true);
93-
}
94-
});
95-
9670
it('respects jsx-ast synthetic page flags', async () => {
9771
await setConfig({});
9872

@@ -111,11 +85,11 @@ describe('jsx-ast generate', () => {
11185

11286
assert.deepEqual(
11387
seenItems.map(({ head }) => head.api),
114-
['fs']
88+
['index', 'fs']
11589
);
11690
assert.deepEqual(
11791
results.map(({ data }) => data.api),
118-
['fs']
92+
['index', 'fs']
11993
);
12094
});
12195
});

src/generators/jsx-ast/utils/synthetic/__tests__/404.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ describe('buildNotFoundPage', () => {
1212
assert.equal(head.basename, '404');
1313
assert.equal(head.heading.data.name, 'Page Not Found');
1414
assert.equal(head.synthetic, true);
15-
assert.equal(head.hideViewAs, true);
1615
});
1716

1817
it('produces a single synthetic entry with a not-found paragraph', () => {

src/generators/jsx-ast/utils/synthetic/__tests__/all.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ describe('buildAllPage', () => {
1212
assert.equal(head.basename, 'all');
1313
assert.equal(head.heading.data.name, 'All');
1414
assert.equal(head.synthetic, true);
15-
assert.equal(head.hideViewAs, true);
1615
});
1716

1817
it('forwards the input entries as the page entries', () => {

src/generators/jsx-ast/utils/synthetic/__tests__/index.test.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('buildIndexPage', () => {
2929
assert.equal(head.basename, 'index');
3030
assert.equal(head.heading.data.name, 'Index');
3131
assert.equal(head.synthetic, true);
32-
assert.equal(head.hideViewAs, true);
3332
});
3433
});
3534

src/generators/jsx-ast/utils/synthetic/__tests__/synthetic.test.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ describe('createSyntheticHead', () => {
1616
const head = createSyntheticHead('index', 'Index');
1717

1818
assert.equal(head.synthetic, true);
19-
assert.equal(head.hideViewAs, true);
2019
});
2120

2221
it('produces a depth-1 heading whose data is consistent with the name', () => {
@@ -66,6 +65,5 @@ describe('wrapAsEntry', () => {
6665
assert.equal(entry.path, head.path);
6766
assert.equal(entry.basename, head.basename);
6867
assert.equal(entry.synthetic, true);
69-
assert.equal(entry.hideViewAs, true);
7068
});
7169
});

src/generators/jsx-ast/utils/synthetic/synthetic.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const createSyntheticHead = (api, name) => ({
1515
path: `/${api}`,
1616
basename: api,
1717
synthetic: true,
18-
hideViewAs: true,
1918
heading: {
2019
type: 'heading',
2120
depth: 1,

src/generators/metadata/types.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ export interface MetadataEntry extends YAMLProperties {
128128
basename: string;
129129
/** Whether this page was generated by a downstream generator. */
130130
synthetic?: boolean;
131-
/** Whether the default web MetaBar should omit alternate-format links. */
132-
hideViewAs?: boolean;
133131
/** Processed heading with metadata */
134132
heading: HeadingNode;
135133
/** Stability classification information */

src/generators/web/ui/components/MetaBar/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default ({ metadata, headings = [], readingTime }) => {
7171
items={{
7272
'Reading Time': readingTime,
7373
'Added In': metadata.added ?? metadata.introduced_in,
74-
'View As': !metadata.hideViewAs && (
74+
'View As': !metadata.synthetic && (
7575
<ol>
7676
{viewAs.map(([viewTitle, path]) => {
7777
const Icon = iconMap[viewTitle];
@@ -88,7 +88,7 @@ export default ({ metadata, headings = [], readingTime }) => {
8888
})}
8989
</ol>
9090
),
91-
Contribute: (
91+
Contribute: !metadata.synthetic && (
9292
<>
9393
<GitHubIcon className="fill-neutral-700 dark:fill-neutral-100" />
9494

0 commit comments

Comments
 (0)