JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
825 stars 95 forks source link

Missing markdown output with YAML header #304

Closed michakraus closed 4 years ago

michakraus commented 4 years ago

I am trying to create some slides using Weave.jl and Remark.jl. When I have a YAML header, I am missing slides in the markdown output. For example, weaving the file

---
title: "myTitle"
author: "myAuthor"
---

# myTitle

## mySubtitle

myAuthor

myDate

---

## Hello World

```julia
println("Hello")

with

Weave.weave("test.jmd", out_path = "build", doctype = "github")


produces the output

Hello World

println("Hello")
Hello

When removing the YAML header,

myTitle

mySubtitle

myAuthor

myDate


Hello World

println("Hello")

the output contains both slides

myTitle

mySubtitle

myAuthor

myDate


Hello World

println("Hello")
Hello


I am using Julia v1.4.0 and Weave v0.9.4.
aviatesk commented 4 years ago

dup of https://github.com/JunoLab/Weave.jl/issues/197

michakraus commented 4 years ago

This is not a dup of #197. The problem is not that the header is stripped, but that the piece between the header and ## Hello World is stripped.

aviatesk commented 4 years ago

ah I see. I just found the existing header striping logic is kinda awful and now trying to fix this, but lets's keep this open until it's solved.

michakraus commented 4 years ago

It seems adding an empty julia block to the first slide works around this issue, i.e.,

---
title: "myTitle"
author: "myAuthor"
---

```julia

myTitle

mySubtitle

myAuthor

myDate


Hello World

println("Hello")

produces correct results.