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

Books.gen only looks for code in md files under contents folder #72

Closed
findmyway opened this issue Apr 4, 2021 · 4 comments · Fixed by #100
Closed

Books.gen only looks for code in md files under contents folder #72

findmyway opened this issue Apr 4, 2021 · 4 comments · Fixed by #100

Comments

@findmyway
Copy link
Member

I'm not sure if this is intentional. The code snippets included in the index.md file are ignored. It seems

https://github.com/rikhuijzer/Books.jl/blob/f14573f4b614959e4aec5e908cd68738f303fd5d/src/generate.jl#L140

doesn't take the index.md into account.

@rikhuijzer
Copy link
Collaborator

It is sort of intentional, yes. The index.md contents are not shown in the PDF, so I didn't think it would be important to run the code from it via Books.gen. This is based on the index pages for R books, such as https://adv-r.hadley.nz/. At those pages, Hadley Wickham also doesn't show generated content on the front page.

However, it might be a good idea to allow it. What kinds of things do you want to show at the front page?

@findmyway
Copy link
Member Author

I see. I was to add an instruction on which version of Julia the book is built with. Never mind, I can just hard code it there.

@rikhuijzer
Copy link
Collaborator

I see. I was to add an instruction on which version of Julia the book is built with. Never mind, I can just hard code it there.

But then the Julia version is not reported in the PDF. Still, there are probably situations where this issue is a good idea, so I might still implement it later.

By the way, today I was working on my own book and realized that showing code blocks and the output was super cumbersome. Checkout the newest version for some (I think) awesome changes! You can use _gen/foo_bar-sco.md now to show code and output. See the docs for more info.

@findmyway
Copy link
Member Author

Pretty nice!

@rikhuijzer rikhuijzer changed the title Books.gen only looks for codes in md files under contents folder Books.gen only looks for code in md files under contents folder Apr 6, 2021
@rikhuijzer rikhuijzer reopened this Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants