Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

example of source code with language specification #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NelleV
Copy link
Collaborator

@NelleV NelleV commented Sep 24, 2017

Added a small example of source code with language specification (mostly to make sure I understand the spec).

I'm very excited about this! It'll make sphinx-gallery conversion to notebooks much more easy (right now, it actually doesn't work properly).

README.md Outdated
* Triple-backticks blocks with optional language header for source code blocks
(from Github-flavored Markdown):

```{r}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curly braces are not needed here, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. That's how it's done in rmarkdown.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just commented on the same - that seems to be an Rmd quirk, it's not how GFM does it.

@@ -40,6 +40,10 @@ A few areas of reST have been restricted or modified:

* Triple-backticks blocks with optional language header for source code blocks (from GitHub-flavored Markdown)

```{r}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the curly braces? I think the GFM spec for code blocks doesn't include them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess rmarkdown extends this to be able to add options:

{r fig.width=12, cache=FALSE, echo=TRUE}

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 this pull request may close these issues.

3 participants