Skip to content

Allow configuring number of lines in pyodide editors. #89

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Zedoman
Copy link

@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
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
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
Author

Zedoman commented Jun 19, 2025

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

@pawamoy
Copy link
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?

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