Fix wordwrap by default on docs (#3776)

* feat: fixes on docs website

* fix: tab issue

* fix: wordwrap by default cannot happen in every codeblock
This commit is contained in:
jose-donato
2022-12-15 12:58:13 +00:00
committed by GitHub
parent baa8bc6f39
commit d594cbd82e
2 changed files with 6 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ Get news for a given term and source. [Source: Feedparser]
Source Code: [[link](https://github.com/OpenBB-finance/OpenBBTerminal/tree/main/openbb_terminal/common/feedparser_model.py#L13)]
```python
openbb..news(term: str = "", sources: str = "", sort: str = "published")
openbb.news(term: str = "", sources: str = "", sort: str = "published")
```
---

View File

@@ -41,6 +41,9 @@ export default function CodeBlockString({
});
const showLineNumbers =
showLineNumbersProp ?? containsLineNumbers(metastring);
const shouldWordwrapByDefault = code.startsWith("openbb.")
return (
<Container
as="div"
@@ -67,10 +70,10 @@ export default function CodeBlockString({
className={clsx(className, styles.codeBlock, "thin-scrollbar")}
>
<code
style={{
style={shouldWordwrapByDefault ? {
whiteSpace: 'pre-wrap',
overflowWrap: 'anywhere'
}}
} : {}}
className={clsx(
styles.codeBlockLines,
showLineNumbers && styles.codeBlockLinesWithNumbering