Simply put, the Sublimetext sublimehighlight plugin can sublime the code style in the text editor,
Including indentation, code highlighting, etc. converted to HTML code, when viewed in a browser, can be associated with sublime text indistinguishable,
When you need to insert the highlighted code in HTML, consider it!
Installation method:
1, add sublime text of the Repo:https://github.com/n1k0/sublimehighlight/tree/python3
2, search and install Sublimehighlight plug-in
3. Convert the code to Html:edit---Highlight, convert to Html
Note: If you do not know how to install sublime text plugin, please self-Google, degree Niang, about sublimehighlight plug-in details please refer to its homepage,
and this blog!
Here's how it works:
#include <functional>#include <iostream>using namespace std;STD::function< int(int)> functional;//Common functionsint TestFunc(int a){ return A;}//lambda expressionAuto Lambda = [](int a) -int{ return A; };//Copy function (functor)class Functor{Public : int operator()(int a) { return A; }};//1. class member functions//2. class static Functionsclass TestClass{Public : int Classmember (int a) { return A; } Static int Staticmember (int a) { return A; }};int Main(){ //Common functions Functional = TestFunc; int result = Functional (Ten); cout << "normal function:"<< result << Endl; //lambda expression Functional = Lambda; result = Functional ( -); cout << "lambda expression:"<< result << Endl; //Imitation functions Functor Testfunctor; Functional = Testfunctor; result = Functional ( -); cout << "faux function:"<< result << Endl; //class member function TestClass testobj; Functional = STD::Bind (&TestClass::Classmember, Testobj, STD::placeholders::_1); result = Functional ( +); cout << "class member function:"<< result << Endl; //class static function Functional = TestClass::Staticmember; result = Functional ( -); cout << "Class static function:"<< result << Endl; return 0;}
Sublime Text Plugin Sublimehighlight