Skip to content

Commit

Permalink
Change types to typ when generating stdlib documentation
Browse files Browse the repository at this point in the history
The `types` to `typ` rename in Nickel upstream will break the stdlib
documentation generation on the next release, otherwise. Accordingly, we
shouldn't merge this into `master` until then.
  • Loading branch information
vkleen committed Aug 3, 2023
1 parent 763dc7c commit 688707d
Showing 1 changed file with 7 additions and 7 deletions.
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, typ, 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(!typ && !contracts.length) {
return (<Header content={name} />);
}

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

if(!types && contracts) {
if(!typ && 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} : ${typ}`} />
{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} typ={v.typ} contracts={v.contracts}/>
<ReactMarkdown components={markdownComponents}>
{v.documentation}
</ReactMarkdown>
Expand Down

0 comments on commit 688707d

Please sign in to comment.