Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New spec page structure- #823

Merged
merged 49 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8946f64
Spec draft fixes
kwennB Jul 17, 2024
37ca719
Merge branch 'json-schema-org:main' into new-spec-structure
kwennB Jul 17, 2024
4292510
Updating draft sections
kwennB Jul 18, 2024
90410bf
metadata syntax fixes
DhairyaMajmudar Jul 18, 2024
5dba363
Merge pull request #1 from DhairyaMajmudar/new-spec-structure
kwennB Jul 18, 2024
49c5145
modified spec docs
kwennB Jul 19, 2024
902d0ae
adding table component
DhairyaMajmudar Jul 22, 2024
0e87086
adding title
DhairyaMajmudar Jul 22, 2024
b207f98
Merge pull request #2 from DhairyaMajmudar/new-spec-structure
kwennB Jul 22, 2024
bfcea46
Spec draft fixes-2
kwennB Jul 22, 2024
52e562e
Merge branch 'new-spec-structure' of https://github.com/kwennB/websit…
kwennB Jul 22, 2024
bcd01d5
Spec draft fixes-3
kwennB Jul 22, 2024
e7730dc
doc-table
DhairyaMajmudar Jul 23, 2024
1d5f9df
fixing draft7
DhairyaMajmudar Jul 23, 2024
4df579f
draft7 fix
DhairyaMajmudar Jul 23, 2024
d94018b
converting in links
DhairyaMajmudar Jul 23, 2024
b144b8f
Merge pull request #3 from DhairyaMajmudar/new-spec-structure
kwennB Jul 23, 2024
6251444
Merge branch 'json-schema-org:main' into new-spec-structure
kwennB Jul 23, 2024
68ff0c7
adding multiple files
DhairyaMajmudar Jul 23, 2024
d75b860
Merge pull request #4 from DhairyaMajmudar/new-spec-structure
kwennB Jul 23, 2024
58cc4cf
Spec draft fixes-4
kwennB Jul 23, 2024
653129d
Merge branch 'new-spec-structure' of https://github.com/kwennB/websit…
kwennB Jul 23, 2024
0e08ca7
Spec draft fixes-5
kwennB Jul 23, 2024
15ff1ad
Spec draft fixes-6
kwennB Jul 23, 2024
20ca8e7
Merge branch 'main' of https://github.com/json-schema-org/website int…
DhairyaMajmudar Jul 23, 2024
c3176f2
Merge branch 'new-spec-structure' of https://github.com/kwennB/websit…
DhairyaMajmudar Jul 24, 2024
ca9779c
resolving merge conflicts
DhairyaMajmudar Jul 24, 2024
5f86cf3
Merge pull request #5 from DhairyaMajmudar/new-spec-structure
kwennB Jul 25, 2024
b1fc371
Modified spec page
kwennB Jul 25, 2024
1465e80
Modified json hyper-schema page
kwennB Jul 25, 2024
09ac557
Merge branch 'json-schema-org:web-feat-diataxis' into web-feat-diataxis
kwennB Aug 5, 2024
82466c7
Resolved feedbacks
kwennB Aug 5, 2024
3ae4cc9
Merge branch 'web-feat-diataxis' of https://github.com/kwennB/website…
kwennB Aug 5, 2024
e87f7cc
Update pages/draft-06/json-schema-release-notes.md
kwennB Aug 19, 2024
c177a50
Update pages/draft/2019-09/release-notes.md
kwennB Aug 19, 2024
aed87d7
Update pages/draft-07/json-schema-release-notes.md
kwennB Aug 19, 2024
5775366
Update pages/migration/index.md
kwennB Aug 19, 2024
bdca8df
Update pages/draft-07/index.md
kwennB Aug 19, 2024
2ce491e
Update pages/migration/index.page.tsx
kwennB Aug 19, 2024
48d999b
Update components/Sidebar.tsx
kwennB Aug 19, 2024
45d38c6
Update pages/release-notes/index.page.tsx
kwennB Aug 19, 2024
cd1ea3a
Update pages/release-notes/index.md
kwennB Aug 19, 2024
aed478c
Update pages/draft-06/index.md
kwennB Aug 19, 2024
783d1d0
Update pages/draft-05/index.md
kwennB Aug 19, 2024
eee932a
modified meta-schema and specification links for all drafts
kwennB Aug 20, 2024
f6212d0
Multiple changes
benjagm Aug 26, 2024
2b9cb35
Updated JSON Hyperschema introductory text
kwennB Aug 26, 2024
9b6779b
updated URL redirects
kwennB Sep 13, 2024
4954a25
Fix date formats, redirects and broken links
benjagm Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions components/DocTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from 'react';
import Link from 'next/link';

