Skip to content
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.

Is CSS for language syntax highlighting inside Fenced Code Blocks available? #62

Closed
dmitshur opened this issue Jun 20, 2016 · 3 comments

Comments

@dmitshur
Copy link

dmitshur commented Jun 20, 2016

Hi,

If I understand correctly, this repository looks like the CSS to support (GitHub Flavored) Markdown, and includes the CSS for things like headers, lists, tables, images, links, spacing and so on. That's great!

Does it also include CSS for syntax highlighting of languages inside Fenced Code Blocks? For example, if I render the following Markdown document using the raw Markdown rendering API endpoint:

Hello **world**.

```diff
+added
-removed
```

```Go
err := http.ListenAndServe(":8080", mux)
```

Which can be done using the following curl command:

$ curl -X POST -H 'Content-Type: text/x-markdown' https://api.github.com/markdown/raw -d $'Hello **world**.

```diff
+added
-removed
```

```Go
err := http.ListenAndServe(":8080", mux)
```
'

The response is:

<p>Hello <strong>world</strong>.</p>

<div class="highlight highlight-source-diff"><pre><span class="pl-mi1">+added</span>
<span class="pl-md">-removed</span></pre></div>

<div class="highlight highlight-source-go"><pre><span class="pl-smi">err</span> <span class="pl-k">:=</span> http.<span class="pl-c1">ListenAndServe</span>(<span class="pl-s"><span class="pl-pds">"</span>:8080<span class="pl-pds">"</span></span>, mux)</pre></div>

Does this repository contain the neccessary CSS to style those classes such as pl-mi1, pl-md, pl-c1, pl-s, etc., to be able to render that Markdown to look like the following:


Hello world.

+added
-removed
err := http.ListenAndServe(":8080", mux)

If not, is it available somewhere else? Is it going to be available in the future?

Thank you!

@dmitshur dmitshur changed the title Is CSS for language highlighting available? Is CSS for language highlighting inside Fenced Code Blocks available? Jun 20, 2016
@dmitshur dmitshur changed the title Is CSS for language highlighting inside Fenced Code Blocks available? Is CSS for language syntax highlighting inside Fenced Code Blocks available? Jun 20, 2016
@jonrohan
Copy link
Member

Does it also include CSS for syntax highlighting of languages inside Fenced Code Blocks?

Yes, actually there were just made available here https://github.com/primer/github-syntax-light.

@dmitshur
Copy link
Author

Thanks!

@jonrohan
Copy link
Member

Just realized my answer might not be clear. Yes, this repository is the markdown styling we use on github.com. No it doesn't automatically include the code highlighting. Yes, it's available https://github.com/primer/github-syntax-light

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

No branches or pull requests

2 participants