pystitch / stitch

Write reproducible reports in Markdown
https://pystitch.github.io
MIT License
441 stars 20 forks source link

Preprocess code chunk arguments #1

Closed TomAugspurger closed 8 years ago

TomAugspurger commented 8 years ago

We need to choose an API for code chunks options.

Currently implemented

```{kernel_name, chunk_name, echo=False, ...}
def f(x): ...

[Pandoc style](http://pandoc.org/MANUAL.html#fenced-code-blocks) `fenced_code_attributes`.
def f(x): ...

[RMarkdown](http://rmarkdown.rstudio.com/authoring_rcodechunks.html) style

notice the lack of a comma between kernel_name and chunk_name

def f(x): ...
```

In all three, the chunk_name argument is optional.

I prefer the first option because it matches Python's syntax and it seems more consistent to always separate with a comma. It's also easier to parse than RMarkdown's syntax, where the kernel and chunk name are not separated by commas, but the rest are.

TomAugspurger commented 8 years ago

Going with option 1, at least for 1.0. Willing to revisit.