diff --git a/sourcing/static/css/style.css b/sourcing/static/css/style.css new file mode 100644 index 0000000..2baf1d1 --- /dev/null +++ b/sourcing/static/css/style.css @@ -0,0 +1,4 @@ +.highlight { + padding: 2px; + background: yellow; +} diff --git a/sourcing/templates/head.html b/sourcing/templates/head.html index 1024ef2..726071d 100644 --- a/sourcing/templates/head.html +++ b/sourcing/templates/head.html @@ -7,6 +7,7 @@
{{ line }}
- {%- endfor -%} + {% if span_start and span_length %} + {%- for start, line in add_highlight(doc.text, span_start, span_length) if line -%} ++ {% for i in line %} + {%- if i.highlight -%} + {{- i.highlight -}} + {%- else -%} + {{- i.text -}} + {%- endif -%} + {% endfor %} +
+ {%- endfor -%} + {% else %} + {%- for start, line in iter_lines(doc.text) if line -%} +{{ line }}
+ {%- endfor -%} + {% endif %}span:
- {% set scripts %} - - - {% endset %} {% endif %}