File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 33# Version of the quarto package
44__version__ = "0.1.0"
55
6+ from quarto .quarto import path
67from quarto .render import render
78from quarto .metadata import metadata
Original file line number Diff line number Diff line change 11
22import sys
3+ import json
4+ import subprocess
5+
6+ from quarto .quarto import find_quarto
37
48def metadata (input ):
5- print ("render" , file = sys .stdout )
9+ args = ["metadata" , input , "--json" ]
10+ metadata_json = subprocess .check_output ([find_quarto ()] + args )
11+ return json .loads (metadata_json )
12+
13+
Original file line number Diff line number Diff line change 1+
2+ import os
3+ import sys
4+ import shutil
5+ import subprocess
6+
7+ def path ():
8+ path_env = os .getenv ("QUARTO_PATH" )
9+ if path_env is None :
10+ return shutil .which ("quarto" )
11+ else :
12+ return path_env
13+
14+
15+ def find_quarto ():
16+ quarto = path ()
17+ if quarto is None :
18+ raise FileNotFoundError ('Unable to find quarto command line tools.' )
19+ return quarto
Original file line number Diff line number Diff line change 11
22import sys
3+ import subprocess
4+
5+ from quarto .quarto import find_quarto
36
47def render (input ):
5- print ("render" , file = sys .stdout )
8+ args = ["render" , input ]
9+ process = subprocess .Popen ([find_quarto ()] + args )
10+ process .wait ()
11+
12+
You can’t perform that action at this time.
0 commit comments