Skip to content

Template

Habib Rohman edited this page Feb 11, 2021 · 1 revision

Template for message

Since most of the feeds contain web elements, telegram-rss will send the message with parse_mode=HTML.

Template location

Template file is located at telegram-rss/template.html. template.html is loaded using jinja2, Learn more.

Default template

Default template is

<a href="{{ entry.link }}">{{ entry.safe_title }}</a>
<i>{{ author }}</i>: <b>{{ entry.author }}</b>
{{ entry.safe_description }}
<i>{{ source }}</i>: <a href="{{ channel.link }}">{{ channel.safe_title }}</a>

Supported tags

<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<u>underline</u>, <ins>underline</ins>
<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
<b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
<a href="http://www.example.com/">inline URL</a>
<a href="tg://user?id=123456789">inline mention of a user</a>
<code>inline fixed-width code</code>
<pre>pre-formatted fixed-width code block</pre>
<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>

Please note:

  • Only the tags mentioned above are currently supported.
  • All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
  • All numerical HTML entities are supported.
  • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.
  • Use nested pre and code tags, to define programming language for pre entity.
  • Programming language can't be specified for standalone code tags.
Clone this wiki locally