Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/features/sicp/parser/ParseJson.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ const handleSnippet = (obj: JsonType) => {
if (obj['latex']) {
return <Pre>{handleLatex(obj['body']!)}</Pre>;
} else if (typeof obj['eval'] === 'boolean' && !obj['eval']) {
return <Pre>{obj['body']}</Pre>;
return (
<>
{obj['body'] && <Pre>{obj['body']}</Pre>}
{obj['output'] && (
<Pre>
<em>{obj['output']}</em>
</Pre>
)}
</>
);
} else {
if (!obj['body']) {
return;
Expand Down
6 changes: 5 additions & 1 deletion src/pages/sicp/subcomponents/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ const CodeSnippet: React.FC<CodeSnippetProps> = props => {
</SyntaxHighlighter>
</Card>
)}
{output && <Pre>{output}</Pre>}
{output && (
<Pre>
<em>{output}</em>
</Pre>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ exports[`Sicp Code Snippet renders correctly with prepend 1`] = `
</SyntaxHighlighter>
</Blueprint3.Card>
<Component>
2
<em>
2
</em>
</Component>
</div>"
`;
Expand All @@ -23,7 +25,9 @@ exports[`Sicp Code Snippet renders correctly without prepend 1`] = `
</SyntaxHighlighter>
</Blueprint3.Card>
<Component>
2
<em>
2
</em>
</Component>
</div>"
`;
6 changes: 3 additions & 3 deletions src/styles/_sicp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ $sicp-content-lr-padding: 6em;
}

.bp3-code-block {
font-size: 15pt;
padding: 0 15px;
margin: 0;
font-size: 14pt;
padding: 0;
margin: 10px 0;
box-shadow: none;
color: $sicp-text-color;
background-color: inherit;
Expand Down