Skip to content

Commit 205befd

Browse files
committed
Make the Markdown template dynamic
1 parent 6cb75d4 commit 205befd

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/md-to-doc/assets/template.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# Demo
2-
3-
- [Alice likes red green yellow ](http://example.org/alice)
4-
5-
- [Bob likes orange ](http://example.org/bob)
6-
1+
# {{title}}
72

3+
{% for user in users -%}
4+
- [{{ user.username }} likes {% for color in user.fav_colors -%}{{ color }} {% endfor %}]({{ user.url }})
5+
{% endfor %}

tests/md-to-doc/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ OUTPUT_FILE=$OUTPUT_DIR/template.html
99

1010
RUST_BACKTRACE=1 md-to-doc.sh "$(cat $INPUT_DATA)" $INPUT_TEMPLATE $OUTPUT_DIR
1111

12-
STRINGS_TO_CHECK=('<h1>Demo</h1>' '<p><a href="http://example.org/alice">Alice likes red green yellow </a></p>' '<p><a href="http://example.org/bob">Bob likes orange </a></p>')
12+
STRINGS_TO_CHECK=('<h1>Demo</h1>' '<li><a href="http://example.org/alice">Alice likes red green yellow </a></li>' '<li><a href="http://example.org/bob">Bob likes orange </a></li>')
1313

1414
for STRING in "${STRINGS_TO_CHECK[@]}"; do
1515
if ! grep -q "$STRING" "$OUTPUT_FILE" ; then

0 commit comments

Comments
 (0)