streamlit-code-editor icon indicating copy to clipboard operation
streamlit-code-editor copied to clipboard

Add Line Number

Open OdyAsh opened this issue 1 year ago • 3 comments

Is there a possibility to add line numbers parameter, like in st.code(line_numbers=True)?

OdyAsh avatar Nov 22 '24 19:11 OdyAsh

The following is how you would do it now:

response = code_editor(code, options={"showLineNumbers": True})

I will consider adding a separate parameter for line numbering.

bouzidanas avatar Nov 24 '24 05:11 bouzidanas

Oh, I didn't know that option existed!

I checked the documentation and couldn't find an exhaustive list of possible options, so I randomly tried keys like line_number, lineNumber , etc. 😅 (Is there a place where I can find this exhaustive list, though?)

Either way, this option is very sufficient for me as it is.

Thank you for the quick reply, and for this awesome component :] ♥️🙌

OdyAsh avatar Nov 24 '24 06:11 OdyAsh

The documentation is incomplete and needing much attention, but it is its own time sink and hopefully when a get a bit of time, I will improve it.

A link to the list of options is in the docs but its not super clear and obvious. Appologies!

[Here are the options]

bouzidanas avatar Nov 24 '24 08:11 bouzidanas