blob: ad47ccc92910b28922884cd1837feedd5dea8186 [file] [log] [blame]
Adrian Brandemuehl72288542018-08-15 20:23:27 -07001"""Converts a markdown file to an html file.
2
3Given the src "xyz.md", produces "xyz.html".
4
5Attrs:
6 src: Markdown file to convert. Only one file can be specified.
7"""
8
Philipp Schraderdada1072020-11-24 11:34:46 -08009def pandoc_html(name, src, target_compatible_with = None):
Adrian Brandemuehl72288542018-08-15 20:23:27 -070010 output = name + ".html"
11 native.genrule(
12 name = name,
13 srcs = [src],
14 outs = [output],
15 cmd = "$(location @pandoc//:pandoc_wrapper) -s $< -o $@",
16 tools = ["@pandoc//:all_files", "@pandoc//:pandoc_wrapper"],
17 executable = True,
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = target_compatible_with,
Adrian Brandemuehl72288542018-08-15 20:23:27 -070019 )