Some further ideas …
I am refining my own composition workflow using templates as follows …
First install pandoc to make pandoc cli accessible in Atom scripts.
Create a folder for each html page to be created from concatenated templates.
Inside each folder create a number of templates (one template might be a block of scripts, another template might be a div block of content and so on). My templates are written as markdown files. (template01.md, template02.md and so on). However fragments can be written as html blocks.
Inside each folder include a python script compose.py which is as follows … the array of args will expand to as many as required to be concatenated into a single output.html file.
# define fragments
arg1 = ‘pandoc’
arg2 = ‘-s’
arg3 = 'template1.md'
arg4 = 'template2.md'
arg5 = '-o'
arg6 = 'output.html'
# Set up the echo command and direct the output to a pipe
p1 = subprocess.Popen([arg1, arg2, arg3, arg4, arg5, arg6], stdout=subprocess.PIPE)
# Run the command
output = p1.communicate()
Note: see amended advice in next post not to use -s option which injects more pandoc html code than might be needed.
process-palette to compose.py we can compose the output.html.
Now note also that pandoc allows custom templates to be incorporated into the compose.py script.
Here for example is a bootstrap template.
Note that the compose.py script will need to be changed to add new args to the args array.
I have not developed ideas for the stated requirement to protect templates. But I would look at setting file template read/write permissions so that only admin user can effect changes to templates. As a sole developer I don’t have such authentication issues. But I can see that it is important in a multi-user setup. There is an Atom package
chmod which might be useful.
[P.S.] Be aware of the many other options available in pandoc commands. For example reveal.js presentations can be created and different output formats can be generated.