0

I am writing a README.md for a program that I am developing at work. I would like it to be shown at the program's GitLab repository page. The program automatically prints files that are in given folder and then moves them to another folder. I developed a simple gitignore-like function that makes some of the files (specified in a file called .printignore) being ignored. I wanted to write some examples on how to structure the .printignore file to the README.md file.

I know I can write, for example, js or python right after the opening ``` to use the syntax for a specific language. However, I am unable to find out how the gitignore-like language is called. I could use some other language that formats at least comments, but if it is possible I would rather not.

Does the marking language of .gitignore and .dockerignore have some specific name? Is it possible to tell the markdown language to use its syntax?

Vaclav Pelc
  • 582
  • 6
  • 20
  • 1
    The answer likely depends on which tool you are using. Not all tools use the same naming conventions, or even support all of the same "languages." Ideally, you could provide us with the name of the syntax highlighting library, although, if you know that, you could just look at that website to find the answer yourself. If you are not sure which syntax highlighter is being used, then perhaps you could start with which Markdown implementation you are using and what options, if any, you have enabled. – Waylan Nov 18 '20 at 21:11
  • 1
    A possible duplicate is [How can I highlight .gitignore code for my README.md?](https://stackoverflow.com/q/52402063/866026), which specifically relates to Linguist, the ruby library used on GitHub. Of course, if you are using a different tool, then the answer may be different. – Waylan Nov 18 '20 at 21:22
  • @Waylan I found the documentation for GitLab implementation of syntax highlighting in the Markdown code. I didn't know the name of the .gitignore "language" and I wasn't able to find it. Therefore, I couldn't determine whether the language was there or not. However, the link in your second comment provides a clear answer and a suggestion to use syntax highlighting for `sh`. I will go with that. Thank you for your help. – Vaclav Pelc Nov 25 '20 at 21:30

0 Answers0