Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Use fenced code metadata to annotate both file location and language #30

Closed
3 tasks
trek opened this issue Mar 5, 2015 · 8 comments · Fixed by #35
Closed
3 tasks

Use fenced code metadata to annotate both file location and language #30

trek opened this issue Mar 5, 2015 · 8 comments · Fixed by #35

Comments

@trek
Copy link
Member

trek commented Mar 5, 2015

From the common mark spec:

The line with the opening code fence may optionally contain some text following the code fence; this is trimmed of leading and trailing spaces and called the info string. The info string may not contain any backtick characters. (The reason for this restriction is that otherwise some inline code would be incorrectly interpreted as the beginning of a fenced code block.)

Where we annotate the code's language

```javascript
var someCode;

We can annotate filename and extension:

```app/templates/foo.hbs
{{rock-on}}

We have a custom highlighter that outputs particular markup/styles for specific languages.

A PR that addresses this Issue will:

  • continue to detect bare named language fences
  • begin to detect language name from file path fences
  • output nice markup/style that decorates an HTML code block something that shows file location

@danmcclain has a sample markup/design

@nicolechung
Copy link
Contributor

Should I update my current PRs to the guide, or wait until this new change has been made?

@trek
Copy link
Member Author

trek commented Mar 5, 2015

I'd update current PRs and Issue this can be a blocker for merging those

@danmcclain
Copy link
Contributor

@trek Anyone covering the new custom highlighter? If not, I can take a stab at it, seems reasonable. We're going to really need to detect 2 different file types, js and hbs, right? Or are there css and html fences needed too?

@rwjblue
Copy link
Member

rwjblue commented Mar 6, 2015

@danmcclain - Its all yours :)

@danmcclain
Copy link
Contributor

@rwjblue Can you confirm file types in guides? I'll try to get something in place this weekend

@rwjblue
Copy link
Member

rwjblue commented Mar 6, 2015

@danmcclain .hbs, .js, and .html should cover 90% of what we need, but it is possible that we want .css at some point also...

@joostdevries
Copy link
Contributor

And considering the CLI portion, .json might also be a good idea (package.json, bower.json). Apart from files, any way we can illustrate command-lines?

@nicolechung
Copy link
Contributor

For the JS files, is it going to be in this format?

```app/components/my-component.js
// javascript goes here

NVM...just read the commit. Updating now.

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

Successfully merging a pull request may close this issue.

5 participants