Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 628a726

Browse files
committed
Introduce a python script to apply template
1 parent 357fceb commit 628a726

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

template.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/python
2+
3+
"""
4+
Use like this:
5+
6+
pbpaste | python template.py > litmus_text/example.md
7+
8+
to produce a modified copy of the template.
9+
"""
10+
11+
import sys
12+
13+
source_code_lines = sys.stdin.read().strip().split("\n")
14+
15+
for line in open("template.md"):
16+
line = line.strip()
17+
if line == "rust source code":
18+
for source_code_line in source_code_lines:
19+
print source_code_line
20+
else:
21+
print line

0 commit comments

Comments
 (0)