Answer the question
In order to leave comments, you need to log in
How to beautifully insert code into an article on Habr?
Good afternoon everyone.
Recently wrote an article in the sandbox. This is my first article on Habré. It contains the code that I put in the "code" tag. But when previewing and after publishing, the code still looked like plain text. Can you tell me how to correctly insert the code into the article? Of course, I have an assumption that you need to use third-party editors, such as HabraEditor , but I hope that I screwed up somewhere, and you can get by with a local editor. Thank you!
Answer the question
In order to leave comments, you need to log in
def BuildFileList(path, mask, flist):
import os
lPath = path
lsFiles = os.listdir(lPath)
for f in lsFiles:
fName = path + '\\' + f
if (os.path.isdir(fName)):
BuildFileList(fName, mask, flist)
else:
if (fName.find(mask) >= 0):
flist.append(fName)
and it looks like this pastebin.com/raw.php?i=61WDRBMX
I think it will be clear to you
For example, there is such an option.
And if you want to show code that does not have to litter the place, then you can throw it here , and provide links in the article.
I used the tag when I copied the commands and their output from the console to the article, it retains all the columns and formatting. Try it instead.
Does anyone know when the highlighting for PowerShell will be available? otherwise when I write the code, I have to use perl :-(
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question