Skip to content

Commit

Permalink
Update to Nickel v1.2.0 (#539)
Browse files Browse the repository at this point in the history
* Update to Nickel v1.2.0

* types -> type
  • Loading branch information
yannham authored Sep 14, 2023
1 parent c29c88b commit cda06a6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
96 changes: 48 additions & 48 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/pages/stdlib/{StdlibSection.slug}.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Stdlib = ({data}) => {
headings: object,
};

const HeaderWithTypes = ({id, name, types, contracts}) => {
const HeaderWithTypes = ({id, name, type, contracts}) => {
const Header = ({content}) => {
return (
<h3 id={id} style={{'position': 'relative'}}>
Expand All @@ -38,15 +38,15 @@ const Stdlib = ({data}) => {
);
}

if(!types && !contracts.length) {
if(!type && !contracts.length) {
return (<Header content={name} />);
}

if(types && !contracts.length) {
return (<Header content={`${name} : ${types}`} />);
if(type && !contracts.length) {
return (<Header content={`${name} : ${type}`} />);
}

if(!types && contracts) {
if(!type && contracts) {
return (
<React.Fragment>
<Header content={`${name} | ${contracts[0]}`} />
Expand All @@ -59,7 +59,7 @@ const Stdlib = ({data}) => {

return (
<React.Fragment>
<Header content={`${name} : ${types}`} />
<Header content={`${name} : ${type}`} />
{contracts.map((ctr) => {
return (<h4><code className={'language-nickel'}>{name} | {ctr}</code></h4>);
})}
Expand All @@ -83,7 +83,7 @@ const Stdlib = ({data}) => {
const id = `${prefix}${prefix ? "." : ""}${k}`;
return (
<React.Fragment>
<HeaderWithTypes id={id} name={id} types={v.types} contracts={v.contracts}/>
<HeaderWithTypes id={id} name={id} type={v.type} contracts={v.contracts}/>
<ReactMarkdown components={markdownComponents}>
{v.documentation}
</ReactMarkdown>
Expand Down

0 comments on commit cda06a6

Please sign in to comment.