@@ -23,13 +23,14 @@ const depfiles = joinpath.(_pkg_assets, depnames)
23
23
const styles_css = joinpath (_pkg_assets, " styles.css" )
24
24
25
25
function slideshow (inputfile, outputdir = dirname (inputfile);
26
- documenter = true , css = styles_css, options = Dict ())
26
+ title = " Title" , documenter = true , css = styles_css, options = Dict ())
27
+
27
28
inputfile = realpath (abspath (inputfile))
28
29
outputdir = realpath (abspath (outputdir))
29
30
css = realpath (abspath (css))
30
31
mkpath .(joinpath .(outputdir, (" src" , " build" )))
31
32
mk_file = _create_index_md (inputfile, outputdir; documenter = documenter)
32
- _create_index_html (outputdir, mk_file, options)
33
+ _create_index_html (outputdir, mk_file, options; title = title )
33
34
cp (css, joinpath (outputdir, " build" , " styles.css" ), force= true )
34
35
rm (mk_file)
35
36
return outputdir
@@ -65,16 +66,20 @@ function _create_index_md(inputfile, outputdir; documenter = true)
65
66
end
66
67
67
68
68
- function _create_index_html (outputdir, md_file, options = Dict ())
69
+ function _create_index_html (outputdir, md_file, options = Dict (); title = " Title " )
69
70
70
71
Base. open (joinpath (outputdir, " build" , " index.html" ), " w" ) do f
71
72
template = Base. open (joinpath (_pkg_assets, " indextemplate.html" ))
72
73
for line in eachline (template, keep= true )
73
- if occursin (r" ^(\s )*sfTiCgvZnilxkAh6ccwvfYSrKb4PmBKK" , line)
74
+ if occursin (r" \$ title" , line)
75
+ title_line = replace (line, r" \$ title" => title)
76
+ write (f, title_line)
77
+ elseif occursin (r" \$ presentation" , line)
74
78
copytobuffer! (f, md_file)
75
- elseif occursin (r" ^( \s )*11JoqONykUJUYw2d2zoMrKzXIOIdQP83 " , line)
79
+ elseif occursin (r" \$ options " , line)
76
80
optionsjs = JSON. json (options)
77
- write (f, " var options = $optionsjs ;\n " )
81
+ option_line = replace (line, r" \$ options" => optionsjs)
82
+ write (f, option_line)
78
83
else
79
84
write (f, line)
80
85
end
0 commit comments