custom syntax for code block
See original GitHub issueI’m trying making something like this
```ttt
some code without syntax highlight
```
and want the code to be highlighted just like well-known language syntax
```javascript
some code with syntax highlight
```
How can i do it?
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Creating and highlighting code blocks - GitHub Docs
Share samples of code with fenced code blocks and enabling syntax highlighting. Fenced code blocks. You can create fenced code blocks by placing...
Read more >Extended Syntax - Markdown Guide
The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that...
Read more >Code blocks - Material for MkDocs - GitHub Pages
This configuration enables syntax highlighting on code blocks and inline code ... a custom title can be added to a code block by...
Read more >Custom Syntax Highlighting In Code::Blocks IDE - Codeforces
Custom Syntax Highlighting In Code::Blocks IDE ... vanilla codeblocks theme , Follow this installation guide to get the custom colourful new Themes :-...
Read more >Use your own syntax highlighter for code blocks
Highlight the code and select the Preformatted Text option in the formatting dropdown (or use Ctrl + Alt + 7). With the code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had checked the r markdown specification and had learn about the knitr engine. And I found these problems:
{javascript }
code block, but I have to insert a whitespace betweenjavascript
and}
. It seems a little bug.'''{r } '''
(for convenience, I’m using ’ to replacein this comment) pattern, the prefix
{rshould be a keyword indicates that the R markdown parser should treat this "code block" as an "code chunk". The language used inside the chunk should be specified by the
engineoption. For example,
‘’‘{r engine=“javascript”} ‘’‘indicates that this code chunk contains javascript code. This is doced [here](http://yihui.name/knitr/demo/engines/). Any code chunk beginning label replaces the
rin
’’'{r } ‘’'with other language name, should be an shorthand or the
engineoption. doced [here](http://rmarkdown.rstudio.com/authoring_knitr_engines.html). Language-markdown package seems not supports the
engine` option grammar.That depends on the language ; )
The
source.languagename
you are referring too is the base scope that these grammars use. Atom is essentially a webpage, and this base scope is the css class given to a line that contains code from that particular language. The thing is, it differs for a number of languages.The easiest way to find this scope is to open the main grammar file for a language (grammars/language-markdown.json in the case of this package) and (usually) near the top of the file you’ll see an item named
scopeName
, and that’s the value you are looking for that you’ll need for theinclude
section of the fenced-code bit. The scopeName for language-latex would betext.tex.latex
.Latex will be added in an upcoming version though. I’ve recently added support for inline math, and it’s part of that. If you need help with any other languages, feel free to open a new issue, point me to the language-packages, and it should be in the next version.