Reputation: 1521
I am trying to post a sample solution, written in Python, to rosalind.info
.
I tried following their instructions:
To highlight code, add a shebang styled first line :::lexername to your code. Replace lexername with the lexer keyword for the language that you want to be highlighted as shown in the list of Pygments lexers."
However, I can't get it to work.
I have tried setting the first line to:
:::python
:::PythonLexer
#!:::python
#!:::PythonLexer
but it just appears as ordinary text.
Upvotes: 3
Views: 473
Reputation: 41
Two ways that worked for me were:
#! python
or :::python
.#! python
or:::python
.As mentioned before by others, you need to "Submit" before you see the fully formatted result.
Upvotes: 0
Reputation: 599
It seems your first attempt was correct, but you did not click the 'Submit' button to view your code with the lexer applied.
In order to see the code with syntax highlighting, you must first submit your response. The WYSIWYG editor provided below the markdown box does not perform syntax highlighting. In order to see your code with proper highlighting you would type something like the following into the box.
:::python
print "Hello World"
which will look something like
print "Hello World"
once you click the 'Submit' button and view your response. You will have the option to edit your submission if you want to change things later.
Joshua's answer has linked you to the place where you can determine which lexer name you want to use. Simply choose type the corresponding 'short name' for the highlighting you would like to apply.
Upvotes: 2
Reputation: 581
You could try
#!:::python3
Source: http://pygments.org/docs/lexers/
Upvotes: 0