Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention code highlighting in Markdown and ChatFeed #6519

Merged
merged 2 commits into from
Mar 18, 2024
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
19 changes: 18 additions & 1 deletion examples/reference/chat/ChatFeed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,24 @@
"metadata": {},
"outputs": [],
"source": [
"message = chat_feed.send({\"object\": \"Overtaken!\", \"user\": \"Bot\"}, user=\"MegaBot\")"
"contents = \"\"\"\n",
"```python\n",
"import panel as pn\n",
"\n",
"pn.chat.ChatMessage(\"I'm a code block!\", avatar=\"🤖\")\n",
"```\n",
"\"\"\"\n",
"message = chat_feed.send({\"object\": contents, \"user\": \"Bot\"}, user=\"MegaBot\")\n",
"message"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
":::{note} Code Highlighting\n",
"To enable code highlighting in code blocks, `pip install pygments`\n",
":::"
]
},
{
Expand Down
11 changes: 11 additions & 0 deletions examples/reference/chat/ChatMessage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,17 @@
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Code Highlighting\n",
"\n",
":::{note} Code Highlighting\n",
"To enable code highlighting in code blocks, `pip install pygments`\n",
":::"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
11 changes: 11 additions & 0 deletions examples/reference/panes/Markdown.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@
"\"\"\", stylesheets=[css])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Code Highlighting\n",
"\n",
":::{note} Code Highlighting\n",
"To enable code highlighting in code blocks, `pip install pygments`\n",
":::"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading