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

Add static rendering for GitHub #480

Merged
merged 2 commits into from
Nov 16, 2023
Merged

Add static rendering for GitHub #480

merged 2 commits into from
Nov 16, 2023

Conversation

ileasile
Copy link
Member

Fixes #476

I tried to make the code effective and clean enough. However, there might be problems with hierarchical dataframes. Please check if it's the case and adjust the code, it shouldn't be hard. Don't forget that you can't add any JavaScript though.

An example notebook rendered with the library from this PR is here: https://gist.github.com/ileasile/a0b52c0df65bb401078cd845387dd6f0

@Jolanrensen Jolanrensen added this to the 0.12.1 milestone Oct 24, 2023
@Jolanrensen Jolanrensen added documentation Improvements or additions to documentation (not KDocs) enhancement New feature or request labels Oct 24, 2023
@Jolanrensen Jolanrensen self-requested a review November 13, 2023 13:12

fun StringBuilder.emitBody() = emitTag("tbody") {
val rowsCountToRender = minOf(rowsCount(), configuration.rowsLimit ?: Int.MAX_VALUE)
for (rowIndex in 0..<rowsCountToRender) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow first time I see ..< in action, cool

Copy link
Collaborator

@Jolanrensen Jolanrensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be merged if we do #503 afterwards

Fixes #476

Signed-off-by: Ilya Muradyan <ilya.muradyan@jetbrains.com>
Signed-off-by: Ilya Muradyan <ilya.muradyan@jetbrains.com>
@Jolanrensen
Copy link
Collaborator

Thanks for the performance fixes :)

@Jolanrensen Jolanrensen self-requested a review November 16, 2023 11:24
@Jolanrensen Jolanrensen merged commit c7b8169 into master Nov 16, 2023
2 checks passed
@Jolanrensen
Copy link
Collaborator

I'll also cherry-pick it into 0.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation (not KDocs) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static HTML output for dataframes in the Notebook for rendering on GitHub
2 participants