Skip to content

Instantly share code, notes, and snippets.

@joostkremers
Last active March 10, 2023 20:18
Show Gist options
  • Save joostkremers/a809060209255a822ce758b6c7ecd933 to your computer and use it in GitHub Desktop.
Save joostkremers/a809060209255a822ce758b6c7ecd933 to your computer and use it in GitHub Desktop.
contents of eldoc-doc-buffer
[internal] Fri Mar 10 21:04:14 2023:
(:message "Running language server: /usr/bin/pyright-langserver --stdio")
[client-request] (id:1) Fri Mar 10 21:04:14 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
(:processId 2088 :rootPath "/home/joost/src/amelia/amy/" :rootUri "file:///home/joost/src/amelia/amy" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())
:capabilities
(:workspace
(:applyEdit t :executeCommand
(:dynamicRegistration :json-false)
:workspaceEdit
(:documentChanges t)
:didChangeWatchedFiles
(:dynamicRegistration t)
:symbol
(:dynamicRegistration :json-false)
:configuration t :workspaceFolders t)
:textDocument
(:synchronization
(:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
:completion
(:dynamicRegistration :json-false :completionItem
(:snippetSupport t :deprecatedSupport t :tagSupport
(:valueSet
[1]))
:contextSupport t)
:hover
(:dynamicRegistration :json-false :contentFormat
["markdown" "plaintext"])
:signatureHelp
(:dynamicRegistration :json-false :signatureInformation
(:parameterInformation
(:labelOffsetSupport t)
:activeParameterSupport t))
:references
(:dynamicRegistration :json-false)
:definition
(:dynamicRegistration :json-false :linkSupport t)
:declaration
(:dynamicRegistration :json-false :linkSupport t)
:implementation
(:dynamicRegistration :json-false :linkSupport t)
:typeDefinition
(:dynamicRegistration :json-false :linkSupport t)
:documentSymbol
(:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :symbolKind
(:valueSet
[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26]))
:documentHighlight
(:dynamicRegistration :json-false)
:codeAction
(:dynamicRegistration :json-false :codeActionLiteralSupport
(:codeActionKind
(:valueSet
["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
:isPreferredSupport t)
:formatting
(:dynamicRegistration :json-false)
:rangeFormatting
(:dynamicRegistration :json-false)
:rename
(:dynamicRegistration :json-false)
:publishDiagnostics
(:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
(:valueSet
[1 2])))
:experimental #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
:workspaceFolders
[(:uri "file:///home/joost/src/amelia/amy" :name "~/src/amelia/amy/")]))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Pyright language server 1.1.298 starting"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Server root directory: /usr/lib/node_modules/pyright/dist/"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Starting service instance \"~/src/amelia/amy/\""))
[server-reply] (id:1) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 1 :result
(:capabilities
(:textDocumentSync 2 :definitionProvider
(:workDoneProgress t)
:declarationProvider
(:workDoneProgress t)
:typeDefinitionProvider
(:workDoneProgress t)
:referencesProvider
(:workDoneProgress t)
:documentSymbolProvider
(:workDoneProgress t)
:workspaceSymbolProvider
(:workDoneProgress t)
:hoverProvider
(:workDoneProgress t)
:documentHighlightProvider
(:workDoneProgress t)
:renameProvider
(:prepareProvider t :workDoneProgress t)
:completionProvider
(:triggerCharacters
["." "["]
:resolveProvider t :workDoneProgress t :completionItem
(:labelDetailsSupport t))
:signatureHelpProvider
(:triggerCharacters
["(" "," ")"]
:workDoneProgress t)
:codeActionProvider
(:codeActionKinds
["quickfix" "source.organizeImports"]
:workDoneProgress t)
:executeCommandProvider
(:commands
[]
:workDoneProgress t)
:callHierarchyProvider t :workspace
(:workspaceFolders
(:supported t :changeNotifications t)))))
[client-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
()))
[client-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py" :version 0 :languageId "python" :text "import spacy\nimport pandas as pd\nimport streamlit as sl\nimport streamlit.components.v1 as components\nimport scattertext as st\n\nsl.set_page_config(layout=\"wide\")\n\nsl.write(\"# Compare intents\")\n\nwith sl.expander(\"**Usage**\"):\n sl.markdown(\n \"\"\"Compare two intents in a training data set.\n\nUpload a `tsv` file with training data and select two intents. A graph will be\ncreated that plots the words used in both intents. This allows you to see which\nwords occur more often in the two intents and which words occur in both intents.\n\nThe `tsv` file should have the intents in column 1 and the utterances in column\n2, and should not have a header.\n\n \"\"\"\n )\n\nintents = pd.Series(dtype=object)\nintent1 = \"\"\nintent2 = \"\"\nunigrams_only = True\nsubmitted = None\n\ncol1, col2 = sl.columns(2)\n\nwith col1:\n sl.write(\"### Utterances\")\n\n utterance_file = sl.file_uploader(\"Choose training data file\")\n\n if utterance_file:\n sl.session_state.df = pd.read_csv(\n utterance_file,\n sep=\"\\t\",\n encoding=\"utf-8\",\n dtype=str,\n usecols=[0, 1],\n names=[\"intent\", \"utterance\"],\n )\n\n sl.session_state.df.fillna(\"none\", inplace=True)\n\n intents = sl.session_state.df.intent.unique()\n\nwith col2:\n form_placeholder = sl.empty()\n\n if intents.any():\n\n with form_placeholder.container():\n\n with sl.form(\"form\"):\n\n sl.write(\"### Intents\")\n\n intent1 = sl.selectbox(label=\"Intent 1\", options=intents)\n intent2 = sl.selectbox(label=\"Intent 2\", options=intents)\n\n unigrams_only = sl.checkbox(\"Show only unigrams\", value=True)\n\n submitted = sl.form_submit_button(\"Submit\")\n\n else:\n\n with form_placeholder.container():\n\n with sl.form(\"form\"):\n\n sl.write(\"### Intents\")\n\n sl.text_input(label=\"Intent 1\", disabled=True)\n sl.text_input(label=\"Intent 2\", disabled=True)\n\n unigrams_only = sl.checkbox(\n \"Show only unigrams\", value=True, disabled=True\n )\n\n sl.form_submit_button(\"Submit\", disabled=True)\n\nif submitted and intent1 and intent2:\n\n with sl.spinner(\"Creating plot...\"):\n\n nlp = spacy.load(\"en_core_web_sm\")\n\n # Extract only the intents we're interested in:\n df = sl.session_state.df.loc[\n (sl.session_state.df[\"intent\"] == intent1)\n | (sl.session_state.df[\"intent\"] == intent2)\n ]\n\n # Process them with spaCy so we get the lemmas:\n df = df.assign(doc=lambda df: df.utterance.apply(nlp))\n\n corpus = st.CorpusFromParsedDocuments(\n df,\n category_col=\"intent\",\n parsed_col=\"doc\",\n feats_from_spacy_doc=st.FeatsFromSpacyDoc(use_lemmas=True),\n ).build()\n\n if unigrams_only:\n corpus = corpus.get_unigram_corpus()\n\n html = st.produce_scattertext_explorer(\n corpus,\n category=intent1,\n category_name=intent1,\n not_category_name=intent2,\n minimum_term_frequency=0,\n pmi_threshold_coefficient=0,\n width_in_pixels=1000,\n metadata=corpus.get_df()[\"utterance\"],\n transform=st.Scalers.dense_rank,\n )\n\n components.html(html, height=1000, scrolling=True)\n")))
[client-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
(:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
())))
[server-request] (id:0) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 0 :method "client/registerCapability" :params
(:registrations
[(:id "7680e371-29bb-4959-aed7-999f736b0f3d" :method "workspace/didChangeWatchedFiles" :registerOptions
(:watchers
[(:globPattern "**/pyrightconfig.json" :kind 7)
(:globPattern "**" :kind 7)]))]))
[client-reply] (id:0) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 0 :result nil)
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Starting service instance \"<default>\""))
[server-request] (id:1) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 1 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "python")]))
[client-reply] (id:1) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 1 :result
[nil])
[server-request] (id:2) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 2 :method "workspace/configuration" :params
(:items
[(:scopeUri "file:///home/joost/src/amelia/amy" :section "python")]))
[client-reply] (id:2) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 2 :result
[nil])
[server-request] (id:3) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 3 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "python")]))
[client-reply] (id:3) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 3 :result
[nil])
[server-request] (id:4) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 4 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "python.analysis")]))
[client-reply] (id:4) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 4 :result
[nil])
[server-request] (id:5) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 5 :method "workspace/configuration" :params
(:items
[(:scopeUri "file:///home/joost/src/amelia/amy" :section "python.analysis")]))
[client-reply] (id:5) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 5 :result
[nil])
[server-request] (id:6) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 6 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "python.analysis")]))
[client-reply] (id:6) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 6 :result
[nil])
[server-request] (id:7) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 7 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "pyright")]))
[client-reply] (id:7) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 7 :result
[nil])
[server-request] (id:8) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 8 :method "workspace/configuration" :params
(:items
[(:scopeUri "file:///home/joost/src/amelia/amy" :section "pyright")]))
[client-reply] (id:8) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 8 :result
[nil])
[server-request] (id:9) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 9 :method "workspace/configuration" :params
(:items
[(:scopeUri "" :section "pyright")]))
[client-reply] (id:9) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 9 :result
[nil])
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "No pyproject.toml file found."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 2 :message "stubPath typings is not a valid directory."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Assuming Python platform Linux"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Searching for source files"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "No source files found."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Loading configuration file at /home/joost/src/amelia/amy/pyrightconfig.json"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Assuming Python version 3.10"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Assuming Python platform Linux"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "No include entries specified; assuming /home/joost/src/amelia/amy"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Auto-excluding **/node_modules"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Auto-excluding **/__pycache__"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Auto-excluding **/.*"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 2 :message "stubPath /home/joost/src/amelia/amy/typings is not a valid directory."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Searching for source files"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Found 6 source files"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "No pyproject.toml file found."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 2 :message "stubPath typings is not a valid directory."))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Assuming Python platform Linux"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "Searching for source files"))
[server-notification] Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "No source files found."))
[server-request] (id:10) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 10 :method "client/registerCapability" :params
(:registrations
[(:id "6d89f52d-3a63-467a-a2a4-68696206184f" :method "workspace/didChangeWatchedFiles" :registerOptions
(:watchers
[(:globPattern "**/pyrightconfig.json" :kind 7)
(:globPattern "**" :kind 7)]))]))
[client-reply] (id:10) Fri Mar 10 21:04:15 2023:
(:jsonrpc "2.0" :id 10 :result nil)
[server-notification] Fri Mar 10 21:04:17 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "[FG] Long operation: checking: /home/joost/src/amelia/amy/src/pages/01_Compare_intents.py (2296ms)"))
[server-notification] Fri Mar 10 21:04:17 2023:
(:jsonrpc "2.0" :method "window/logMessage" :params
(:type 3 :message "[FG] Long operation: analyzing: /home/joost/src/amelia/amy/src/pages/01_Compare_intents.py (2543ms)"))
[server-notification] Fri Mar 10 21:04:17 2023:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py" :version 0 :diagnostics
[]))
[server-request] (id:11) Fri Mar 10 21:04:18 2023:
(:jsonrpc "2.0" :id 11 :method "client/unregisterCapability" :params
(:unregisterations
[(:id "7680e371-29bb-4959-aed7-999f736b0f3d" :method "workspace/didChangeWatchedFiles")]))
[client-reply] (id:11) Fri Mar 10 21:04:18 2023:
(:jsonrpc "2.0" :id 11 :result nil)
[client-request] (id:2) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 2 :method "textDocument/signatureHelp" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 0 :character 0)))
[client-request] (id:3) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 0 :character 0)))
[client-request] (id:4) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 4 :method "textDocument/documentHighlight" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 0 :character 0)))
[server-reply] (id:2) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 2 :result nil)
[server-reply] (id:3) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 3 :result nil)
[server-reply] (id:4) Fri Mar 10 21:04:25 2023:
(:jsonrpc "2.0" :id 4 :result nil)
[client-request] (id:5) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 5 :method "textDocument/signatureHelp" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[client-request] (id:6) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 6 :method "textDocument/hover" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[client-request] (id:7) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 7 :method "textDocument/documentHighlight" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[server-reply] (id:5) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 5 :result nil)
[server-reply] (id:6) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 6 :result
(:contents
(:kind "markdown" :value "```python\n(variable) markdown: (body: SupportsStr, unsafe_allow_html: bool = False) -> DeltaGenerator\n```\n---\nDisplay string formatted as Markdown.\n\nParameters\n----------\nbody : str \n&nbsp;&nbsp;&nbsp;&nbsp;The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.\n\n&nbsp;&nbsp;&nbsp;&nbsp;This also supports:\n\n * Emoji shortcodes, such as `` and ``.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.\n\n * LaTeX expressions, by wrapping them in \"$\" or \"$$\" (the \"$$\"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.\n\n * Colored text, using the syntax `:color[text to be colored]`,\nwhere `color` needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.\n\nunsafe\\_allow\\_html : bool \n&nbsp;&nbsp;&nbsp;&nbsp;By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.\n\n&nbsp;&nbsp;&nbsp;&nbsp;That said, we \\*strongly advise against it\\*. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:\n\n&nbsp;&nbsp;&nbsp;&nbsp;https://github.com/streamlit/streamlit/issues/152\n\nExamples\n--------\n```\n>>> import streamlit as st\n>>>\n>>> st.markdown('Streamlit is **_really_ cool**.')\n>>> st.markdown(”This text is :red[colored red], and this is **:blue[colored]** and bold.”)\n>>> st.markdown(\":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:\")\n```")
:range
(:start
(:line 11 :character 7)
:end
(:line 11 :character 15))))
[server-reply] (id:7) Fri Mar 10 21:04:36 2023:
(:jsonrpc "2.0" :id 7 :result
[(:kind 2 :range
(:start
(:line 11 :character 7)
:end
(:line 11 :character 15)))])
[client-request] (id:8) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 8 :method "textDocument/signatureHelp" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[client-request] (id:9) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 9 :method "textDocument/hover" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[client-request] (id:10) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 10 :method "textDocument/documentHighlight" :params
(:textDocument
(:uri "file:///home/joost/src/amelia/amy/src/pages/01_Compare_intents.py")
:position
(:line 11 :character 7)))
[server-reply] (id:8) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 8 :result nil)
[server-reply] (id:9) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 9 :result
(:contents
(:kind "markdown" :value "```python\n(variable) markdown: (body: SupportsStr, unsafe_allow_html: bool = False) -> DeltaGenerator\n```\n---\nDisplay string formatted as Markdown.\n\nParameters\n----------\nbody : str \n&nbsp;&nbsp;&nbsp;&nbsp;The string to display as Github-flavored Markdown. Syntax\ninformation can be found at: https://github.github.com/gfm.\n\n&nbsp;&nbsp;&nbsp;&nbsp;This also supports:\n\n * Emoji shortcodes, such as `` and ``.\nFor a list of all supported codes,\nsee https://share.streamlit.io/streamlit/emoji-shortcodes.\n\n * LaTeX expressions, by wrapping them in \"$\" or \"$$\" (the \"$$\"\nmust be on their own lines). Supported LaTeX functions are listed\nat https://katex.org/docs/supported.html.\n\n * Colored text, using the syntax `:color[text to be colored]`,\nwhere `color` needs to be replaced with any of the following\nsupported colors: blue, green, orange, red, violet.\n\nunsafe\\_allow\\_html : bool \n&nbsp;&nbsp;&nbsp;&nbsp;By default, any HTML tags found in the body will be escaped and\ntherefore treated as pure text. This behavior may be turned off by\nsetting this argument to True.\n\n&nbsp;&nbsp;&nbsp;&nbsp;That said, we \\*strongly advise against it\\*. It is hard to write\nsecure HTML, so by using this argument you may be compromising your\nusers' security. For more information, see:\n\n&nbsp;&nbsp;&nbsp;&nbsp;https://github.com/streamlit/streamlit/issues/152\n\nExamples\n--------\n```\n>>> import streamlit as st\n>>>\n>>> st.markdown('Streamlit is **_really_ cool**.')\n>>> st.markdown(”This text is :red[colored red], and this is **:blue[colored]** and bold.”)\n>>> st.markdown(\":green[$\\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:\")\n```")
:range
(:start
(:line 11 :character 7)
:end
(:line 11 :character 15))))
[server-reply] (id:10) Fri Mar 10 21:08:42 2023:
(:jsonrpc "2.0" :id 10 :result
[(:kind 2 :range
(:start
(:line 11 :character 7)
:end
(:line 11 :character 15)))])
```python
(variable) markdown: (body: SupportsStr, unsafe_allow_html: bool = False) -> DeltaGenerator
```
---
Display string formatted as Markdown.
Parameters
----------
body : str
&nbsp;&nbsp;&nbsp;&nbsp;The string to display as Github-flavored Markdown. Syntax
information can be found at: https://github.github.com/gfm.
&nbsp;&nbsp;&nbsp;&nbsp;This also supports:
* Emoji shortcodes, such as `` and ``.
For a list of all supported codes,
see https://share.streamlit.io/streamlit/emoji-shortcodes.
* LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
must be on their own lines). Supported LaTeX functions are listed
at https://katex.org/docs/supported.html.
* Colored text, using the syntax `:color[text to be colored]`,
where `color` needs to be replaced with any of the following
supported colors: blue, green, orange, red, violet.
unsafe\_allow\_html : bool
&nbsp;&nbsp;&nbsp;&nbsp;By default, any HTML tags found in the body will be escaped and
therefore treated as pure text. This behavior may be turned off by
setting this argument to True.
&nbsp;&nbsp;&nbsp;&nbsp;That said, we \*strongly advise against it\*. It is hard to write
secure HTML, so by using this argument you may be compromising your
users' security. For more information, see:
&nbsp;&nbsp;&nbsp;&nbsp;https://github.com/streamlit/streamlit/issues/152
Examples
--------
```
>>> import streamlit as st
>>>
>>> st.markdown('Streamlit is **_really_ cool**.')
>>> st.markdown(”This text is :red[colored red], and this is **:blue[colored]** and bold.”)
>>> st.markdown(":green[$\sqrt{x^2+y^2}=1$] is a Pythagorean identity. :pencil:")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment