As was mentioned previously this depends on what markdown/highlighter you are using.
Edit:
I haven't updated my version of Hexo so blueberryfields answer is available in more recent versions. Basically looks like there is an added optional parameter line_number
.
I will keep the below answer as well because it is often useful to extend Hexo to support features not yet in mainline.
If not available:
Since you tagged the post as Hexo I'm assuming you are talking about the codeblock tag.
{% codeblock [title] [lang:language] [url] [link text] %}
code snippet
{% endcodeblock %}
The version of Hexo as of this writing uses highlight.js and is defined in:
./node_modules/hexo/lib/plugins/tag/code.js
You could extend this directly, although that can get ugly if trying to update the module. You could fork Hexo and submit a pull request with your changes.
You could also extend Hexo to do what you want.
In the root of your project you could create a javascript file for custom tags:
./scripts/tags.js
You could start off with something like:
'use strict';
/**
* simple code
*
* Syntax:
* {% simple_codeblock %}
*/
var util = require('hexo-util');
var highlight = util.highlight;
hexo.extend.tag.register('simple_codeblock', function(args, content){
content = highlight(content, {
lang: '',
caption: '',
gutter: false,
tab: '',
autoDetect: true
});
return content;
}, {ends: true});
And extend it however you want.
Note: This requires you reference hexo-util:
npm install hexo-util --save
Usage:
{% simple_codeblock %}
// place code here
{% endsimple_codeblock %}