Answer the question
In order to leave comments, you need to log in
How to insert the source code with the necessary highlighting on the site?
Good day to all!
Can you please tell me how I can insert the code with the edge highlight (which ide offers for each language) on the site? I poked around in other people's sites who and how solves this issue and even saw how each line of code is wrapped in a div, and each element that has its own color is wrapped in a span. This method is very bad when there is a lot of code and I have no idea how much time it takes to kill it, if there are really a lot of code examples.
Can anyone suggest the correct solution to this nuance?
A banal example of the code that I want to insert into the site (the code should be easily copied by users)
public class Main {
public static void main(String[] args) {
Box myBox = new Box();
myBox.height = 10.2;
myBox.length = 15;
myBox.width = 11.3;
double volume = myBox.height * myBox.length * myBox.width;
System.out.println(volume);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question