diff -ur v30/ezmd.py v31/ezmd.py --- v30/ezmd.py 2019-10-12 11:36:46.000000000 +0900 +++ v31/ezmd.py 2019-10-12 16:46:42.000000000 +0900 @@ -1,5 +1,6 @@ #!/usr/bin/env python +import subprocess import yaml import six import nkf @@ -202,6 +203,13 @@ v = join_o( tag_new('summary', {}, summary), detail ) return tag_new('details', {}, v) +def text_get(s): + ps = ('http', 'https') + cmd = 'wget -q -O-' if any( map( lambda p: s.startswith(p + '://'), ps ) ) else 'cat' + b = subprocess.check_output( cmd + ' ' + s, shell=True ) + (s, nkf_opt) = nkf.to_str(b) + return s + def do_v1v2(v1, v2): if ' ' in v1: lst = v1.split(' ') @@ -229,6 +237,8 @@ return do_prop(v1, v2) if v1 == 'yaml': return tag_new( 'yaml', {}, yaml.load(v2) ) + if v1 == 'include': + return do_v1v2( 'mode', text_get(v2) ) if v1 == 'mode': outbuf.push_tmp() s_to_tag_lst(v2)