Fix CRLF vs. LF for slide separators on windows and everything else

This commit is contained in:
Peter 2021-11-15 14:36:36 +01:00
parent fd73f607d6
commit 2cc48cfbb0
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
4 changed files with 19 additions and 4 deletions

View file

@ -18,8 +18,8 @@
<div class="reveal">
<div class="slides">
<section data-markdown="/content.md"
data-separator="^\n{{ .Reveal.HorizontalSeparator }}\n"
data-separator-vertical="^\n{{ .Reveal.VerticalSeparator }}\n"
data-separator="^{{ .Reveal.LineEnding -}}{{ .Reveal.HorizontalSeparator }}{{- .Reveal.LineEnding }}"
data-separator-vertical="^{{ .Reveal.LineEnding -}}{{ .Reveal.VerticalSeparator }}{{- .Reveal.LineEnding }}"
data-separator-notes="^Note:"
data-charset="iso-8859-15">
</section>
@ -42,8 +42,8 @@
slideNumber: true,
hash: true,
transition: '{{ .Reveal.Transition }}', // none/fade/slide/convex/concave/zoom
navigationMode: '{{ .Reveal.NavigationMode }}',
showSlideNumber: '{{ .Reveal.SlideNumberVisibility }}',
navigationMode: {{ .Reveal.NavigationMode | trim | quote }},
showSlideNumber: {{ .Reveal.SlideNumberVisibility | trim | quote }},
slideNumber: '{{ .Reveal.SlideNumberFormat }}',
markdown: {
smartypants: true,

View file

@ -0,0 +1,8 @@
//go:build !windows
// +build !windows
package rendering
const (
LineEnding string = "\\n"
)

View file

@ -0,0 +1,5 @@
package rendering
const (
LineEnding string = "\\r\\n"
)

View file

@ -32,6 +32,7 @@ var defaultParams = RevealParams{
VerticalSeparator: "---",
SlideNumberVisibility: "all",
SlideNumberFormat: "h.v",
LineEnding: LineEnding,
StyleSheets: make([]string, 0),
FilesToMonitor: make([]string, 0),
}
@ -48,6 +49,7 @@ type RevealParams struct {
StyleSheets []string `mapstructure:"stylesheets"`
FilesToMonitor []string `mapstructure:"filesToMonitor"`
WorkingDirectory string `mapstructure:"working-dir"`
LineEnding string `mapstructure:"-"`
}
func (params *RevealParams) Load() error {