

"Smartypants, double quotes" and 'single quotes' Proceed to create a test file with nano and write some Markdown based content on it, for example: # h1 Heading 8-) Create Test Markdown File to see resultsĪs final step, you need to test wheter the highlight works or not. Save changes and proceed with the last step.
MACDOWN CODE HIGHLIGHTED IN EDITOR INSTALL
npm install markdown-it-highlightjs Then head over to your pages/post/ slug. To install the highlight package, run the following command. This file will be automatically added into nano and will highlight markdown files. Since we are using markdown-it as our markdown parser, we can use highlightjs, an optional plugin. Visit the official repository of Nano Highlight, a spiffy collection of nano syntax highlighting files for more information and languages available for nano. Run nano to create the file: sudo nano /usr/share/nano/markdown.nanorcĪnd paste the following content: syntax "markdown" "\.md$" "\.markdown$"Ĭolor brightmagenta "\(\(*\))?" This file is the markdown.nanorc file and you need to create it in the mentioned directory. In order to provide syntax highlighting to your file, if the default file doesn't exist, you need to create the syntax highlighting file for this language. Create Markdown Nano Syntax Highlighting File If you don't find the markdown.nanorc file, then you can install it with the next step. This will list all the nano syntax highlighting files in the given directory: :~$ ls /usr/share/nano/Īsm.nanorc fortran.nanorc man.nanorc ocaml.nanorc ruby.nanorcĪwk.nanorc gentoo.nanorc mgp.nanorc patch.nanorc sh.nanorcĬ.nanorc groff.nanorc mutt.nanorc perl.nanorc tcl.nanorcĬmake.nanorc html.nanorc nano-menu.xpm php.nanorc tex.nanorcĬss.nanorc java.nanorc nanorc.nanorc pov.nanorc xml.nanorcĭebian.nanorc makefile.nanorc objc.nanorc python.nanorc List available Nano Syntax Highlight FilesĪs first step, discover which languages are available in nano to highlight its syntax with the following command: ls /usr/share/nano/ Rather, it allows you to start typing directly and perform formatting with the help of a built-in menu bar. It doesn’t have any feature to show the rendered syntax and plain text.
MACDOWN CODE HIGHLIGHTED IN EDITOR HOW TO
In this article, we'll show you how to highlight Markdown files on nano in Ubuntu. Typora is counted as one of the most versatile and quickest Markdown editors. If you want to highlight this kind of files as well, you will need to follow an extra step. Nano offers syntax highlighting for many file types, however not for Markdown files. One of those files that you need to change often in this kind of editor are configuration file, like markdown files. If you want to highlight a syntax, let the code block a language before the fencing code. Whether your code is written in English or Spanish, you can use this feature to highlight the colors you use. A lot of developers prefer this editor as it's very simple to use and pretty useful when you only want to edit a single file quickly on your server. In Markdown processor, syntax highlighting (including fenced code blocks) is prevalent.

Though not as powerful as Emacs or Vim, it is easy to learn and use. GNU nano is a simple terminal-based text editor.
