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

Distinguish output code blocks #1611

Merged
merged 3 commits into from Sep 20, 2022

Conversation

jonatanklosko
Copy link
Member

When rendering notebook contents with outputs, it is not obvious which blocks are outputs, especially that they are highlighted as regular code. This adds a specialized styling for output blocks.

image

code_attrs = Enum.reject(code_attrs, &match?({"class", _}, &1))
new_code = {"code", [{"class", "output"} | code_attrs], [source], code_meta}
fixup_list([{"pre", pre_attrs, [new_code], pre_meta} | ast], acc)
end
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if the Livebook matching shouldn't happen somewhere upstream, but here we reject all comments, so it is the only place given the current approach.

@jonatanklosko
Copy link
Member Author

@josevalim updated and added a test :)

image

@josevalim josevalim merged commit 1f55996 into elixir-lang:main Sep 20, 2022
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@jonatanklosko jonatanklosko deleted the jk-output-code-block branch September 20, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants