mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
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:
2
website/content/sdk/reference/news.md
vendored
2
website/content/sdk/reference/news.md
vendored
@@ -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")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user