generator md: Capture output of markdown
This commit is contained in:
		
							
								
								
									
										7
									
								
								qsgen2
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								qsgen2
									
									
									
									
									
								
							@@ -153,12 +153,15 @@ elif [[ ${generator} == "markdown" ]]; then
 | 
			
		||||
    else
 | 
			
		||||
        # Usage: ${engine} ${1} - Where 1 is the file you want parsed
 | 
			
		||||
        function engine() {
 | 
			
		||||
          typeset -g "$1"="$2"
 | 
			
		||||
          # typeset -g "$1"="$2"
 | 
			
		||||
  
 | 
			
		||||
          local command="/usr/bin/markdown"
 | 
			
		||||
          local c-opts="-d -n -s"
 | 
			
		||||
  
 | 
			
		||||
          eval "$1=\$(< <($(command) $c-opts \"${(P)1}\"))"
 | 
			
		||||
          local result=$($(command) ${c-opts} "${(P)1}")
 | 
			
		||||
          
 | 
			
		||||
          # Assign the output to the global variable named by $1
 | 
			
		||||
          eval "$1=\${result}"
 | 
			
		||||
  
 | 
			
		||||
          # echo "${(P)1}"
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user