There are two ways to insert code blocks from file In GitPitch: Code Delimiter Slide and GIST Delimiter slide (source: https://github.com/gitpitch/gitpitch/wiki/Code-Presenting). Both of them create a new slide with a code block at the top. Is there a way to insert code from source file making slide more flexible i.e. add some title or another content before the code block? Or it was designed following security reasons?
You have asked a number of questions here so I will try to answer each of them in turn.
Is there a way to insert code from source file making slide more flexible i.e. add some title
Absolutely. You can specify a title
parameter on your code or gist delimiter and that title text will automatically be rendered directly above the code in your slide.
Here is an example of how to do that using a GIST delimiter:
---?gist=onetapbeyond/494e0fecaf0d6a2aa2acadfb8eb9d6e8&lang=Scala&title=Scala Snippet
You can use this exact same approach to inject some title text using a CODE delimiter.
Is there a way to insert code from source file making slide more flexible i.e. ...or another content before
While you can use the title
parameter as just described to inject some title text before your code block, on CODE and GIST delimiter slides you can not add any other content before the code block.
However, you can add any content you want on a CODE or GIST delimiter slide using just regular markdown like you would on any slide following the slide delimiter in your PITCHME.md
.
It is also probably worth pointing out for completeness sake that you can also use GitPitch code-presenting with annotations as a way to add content to your slide. Your annotations will be directly injected onto your slide immediate following your code block.
Finally, to your last question:
Or it was designed following security reasons?
No. As you can see above you can add limited content above (titles) and arbitrary content after your CODE or GIST delimiter code blocks.
You can check out the example Let Your GISTs Do The Talking GitPitch presentation to see these features in action. As with every GitPitch, the markdown source is in the corresponding Git repo.
Thanks for asking this question. I realize that I need to update the Wiki to document the use of the title
parameter on these delimiters.