const DocTable = ({ frontmatter }: any) => {
return (
<>
<div className='max-w-full mx-auto overflow-auto'>
<table className='table-auto border-collapse w-full bg-slate-200 dark:bg-slate-900 text-slate-700 dark:text-slate-300'>
<tbody>
<tr className='dark:hover:bg-slate-950 hover:bg-slate-300'>
<td className='border border-slate-400 dark:border-slate-500 p-2 text-center font-semibold'>
Specification
</td>
<td className='border border-slate-400 dark:border-slate-500 p-2'>
<Link
href={frontmatter.Specification}
className='text-linkBlue'
target='_blank'
>
{' '}
{frontmatter.Specification}
</Link>
</td>
</tr>
<tr className='dark:hover:bg-slate-950 hover:bg-slate-300'>
<td className='border border-slate-400 dark:border-slate-500 p-2 text-center font-semibold'>
Published
</td>
<td className='border border-slate-400 dark:border-slate-500 p-2'>
{frontmatter.Published}
</td>
</tr>
<tr className='dark:hover:bg-slate-950 hover:bg-slate-300 '>
<td className='border border-slate-400 dark:border-slate-500 p-2 text-center font-semibold'>
Authors
</td>
<td className='border border-slate-400 dark:border-slate-500 p-2'>
{frontmatter.authors.map((author: string, index: number) => {
return <div key={index}>{author}</div>;
})}
</td>
</tr>
<tr className='dark:hover:bg-slate-950 hover:bg-slate-300'>
<td className='border border-slate-400 dark:border-slate-500 p-2 text-center font-semibold'>
Metaschema
</td>
<td className='border border-slate-400 dark:border-slate-500 p-2 '>
<Link
href={frontmatter.Metaschema}
className='text-linkBlue'
target='_blank'
>
{frontmatter.Metaschema}
</Link>
</td>
</tr>
</tbody>
</table>
</div>
</>
);
};

export default DocTable;
69 changes: 28 additions & 41 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,17 @@ const getReferencePath = [
'/implementers/interfaces',
];
const getSpecificationPath = [
'/draft/2020-12/release-notes',
'/draft/2019-09/release-notes',
'/draft-07/json-schema-release-notes',
'/draft-06/json-schema-release-notes',
'/draft-05/readme',
'/draft-07/json-hyper-schema-release-notes',
'/draft-06/json-hyper-schema-release-notes',
'/draft/2020-12',
'/draft/2019-09',
'/draft-07',
'/draft-06',
'/draft-05',
'/specification-links',
'/specification/migration',
'/specification/release-notes',
'/specification/json-hyper-schema',
'/specification',
'/specification-links',
];

