# Code Blocks Extension for filenames and line numbers

**URL:** <https://talk.commonmark.org/t/code-blocks-extension-for-filenames-and-line-numbers/536>\
**Category:** Extensions\
**Created:** [September 9, 2014, 8:22pm UTC](https://talk.commonmark.org/t/code-blocks-extension-for-filenames-and-line-numbers/536 "2014-09-09T20:22:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mb21](https://talk.commonmark.org/user_avatar/talk.commonmark.org/mb21/32/162_2.png) [@mb21](https://talk.commonmark.org/u/mb21)\
**Post date:** [September 10, 2014, 10:02am UTC](https://talk.commonmark.org/t/code-blocks-extension-for-filenames-and-line-numbers/536/2 "2014-09-10T10:02:05Z")

</div>

This seems like a good fit for the [generic directives/plugins syntax](http://talk.commonmark.org/t/generic-directives-plugins-syntax/444) as well. For example:

```
@@@code[caption](filename.cpp:100){.class}
int main(){
    return 0;
}
@@@

```

Or you could probably get away with the [attribute syntax](http://talk.commonmark.org/t/consistent-attribute-syntax/272) and run some post-processor to get the desired output:

````
``` {.class caption=filename.cpp linenumber=100}
int main(){
    return 0;
}
```

````

---

_[View the full topic](https://talk.commonmark.org/t/code-blocks-extension-for-filenames-and-line-numbers/536)._
