Skip to content

Commit

Permalink
docs: add forge options (#1423)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeta-eth authored Sep 30, 2024
1 parent 92567c1 commit fd67713
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions packages/website/src/features/Docs/DocsCliPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ const DocumentationSection: React.FC<{
description: string;
argumentsData?: { key: string; value: string }[];
anvilOptionsData?: { key: string; value: string }[];
forgeOptionsData?: { key: string; value: string }[];
optionsData?: { key: string; value: string }[];
}> = ({
id,
command,
description,
argumentsData,
anvilOptionsData,
forgeOptionsData,
optionsData,
}) => (
<Box mb={16} id={id}>
Expand Down Expand Up @@ -200,14 +202,48 @@ const DocumentationSection: React.FC<{
>
Anvil
</Link>{' '}
node to execute this command. The following options can also be
passed through to the Anvil process:
to execute this command. The following options can also be passed
through to the Anvil process:
</Text>
<CustomTable title="Option" data={anvilOptionsData} />
</AccordionPanel>
</AccordionItem>
</Accordion>
)}
{forgeOptionsData && (
<Accordion allowToggle>
<AccordionItem border="none">
<h2>
<AccordionButton px={0}>
<Button
fontWeight={500}
size="sm"
colorScheme="white"
variant="outline"
letterSpacing="0.1px"
rightIcon={<AccordionIcon />}
>
Forge Options
</Button>
</AccordionButton>
</h2>
<AccordionPanel p={0}>
<Text mt={2} mb={4}>
Cannon uses{' '}
<Link
isExternal
href="https://github.com/foundry-rs/foundry/tree/master/crates/forge"
>
Forge
</Link>{' '}
to execute this command. The following options can also be passed
through to the Forge process:
</Text>
<CustomTable title="Option" data={forgeOptionsData} />
</AccordionPanel>
</AccordionItem>
</Accordion>
)}
</Box>
);

Expand Down Expand Up @@ -261,6 +297,15 @@ const renderCommandConfig = (commandConfig: any) => {
(option.defaultValue ? ` (default: "${option.defaultValue}")` : ''),
}))
}
forgeOptionsData={
commandConfig.forgeOptions &&
commandConfig.forgeOptions.map((option: any) => ({
key: option.flags,
value:
option.description +
(option.defaultValue ? ` (default: "${option.defaultValue}")` : ''),
}))
}
optionsData={
commandConfig.options &&
commandConfig.options.map((option: any) => ({
Expand Down

0 comments on commit fd67713

Please sign in to comment.