Blog Park uses the sublime text-style code highlight Style

Source: Internet
Author: User
Tags sublime text

The style of the code displayed in the blog garden is a little ugly by default, So I thought about whether to use sublime text3 to highlight the code, because I used sublime text3 to edit C, JS, PHP, HTML, etc, I like the highlighted color of the Code. So I found the blog of the great God [Liu wayong]. According to the blog of the great god, the setting was indeed successful.

However, after the settings are complete, I feel that the font and line spacing of the Code are not beautiful. Now that we are all at this step, let's do it ourselves. So I first put it in Div. when {font-family: consolas, Courier New; line-Height: 18px;} is set in highlight, the line spacing of the Code is changed, but the font is not changed, and then in Div. set {font-family: Las LAS, Courier New; line-Height: 18px;} in the subnode pre of hightlight. After saving the settings, check the source code and find that the PRE has no attributes.

 

 
#include "stdio.h"
#include "math.h"
#include "string.h"
#include "stdlib.h"

// font-family:consolas, courier new; line-height: 18px;
int main(int argc, char const *argv[])
{
	int data[35], _i, n, sum, s1, s2;

	while(scanf("%d", &n), n){
		sum = 0;
		for(_i=0; _i<n; _i++){
			scanf("%d", &data[_i]);
			sum += data[_i];
		}
		s1 = 0, s2 = sum;
		for(_i=0; _i<n; _i++){
			s1 += data[_i];
			s2 -= data[_i];
			if(s1 == s2){
				break;
			}
		}
		if(_i>=n){
			printf("No equal partitioning.\n");
		}else{
			printf("Sam stops at position %d and Ella stops at position %d.\n", _i+1, _i+2);
		}
	}

	return 0;
}

 

Depressed, didn't I save it just now? Set another side, (⊙ o ⊙ )..., In the tinymce editor, you can see the CSS effect. However, after saving the file, it still does not work when viewing the article! Well, after a while, I came up with the following solution:

When you want to paste the code, save the previously written article, modify the editor to a plain text editor in "options", and paste the highlighted code snippet into it, then add the property set on the PRE Tag. However, there is a problem: You cannot set the editor back to the default one. Otherwise, the added one is invalid. Why does the tinymce editor remove the pre attributes?

Well, my method is really troublesome! Pai_^

 

#include "stdio.h"
#include "math.h"
#include "string.h"
#include "stdlib.h"

// font-family:consolas, courier new; line-height: 18px;
int main(int argc, char const *argv[])
{
	int data[35], _i, n, sum, s1, s2;

	while(scanf("%d", &n), n){
		sum = 0;
		for(_i=0; _i<n; _i++){
			scanf("%d", &data[_i]);
			sum += data[_i];
		}
		s1 = 0, s2 = sum;
		for(_i=0; _i<n; _i++){
			s1 += data[_i];
			s2 -= data[_i];
			if(s1 == s2){
				break;
			}
		}
		if(_i>=n){
			printf("No equal partitioning.\n");
		}else{
			printf("Sam stops at position %d and Ella stops at position %d.\n", _i+1, _i+2);
		}
	}

	return 0;
}

Of course, if you want to set a line number, you can configure the plug-in before exporting the highlighted code.

I do not know whether such an article can be published on the above homepage! Pai_^

Blog Park uses the sublime text-style code highlight Style

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.