Skip to content
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

Auto-detect the language in code blocks with no language specified #218

Closed
jeeftor opened this issue Apr 30, 2015 · 4 comments
Closed

Auto-detect the language in code blocks with no language specified #218

jeeftor opened this issue Apr 30, 2015 · 4 comments

Comments

@jeeftor
Copy link

jeeftor commented Apr 30, 2015

Now that Swift can use markdown in the documentation it would be great if we could do code highlighting in the jazzydoc. For example there is a picture. It would be great if there was syntax highlighting coloring for swift in there.

screen shot 2015-04-30 at 9 24 17 am

So it looks like there is basically an almost there thing for this:

<pre class="highlight plaintext"><code>func newAHRSMessageHandler(notif : NSNotification) {
 println(notif.asAHRSMessage!)
}
</code></pre>

I realize that maybe this would be problematic because inside of the swift documentation format the markdown can't really say whether it should be syntax highlighted or not so ... maybe there isn't really a way to get this working - although I would think that anytime you are adding a code block you are probably ALWAYS doing swift code...

@segiddins
Copy link
Collaborator

Just mark the code block as swift and it should be syntax highlighted

@jeeftor
Copy link
Author

jeeftor commented Apr 30, 2015

But doing so doesn't render correctly in Xcode

@jpsim jpsim changed the title Colored syntax highlighting Auto-detect the language in code blocks with no language specified Apr 30, 2015
@jpsim
Copy link
Collaborator

jpsim commented Apr 30, 2015

But doing so doesn't render correctly in Xcode

That's a good point! I've renamed the issue to be a feature request to automatically detect the language in code blocks with no language specified.

@johnfairh
Copy link
Collaborator

#930 added this to jazzy. Xcode seems to tolerate marking code blocks with languages now too anyway.

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

No branches or pull requests

5 participants