Replies: 1 comment
-
Looking at how some models do it when writing their own code blocks, I use triple back-ticks (seems to be called the "Grave Accent" in Unicode) before the first line and after the last line; it's important to note those are not the same character as the apostrophe (that's also called single-quote) which is used to denote strings in languages like Python (can also be tripled for multi-line strings, and is interchangeable with regular double-quotes in python, as long as you make sure you use the same type for opening and closing the string; and on a further side-note, curly quotes (of both single and double varieties) usually aren't understood by most programing languages I think). Kinda hard to show here because Github also interprets the symbol, couldn't figure out howto get the examples in-line above without messing up formatting; but it's like this:
And for just mentioning commands and stuff inside phrases, you just use the back-ticks like quotes; like:
With many, they also seem to often specify the language used in multi-line blocks by naming the language in lowercaps as a suffix to the starting triple back-ticks:
This seems to help to hint syntax highlighting systems to highlight the code correctly. ps: Here in Github, to make it the backticks show I had to add 4 spaces at the beginning of the line, which is how code blocks are usually denoted in markdown formatting. Actually, looking at the Github docs to double-check things, seems I could've done it with 4 back-ticks above and bellow instead of starting each line with 4-spaces, and 3 back-ticks is how you write code-blocks on Github nowadays; not sure if 4-spaces is deprecated or documented elsewhere. pps: Btw, be careful not confuse it with curly quotes (which sometimes are just font features but other times also actual separate characters, and many other international quote characters and similarly-shaped characters officially used for other purposes; I have no idea how many LLMs will react to those. Oh, and the apostrophe mentioned is the ASCII one, looks like there are some other apostrophes elsewhere on Unicode.... |
Beta Was this translation helpful? Give feedback.
-
Bit like how the response gives code in code tags.. how to provide the same input for code examples being mentioned?
Beta Was this translation helpful? Give feedback.
All reactions