export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
Expand Down Expand Up @@ -660,54 +662,39 @@ export const DocsNav = ({
id='specification'
>
<DocLink uri='/specification' label='Overview' setOpen={setOpen} />

<SegmentSubtitle label='Versions' />
<div className='pl-4 pb-1 pt-1'>
<DocLink uri='/draft/2020-12' label='2020-12' setOpen={setOpen} />

<DocLink uri='/draft/2019-09' label='2019-09' setOpen={setOpen} />
<DocLink uri='/draft-07' label='draft-07' setOpen={setOpen} />
<DocLink uri='/draft-06' label='draft-06' setOpen={setOpen} />
<DocLink uri='/draft-05' label='draft-05' setOpen={setOpen} />
</div>

<DocLink
uri='/specification-links'
label='Specification Links'
setOpen={setOpen}
/>

<DocLink
uri='/draft/2020-12/release-notes'
label='2020-12 notes'
setOpen={setOpen}
/>
<DocLink
uri='/draft/2019-09/release-notes'
label='2019-09 notes'
setOpen={setOpen}
/>
<DocLink
uri='/draft-07/json-schema-release-notes'
label='draft-07 notes'
uri='/specification/migration'
label='Migration'
setOpen={setOpen}
/>
<DocLink
uri='/draft-06/json-schema-release-notes'
label='draft-06 notes'
uri='/specification/release-notes'
label='Release Notes'
setOpen={setOpen}
/>

<DocLink
uri='/draft-05/readme'
label='draft-05 notes'
uri='/specification/json-hyper-schema'
label='JSON Hyper-Schema'
setOpen={setOpen}
/>
<SegmentSubtitle label='JSON Hyper-Schema' />
<div className='pl-4 pb-1 pt-1'>
<DocLink
uri='/draft/2019-09/release-notes#hyper-schema-vocabulary'
label='2019-09 notes'
setOpen={setOpen}
/>
<DocLink
uri='/draft-07/json-hyper-schema-release-notes'
label='draft-07 notes'
setOpen={setOpen}
/>
<DocLink
uri='/draft-06/json-hyper-schema-release-notes'
label='draft-06 notes'
setOpen={setOpen}
/>
</div>
</div>
</div>
</div>
Expand Down
38 changes: 0 additions & 38 deletions pages/draft-05/[slug].page.tsx

This file was deleted.

16 changes: 16 additions & 0 deletions pages/draft-05/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: 'Draft-05'
Published: '13 October 2016'
type: docs
authors: ['Austin Wright']
Metaschema: 'https://json-schema.org/draft-04/schema'
Specification: 'https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf'
---

### Draft-05 Documents

- Core: [draft-wright-json-schema-00](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf#appendix-B))
- Validation: [draft-wright-json-schema-validation-00](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-validation-00.pdf#appendix-B))
- Hyper-Schema: [draft-wright-json-schema-hyperschema-00](https://json-schema.org/draft-05/draft-wright-json-schema-hyperschema-00.pdf) ([changes](https://json-schema.org/draft-05/draft-wright-json-schema-hyperschema-00.pdf#appendix-B))
- Draft 5 was primarily a cleanup of Draft 4 and continued to use the Draft 4 meta-schemas.
- Published: 13-October-2016
46 changes: 46 additions & 0 deletions pages/draft-05/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import { getLayout } from '~/components/Sidebar';
import fs from 'fs';
import matter from 'gray-matter';
import StyledMarkdown from '~/components/StyledMarkdown';
import { SectionContext } from '~/context';
import DocTable from '~/components/DocTable';
import { Headline1 } from '~/components/Headlines';
import { DocsHelp } from '~/components/DocsHelp';

export async function getStaticProps() {
const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8');
const main = fs.readFileSync('pages/draft-05/release-notes.md', 'utf-8');
const { content: indexContent, data: indexData } = matter(index);
const { content: bodyContent } = matter(main);

const frontmatter = { ...indexData };
return {
props: {
blocks: {
index: indexContent,
body: bodyContent,
},
frontmatter,
},
};
}

export default function ImplementationsPages({
blocks,
frontmatter,
}: {
blocks: any;
frontmatter: any;
}) {
return (
<SectionContext.Provider value={null}>
<Headline1>{frontmatter.title}</Headline1>
<DocTable frontmatter={frontmatter} />
<StyledMarkdown markdown={blocks.index} />
<StyledMarkdown markdown={blocks.body} />
<DocsHelp />
</SectionContext.Provider>
);
}
ImplementationsPages.getLayout = getLayout;
9 changes: 3 additions & 6 deletions pages/draft-05/readme.md → pages/draft-05/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
title: Explanation for lack of draft-05 meta-schemas
section: docs
---
### Explanation for lack of draft-05 meta-schemas

“Draft-05” in the sequential meta-schema numbering would have referred to the draft-wright-jsonschema*-00 specifications.
“Draft-05” in the sequential meta-schema numbering would have referred to the draft-wright-jsonschema\*-00 specifications.

These specifications were intended as modernized and tidied versions of the specifications referenced by the “Draft-04” meta-schemas, so those draft-04 meta-schemas should continue to be used.

“Draft-06” meta-schemas will be published for the next set of specifications.
“Draft-06” meta-schemas will be published for the next set of specifications.
39 changes: 0 additions & 39 deletions pages/draft-06/[slug].page.tsx

This file was deleted.

15 changes: 15 additions & 0 deletions pages/draft-06/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: 'Draft-06'
Published: '21 April 2017'
type: docs
authors: ['Austin Wright', 'Henry Andrews']
Metaschema: 'https://json-schema.org/draft-06/schema'
Specification: 'https://json-schema.org/draft-06/draft-wright-json-schema-01.html'
---

### Draft-06 Documents

- Validation: [draft-wright-json-schema-validation-01](https://json-scheclsma.org/draft-06/draft-wright-json-schema-validation-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-validation-01.html#rfc.appendix.B)) ([schema migration FAQ](https://json-schema.org/draft-06/json-schema-release-notes))
- Hyper-Schema: [draft-wright-json-schema-hyperschema-01](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html) ([changes](https://json-schema.org/draft-06/draft-wright-json-schema-hyperschema-01.html#rfc.appendix.B)) ([hyper-schema migration FAQ](https://json-schema.org/draft-06/json-hyper-schema-release-notes))
- [JSON Schema meta-schema](https://json-schema.org/draft-06/schema)
- [JSON Hyper-Schema meta-schema](https://json-schema.org/draft-06/hyper-schema)
61 changes: 61 additions & 0 deletions pages/draft-06/index.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';
import { getLayout } from '~/components/Sidebar';
import fs from 'fs';
import matter from 'gray-matter';
import StyledMarkdown from '~/components/StyledMarkdown';
import { SectionContext } from '~/context';
import DocTable from '~/components/DocTable';
import { Headline1 } from '~/components/Headlines';
import { DocsHelp } from '~/components/DocsHelp';

export async function getStaticProps() {
const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8');
const main = fs.readFileSync(
'pages/draft-06/json-schema-release-notes.md',
'utf-8',
);
const hyperSchema = fs.readFileSync(
'pages/draft-06/json-hyper-schema-release-notes.md',
'utf-8',
);
const readme = fs.readFileSync('pages/draft-06/readme.md', 'utf-8');

const { content: indexContent, data: indexData } = matter(index);
const { content: bodyContent } = matter(main);
const { content: hyperSchemaContent } = matter(hyperSchema);
const { content: readmeContent } = matter(readme);

const frontmatter = { ...indexData };
return {
props: {
blocks: {
index: indexContent,
body: bodyContent,
hyperSchema: hyperSchemaContent,
readme: readmeContent,
},
frontmatter,
},
};
}

export default function ImplementationsPages({
blocks,
frontmatter,
}: {
blocks: any;
frontmatter: any;
}) {
return (
<SectionContext.Provider value={null}>
<Headline1>{frontmatter.title}</Headline1>
<DocTable frontmatter={frontmatter} />
<StyledMarkdown markdown={blocks.index} />
<StyledMarkdown markdown={blocks.body} />
<StyledMarkdown markdown={blocks.hyperSchema} />
<StyledMarkdown markdown={blocks.readme} />
<DocsHelp />
</SectionContext.Provider>
);
}
ImplementationsPages.getLayout = getLayout;
Loading