Skip to content

[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

Closed
wants to merge 7 commits into from
Closed

[Doc] Use Markdown syntax highlighting #12053

wants to merge 7 commits into from

Conversation

lologhi
Copy link
Contributor

@lologhi lologhi commented Sep 26, 2014

A clean version of the #11999

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@stof
Copy link
Member

stof commented Sep 26, 2014

Can you do it for other components as well ?

@lologhi
Copy link
Contributor Author

lologhi commented Sep 26, 2014

I've grep-ed and haven't found other .md files needing this update...

@stof
Copy link
Member

stof commented Sep 26, 2014

@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)

@lologhi
Copy link
Contributor Author

lologhi commented Sep 26, 2014

You're good =) I'm on it !

test.

Before:

```
```twig
Copy link
Contributor

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?

Copy link
Member

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

Copy link
Member

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

Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor Author

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 ?

Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

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

@lologhi
Copy link
Contributor Author

lologhi commented Sep 29, 2014

Nice Twig for happy devs :)

screenshot from 2014-09-29 21 08 24

@fabpot fabpot closed this Oct 1, 2014
@lologhi
Copy link
Contributor Author

lologhi commented Oct 1, 2014

@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 :

Closed #12053.


Reply to this email directly or view it on GitHub.

@fabpot
Copy link
Member

fabpot commented Oct 1, 2014

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 :)

@lologhi
Copy link
Contributor Author

lologhi commented Oct 1, 2014

Yeah ! So happy to finally be a little contributor \o/
Thanks !

@lologhi
Copy link
Contributor Author

lologhi commented Oct 1, 2014

Damn, I was thinking that with your squash... will I appear in the contributor list ? Or get my Sensio Connect badge ?

@jakzal
Copy link
Contributor

jakzal commented Oct 1, 2014

@lologhi yes, you will. You're still the author of the squashed commit (see 638ce84).

@lologhi
Copy link
Contributor Author

lologhi commented Oct 1, 2014

Oups, sorry, I was a bit excited...

@javiereguiluz
Copy link
Member

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants