Wrap code text in template readme files (#2562)

This commit is contained in:
Abhineet Jain
2022-06-22 11:01:43 -04:00
committed by GitHub
parent 92bcacebde
commit bd19fcbae1
2 changed files with 19 additions and 1 deletions
@@ -19,7 +19,19 @@ Example.args = {
export const SmallViewport = Template.bind({})
SmallViewport.args = {
template: Mocks.MockTemplate,
activeTemplateVersion: Mocks.MockTemplateVersion,
activeTemplateVersion: {
...Mocks.MockTemplateVersion,
readme: `---
name:Template test
---
## Instructions
You can add instructions here
[Some link info](https://coder.com)
\`\`\`
# This is a really long sentence to test that the code block wraps into a new line properly.
\`\`\``,
},
templateResources: [Mocks.MockWorkspaceResource, Mocks.MockWorkspaceResource2],
}
SmallViewport.parameters = {
@@ -83,6 +83,12 @@ export const useStyles = makeStyles((theme) => {
markdownWrapper: {
background: theme.palette.background.paper,
padding: theme.spacing(3.5),
// Adds text wrapping to <pre> tag added by ReactMarkdown
"& pre": {
whiteSpace: "pre-wrap",
wordWrap: "break-word",
},
},
resourcesTableContents: {
margin: 0,