diff -ur v48/ezmd.py v49/ezmd.py --- v48/ezmd.py 2020-07-16 01:04:06.000000000 +0900 +++ v49/ezmd.py 2020-09-06 21:26:41.000000000 +0900 @@ -215,8 +215,12 @@ ps = ('http', 'https') cmd = 'wget -q -O-' if any( map( lambda p: s.startswith(p + '://'), ps ) ) else 'cat' - if cmd == 'cat' and not os.path.exists(s): # todo - s = '../' + s + if cmd == 'cat' and not os.path.exists(s) and s[0] != '/': + for d in [ '..', os.path.dirname( __file__ ) ]: + t = os.path.join( d, s ) + if os.path.exists( t ): + s = t + break b = subprocess.check_output( cmd + ' ' + s, shell=True ) (s, nkf_opt) = nkf.to_str(b) diff -ur v48/to_html.py v49/to_html.py --- v48/to_html.py 2020-04-05 11:08:00.000000000 +0900 +++ v49/to_html.py 2020-09-06 21:04:23.000000000 +0900 @@ -28,7 +28,17 @@ title = "'{}'".format( title ) title = add_opt( '-t', title ) - fmt = '{} < {} | {} {} {} | {} y > {}' - cmd = fmt.format( cmd_py('ezmd'), body, cmd_py('join_yaml'), title, head, cmd_py('ezhtml'), out ) - cmd_ut.call(cmd) + + ezhtml = cmd_py( 'ezhtml' ) + ' y' + if out.endswith( '.yaml' ) or a.is_pop( '-yaml' ): + ezhtml = 'cat' + if out != '-': + ezhtml += ' > ' + out + + + fmt = '{} < {} | {} {} {} | {}' + cmd = fmt.format( cmd_py('ezmd'), body, cmd_py('join_yaml'), title, head, ezhtml ) + s = cmd_ut.call(cmd) + if out == '-': + sys.stdout.write( s.decode() ) # EOF