-
-
Notifications
You must be signed in to change notification settings - Fork 273
Docs release 4 : Rebuild the Spec docs #955
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ae17022
Rebase with main (#821)
benjagm c384bf7
Merge branch 'web-feat-diataxis' of https://github.com/json-schema-or…
benjagm e826579
Feat: Adding next-prev component (#807)
DhairyaMajmudar 3773f62
New spec page structure- (#823)
kwennB a621c25
fix merge issues
benjagm 9640ee9
fix merge issues
benjagm b5c39cc
Fix the usage of feedback component
benjagm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
import Link from 'next/link'; | ||
|
||
/* | ||
To use this component: | ||
1) Add prev and next metadata to the markdown page following this format: | ||
|
||
--- | ||
title: Creating your first schema | ||
section: docs | ||
prev: | ||
label: prev | ||
url: '#1' | ||
next: | ||
label: Miscellaneous examples | ||
url: '#2' | ||
--- | ||
|
||
2) Add the component to the typescript page: | ||
|
||
import NextPrevButton from '~/components/NextPrevButton'; | ||
|
||
3) Add the component to the body of the page: | ||
|
||
<NextPrevButton prevLabel={frontmatter.prev.label} prevURL={frontmatter.prev.url} nextLabel={frontmatter.next.label} nextURL={frontmatter.next.url} /> | ||
*/ | ||
|
||
export default function NextPrevButton({ | ||
prevLabel, | ||
prevURL, | ||
nextLabel, | ||
nextURL, | ||
}: any) { | ||
return ( | ||
<div className='mb-4 flex flex-row gap-4'> | ||
<div className='h-auto w-1/2'> | ||
<div | ||
className='cursor-pointer rounded border border-gray-200 p-4 text-center shadow-md transition-all duration-300 ease-in-out hover:border-gray-300 hover:shadow-lg dark:shadow-xl dark:hover:shadow-2xl dark:drop-shadow-lg | ||
lg:text-left' | ||
> | ||
<Link href={prevURL}> | ||
<div className='text-primary dark:text-slate-300 flex flex-row gap-5 text-[18px]'> | ||
<Image | ||
src={'/icons/arrow.svg'} | ||
height={10} | ||
width={10} | ||
alt='prev icon' | ||
className='rotate-180 w-5 ' | ||
/> | ||
<div className='my-auto inline font-bold uppercase '>Go Back</div> | ||
</div> | ||
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'> | ||
{prevLabel} | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
|
||
<div className='h-auto w-1/2'> | ||
<div className='h-full cursor-pointer rounded border border-gray-200 p-4 text-center shadow-md transition-all duration-300 ease-in-out hover:border-gray-300 hover:shadow-lg dark:shadow-xl dark:drop-shadow-lg dark:hover:shadow-2xl lg:text-right'> | ||
<Link href={nextURL}> | ||
<div className='text-primary dark:text-slate-300 flex flex-row-reverse gap-5 text-[18px]'> | ||
<Image | ||
src={'/icons/arrow.svg'} | ||
height={10} | ||
width={10} | ||
alt='next icon ' | ||
className='w-5' | ||
/> | ||
<div className='my-auto inline font-bold uppercase '>Up Next</div> | ||
</div> | ||
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'> | ||
{nextLabel} | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.