Skip to content

Allow configuring number of lines in pyodide editors. #89

Closed
Zedoman wants to merge 4 commits intopawamoy:mainfrom
Zedoman:main
Closed

Allow configuring number of lines in pyodide editors. #89
Zedoman wants to merge 4 commits intopawamoy:mainfrom
Zedoman:main

Conversation

@Zedoman
Copy link
Copy Markdown

@Zedoman Zedoman commented Jun 17, 2025

Fixes #41

Changes Made

I've implemented height configuration options for the Pyodide editor in the pyodide.py formatter. The changes include:

  1. Added support for multiple height configuration options:

    • lines : Sets the editor height based on number of visible lines (previously implemented)
    • height : Sets an explicit height in pixels
    • min_height : Sets the minimum height constraint
    • max_height : Sets the maximum height constraint
    • resize : Controls if and how the editor can be resized by the user
  2. Updated the HTML template to use these new style properties in the editor div:

<div><pre id="%(id_prefix)seditor" class="pyodide-editor" style="height: %(height)spx; min-height: %(min_height)spx; max-height: %(max_height)spx; resize: %(resize)s;">%(initial_code)s</pre></div>
  1. Added code to extract and process these parameters from the extra options dictionary.

@pawamoy
Copy link
Copy Markdown
Owner

pawamoy commented Jun 18, 2025

Hi @Zedoman, thanks for the PR. However it looks like you have taken the same approach as in #85, i.e. choosing a fixed length for line height in pixels. I'd prefer to see a solution based on Ace's maxLines and minLines options.

@Zedoman
Copy link
Copy Markdown
Author

Zedoman commented Jun 18, 2025

Hi @Zedoman, thanks for the PR. However it looks like you have taken the same approach as in #85, i.e. choosing a fixed length for line height in pixels. I'd prefer to see a solution based on Ace's maxLines and minLines options.

Hi @Zedoman, thanks for the PR. However it looks like you have taken the same approach as in #85, i.e. choosing a fixed length for line height in pixels. I'd prefer to see a solution based on Ace's maxLines and minLines options.

Ok sir got it Will do then.

@Zedoman
Copy link
Copy Markdown
Author

Zedoman commented Jun 19, 2025

@pawamoy You can check once now I did the changes.

@pawamoy
Copy link
Copy Markdown
Owner

pawamoy commented Jun 19, 2025

Thanks for the update @Zedoman. However... you're passing the minLines and maxLines parameters to setupPyodide, but you haven't actually updated that function to receive those, let alone do anything with them. Have you even tried your code? Or are you vibe-coding to get the bounty?

@pawamoy
Copy link
Copy Markdown
Owner

pawamoy commented Jun 25, 2025

Closing for now, feel free to comment further or update the PR and I can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Add option to specify initial number of lines in pyodide fence editors

2 participants