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

Markdown support #7

Open
ddavison opened this issue Jul 21, 2014 · 10 comments
Open

Markdown support #7

ddavison opened this issue Jul 21, 2014 · 10 comments

Comments

@ddavison
Copy link
Collaborator

(Already covered in the markdown-preview atom package, but would still be nice for it to be universal)

@ddavison ddavison changed the title MarkDown Preview MarkDown support Jul 21, 2014
@jordanbtucker
Copy link
Contributor

I wrote some support for Markdown to HTML, however, it currently displays HTML in the preview window instead of what the HTML would actually render. This may be useful for some, but I didn't create a PR since I don't think it should be published in this state.

@jordanbtucker
Copy link
Contributor

Another feature to consider when this gets implemented: default syntax highlighting in code blocks based on the file extension(s). For example:

File extension Default grammar for code blocks without fence names
.litcoffee, .coffee.md CoffeeScript
.js.md JavaScript
.less.md LESS
.anything.md Grammar associated with .anything

Maybe a port or wrapper of Linguist could be used to auto-detect the grammar of non-fenced code blocks, and if that fails, the grammar based on the file extension will be used.

Example: consider a file named post.html.md

This is a post about HTML. Here's some HTML code:

    <p id=status>
      This page has super cow powers.</p>

Here's some JavaScript:

```js
alert('What is the answer to life the universe and everything?');
```

And some CSS:

    body {
      font-family: 'Comic Sans' !important;
      color: #ff0 !important;
    }

Should render as:

This is a post about HTML. Here's some HTML code:

<p id=status>
  This page has super cow powers.</p>

Here's some JavaScript:

alert('What is the answer to life the universe and everything?');

And some CSS:

body {
  font-family: 'Comic Sans' !important;
  color: #ff0 !important;
}

@batjko
Copy link

batjko commented Jul 28, 2014

@jordanbtucker I don't think people should actually change part of the filenames just for the previewer.

But the usual block code notation would be really helpful:
'''coffeescript
var x = 1
'''

@Glavin001
Copy link
Owner

After #32 this will become a little more difficult to implement, given that the new focus is on source-to-source compilers (transpilers), and will be using an extended EditorView from now on. However, as was done with 5c723c4 to allow for popup message overlays, we can provide an HTML overlay such that language renderers could display more than text and could provide HTML (Spacepen Views) to render -- which would overlay the EditorView when applicable.

@batjko
Copy link

batjko commented Aug 10, 2014

Would this overlay still auto-update upon change of the source file?
If so, I think that actually makes sense, given that Markdown output is not something that you would want to save as its own file or for which you need line numbers etc...

@Glavin001
Copy link
Owner

Exactly! I think this is ideal, too.

Use Marked, I believe is the latest and greatest. I am assuming it supports GitHub Flavoured Markdown, given it is the successor of https://www.npmjs.org/package/github-flavored-markdown

@Glavin001
Copy link
Owner

Would anyone like to contribute and make a PR for this? I am available today to help out, too. If not, I may get started on adding the HTML layer and providing a little API for Preview renderers to use.

@Glavin001 Glavin001 changed the title MarkDown support Markdown support Aug 10, 2014
@Glavin001
Copy link
Owner

@jordanbtucker I am going to look into your PR and implement the HTML overlay for displaying the HTML preview and not the HTML code.

This was referenced Aug 11, 2014
@Glavin001
Copy link
Owner

@DaveEveritt
Copy link

It would make sense to include partial Multimarkdown/PHP Markdown Extra support too (<= see that specific feature request).

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