Adrian Brandemuehl | 7228854 | 2018-08-15 20:23:27 -0700 | [diff] [blame] | 1 | """Converts a markdown file to an html file. |
| 2 | |
| 3 | Given the src "xyz.md", produces "xyz.html". |
| 4 | |
| 5 | Attrs: |
| 6 | src: Markdown file to convert. Only one file can be specified. |
| 7 | """ |
| 8 | |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 9 | def pandoc_html(name, src, target_compatible_with = None): |
Adrian Brandemuehl | 7228854 | 2018-08-15 20:23:27 -0700 | [diff] [blame] | 10 | 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 Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 18 | target_compatible_with = target_compatible_with, |
Adrian Brandemuehl | 7228854 | 2018-08-15 20:23:27 -0700 | [diff] [blame] | 19 | ) |