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

Line highlighting option #50

Closed
Relequestual opened this issue Jul 22, 2019 · 6 comments
Closed

Line highlighting option #50

Relequestual opened this issue Jul 22, 2019 · 6 comments
Labels
feature-request New feature or request

Comments

@Relequestual
Copy link

It looks like Carbon supports highligting individual lines: carbon-app/carbon#824 (comment)

Could this be added as a CLI option?

@Relequestual Relequestual changed the title Line highlight Line highlighting option Jul 22, 2019
@mixn mixn added the feature-request New feature or request label Jul 22, 2019
@mixn
Copy link
Owner

mixn commented Jul 22, 2019

As stated by you here, adding it shouldn’t be a problem when it’s configurable via qs. 🙂 Doing it via Puppeteer would just be nasty imo. 😰

@Relequestual
Copy link
Author

Right. I guess the first step is to try and make it part of the query string config... I'll take a look at that in the next few days and then come back!

@Relequestual
Copy link
Author

carbon-app/carbon#806 has now been resolved and code can have font attributes changed including colour, however it doesn't add to the URL, which I believe is required for this to wrok?

@AbstractAlao
Copy link

So has this been implemented? How would you construct the command?

@Pitasi
Copy link

Pitasi commented Nov 15, 2022

FWIW it's possible to use the sl query param like so: https://carbon.now.sh/?sl=3,5

@mixn mixn mentioned this issue Feb 6, 2023
26 tasks
@mixn
Copy link
Owner

mixn commented May 12, 2023

This feature ships with the official v2 release. 🙂

Running carbon-now with --interactive will now yield additional questions regarding line highlighting.

Screenshot 2023-05-12 at 15 11 51

And it will — as with all other options — lead to another setting inside your preset named selectedLines.

Assuming this code in a file unfold.js:

// Example from https://carbon.now.sh/
const unfold = (f, seed) => {
  const go = (f, seed, acc) => {
    const res = f(seed)
    return res ? go(f, res[1], acc.concat([res[0]])) : acc
  }
  return go(f, seed, [])
};

Running carbon-now unfold.js with a preset that has "selectedLines": "3,4,5,6" will lead to the expected result. 🙂

foo

Hope that helps. 🙂

Happy testing and using! 🥳

@mixn mixn closed this as completed May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants