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

Highlight julia-repl code in Markdown specially #54423

Merged
merged 1 commit into from
May 10, 2024

Conversation

tecosaur
Copy link
Contributor

@tecosaur tecosaur commented May 9, 2024

Fixes #54399 by re-introducing the code seperated out from the styled Markdown PR at Jameson's request (#51928 (comment)).

The code itself is modelled after equivalent code in OhMyREPL.

Sample:

image

Bonus:

The new markdown_julia_prompt face allows people to make the "prompt" shown in Markdown code visually distinct, to avoid confusing it with the REPL prompt at a glance. By way of example, I make it italic by augmenting my faces.toml with

[markdown]
julia_prompt = { italic = true }

image

Copy the approach taken by OhMyREPL.jl, and make the highlighting of
julia-repl and jldoctest more closely mirror the REPL experience.

This code was originally part of 1614e11, but was
separated out at Jameson's request so it could be discussed seperately.
@tecosaur tecosaur added display and printing Aesthetics and correctness of printed representations of objects. markdown labels May 9, 2024
@fredrikekre fredrikekre merged commit 6582eaa into JuliaLang:master May 10, 2024
9 checks passed
@BioTurboNick
Copy link
Contributor

It would be nice for users if the help prompt could always use the less-confusing rendering of the julia prompt when docstrings are printed. Would that be possible?

@tecosaur
Copy link
Contributor Author

Sounds good to me, I think the question then is just what the default should be.

lazarusA pushed a commit to lazarusA/julia that referenced this pull request Jul 12, 2024
Fixes JuliaLang#54399 by re-introducing the code seperated out from the styled
Markdown PR at Jameson's request
(JuliaLang#51928 (comment)).

The code itself is modelled after [equivalent code in
OhMyREPL](https://github.com/KristofferC/OhMyREPL.jl/blob/b0071f5ee785a81ca1e69a561586ff270b4dc2bb/src/MarkdownHighlighter.jl#L15-L31).

The new `markdown_julia_prompt` face allows people to make the "prompt"
shown in Markdown code visually distinct, to [avoid confusing it with
the REPL prompt at a
glance](KristofferC/OhMyREPL.jl#100). By way
of example, I make it italic by augmenting my `faces.toml` with

```toml
[markdown]
julia_prompt = { italic = true }
```
@tecosaur tecosaur deleted the markdown-handle-julia-repl branch August 11, 2024 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. markdown
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REPL stdout output should not be highlighted in code examples
3 participants