Sharing Code Snippets
What are Code Snippets?
Code snippets are small pieces of code, hence "snippets" of code, that can be shared while commenting.
With FastComments, simply pasting a snippet of code should automatically be detected and formatted.
When commenting, the code snippet will be wrapped in
<code> blocks, and the formatting happens
after you submit your comment.
The wrapping in
<code> blocks is automatic when pasting a snippet of code, in many languages.
Alternatively, you can highlight a piece of text and click the
Code button in the toolbar.
Code Snippet Sharing is useful for communities where sharing code is likely to happen.
This makes shared pieces of code easier to read with little effort from your users.
We hope that this feature makes FastComments an ideal choice for programming related sites and applications.
Programming Languages Supported
When sharing code snippets, FastComments does its best to automatically determine which programming language the code snippet is in to automatically format and apply syntax highlighting.
FastComments syntax highlighting currently supports 39 common languages:
- HTML, XML
- PHP Template
- Plain text
- Python REPL
- TOML and INI
- Visual Basic .NET
When sharing a code snippet in a language we don't support, it will still be rendered like code - but no syntax highlighting or reformatting will be applied.
Setting Up Code Snippet Sharing
No setup is required to enable this feature. It is automatically available to your users when using FastComments.