GLSL live-coding environment with web viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
606 B

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. from json import dumps
  4. from os import listdir
  5. from subprocess import check_call
  6. with open('web_source.go', 'w') as fp:
  7. print('package main', file=fp)
  8. print('// Automatically generated, do not edit', file=fp)
  9. print('var webSource = map[string]string{', file=fp)
  10. for fname in listdir('web'):
  11. s = dumps(open('web/' + fname).read()).rstrip()
  12. path = '' if fname == 'index.html' else fname
  13. print('\t"/', path, '": ', s, ',', sep='', file=fp)
  14. print('}', file=fp)
  15. check_call(['go', 'fmt', 'web_source.go'])