-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Doc] Use Markdown syntax highlighting #12053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you do it for other components as well ? |
I've grep-ed and haven't found other |
@lologhi all component readmes are including a code-block (which currently does not use the fenced code blocks at all, which is why grepping has not found them) |
You're good =) I'm on it ! |
test. | ||
|
||
Before: | ||
|
||
``` | ||
```twig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
twig
won't be highligted. Should we use jinja
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the library used by GitHub to highlight code supports Twig, this could be easily added to GitHub. I've just requested them to add support for twig
highlighting and all of you can do the same at https://github.com/contact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub has responded to my question: twig
doesn't work because they use the Pygments library and it's not supported yet.
There is an issue in the Pygments repository for adding Twig. Please vote for it to get more attention: https://bitbucket.org/birkenfeld/pygments-main/issue/927/missing-lexer-for-twig-language
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz linguist is not about highlighting, but about guessing the highlighting for files. As you can see in the code you linked, linguist does the same: it uses the jinja highlighter for .twig files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof you are right. I was confused by this sentence of the official GitHub documentation:
We use Linguist to perform language detection and syntax highlighting.
Source: https://help.github.com/articles/github-flavored-markdown#syntax-highlighting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fabpot agreed to switch Markdown files because of the upcoming standard. I can switch twig
in jinja
but it would be following GitHub standard ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lologhi the standard says that whatever comes after the backticks is the language used by the highlighting. Using jinja is fine, given it allows it to be supported while twig is not. We also use the jinja highlighting in the rST of symfony-doc (well, except that we registered twig
as an alias for jinja
to make it easier, given that the doc is rendered on a server for which the config can be tweaked)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ! I'll push an update soon.
Le 29 sept. 2014 à 18:58, Christophe Coevoet notifications@github.com a écrit :
In UPGRADE-2.1.md:
test. Before:
@lologhi the standard says that whatever comes after the backticks is the language used by the highlighting. Using jinja is fine, given it allows it to be supported while twig is not. We also use the jinja highlighting in the rST of symfony-doc (well, except that we registered twig as an alias for jinja to make it easier, given that the doc is rendered on a server for which the config can be tweaked)
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof if we can make Twig enter the list of template languages supported by Pygments, we'll be able to also use twig
highlighting in Symfony doc.
To support this, please vote on this issue: https://bitbucket.org/birkenfeld/pygments-main/issue/927/missing-lexer-for-twig-language or help use review and finish this pull request: https://bitbucket.org/birkenfeld/pygments-main/pull-request/404/first-attempt-of-creating-a-twig-lexer/diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already voted on it
@fabpot : I don't understand why you closed it without any explanation :/ Le 1 oct. 2014 à 07:41, Fabien Potencier notifications@github.com a écrit :
|
It has been merged now, but as I squashed the commits into one, Github cannot detect that it was a merge. But have a look at the code and you will see your changes, no worries :) |
Yeah ! So happy to finally be a little contributor \o/ |
Damn, I was thinking that with your squash... will I appear in the contributor list ? Or get my Sensio Connect badge ? |
Oups, sorry, I was a bit excited... |
@lologhi updating the list of Symfony contributors takes some time, but the badge should be granted in about 24 hours. If you don't receive it, please contact me and I'll take care of it. And thanks for helping us improve Symfony! |
A clean version of the #11999