-
-
Notifications
You must be signed in to change notification settings - Fork 83
Custom Format Examples
Yu-Cheng Chuang edited this page Aug 30, 2024
·
10 revisions
NOTE: this feature is supported on v3.1.0 or later.
Template in Mustache language.
Example Input: List of links without grouping
{
"links": [
{ "title": "Example 1", "url": "https://example.com/1", "number":1 },
{ "title": "Example 2", "url": "https://example.com/2", "number":2 },
{ "title": "Example 3", "url": "https://example.com/3", "number":3 },
{ "title": "Example 4", "url": "https://example.com/4", "number":4 }
],
"grouped":[
{ "title": "Example 1", "url": "https://example.com/1", "number":1, "isGroup": false, "links": [] },
{ "title": "Example 2", "url": "https://example.com/2", "number":2, "isGroup": false, "links": [] },
{ "title": "Example 3", "url": "https://example.com/3", "number":3, "isGroup": false, "links": [] },
{ "title": "Example 4", "url": "https://example.com/4", "number":4, "isGroup": false, "links": [] }
]
}
Example Input: List of links with grouping
{
"links": [
{"title": "Example 1", "url": "https://example.com/1", "number": 1},
{"title": "Example 2", "url": "https://example.com/2", "number": 2},
{"title": "Example 3", "url": "https://example.com/3", "number": 3},
{"title": "Example 4", "url": "https://example.com/4", "number": 4},
{"title": "Example 5", "url": "https://example.com/5", "number": 5},
{"title": "Example 6", "url": "https://example.com/6", "number": 6},
{"title": "Example 7", "url": "https://example.com/7", "number": 7}
],
"grouped": [
{"title": "Example 1", "url": "https://example.com/1", "isGroup": false, "number": 1, "links": []},
{"title": "Example 2", "url": "https://example.com/2", "isGroup": false, "number": 2, "links": []},
{
"title": "Group 1", "url": null, "isGroup": true, "number": 3,
"links": [
{"title": "Example 3", "url": "https://example.com/3", "isGroup": false, "number": 1, "links": []},
{"title": "Example 4", "url": "https://example.com/4", "isGroup": false, "number": 2, "links": []},
{"title": "Example 5", "url": "https://example.com/5", "isGroup": false, "number": 3, "links": []}
]
},
{"title": "Example 6", "url": "https://example.com/6", "isGroup": false, "number": 4, "links": []},
{"title": "Example 7", "url": "https://example.com/7", "isGroup": false, "number": 5, "links": []}
]
}
{{#links}}
- [{{title}}][{{number}}]
{{/links}}
{{#links}}
[{{number}}]:{{url}}
{{/links}}
- [Example 1][1]
- [Example 2][2]
- [Example 3][3]
[1]:https://example.com/1
[2]:https://example.com/2
[3]:https://example.com/3
Use {{number}}
for the current 1-based index of nesting.
Note that, according to Markdown spec, nested items must have leading spaces + 1 more than the leading texts of its parent. For example, if the parent is 10.
, then its child should have four leading spaces, e.g. 1.
, because 10.
is three characters. If you are sure that you will not export more than 100 tabs in a group, use 4 leading spaces.
{{#grouped}}
{{#isGroup}}
{{#links}}
{{number}}. [{{title}}]({{url}})
{{/links}}
{{/isGroup}}
{{^isGroup}}
{{number}}. [{{title}}]({{url}})
{{/isGroup}}
{{/grouped}}
1. [Example 1](https://example.com/1)
2. [Example 2](https://example.com/2)
3. My Group
1. [Example 3](https://example.com/3)
2. [Example 4](https://example.com/4)
4. [Example 5](https://example.com/5)
5. [Example 6](https://example.com/6)
Commonly used on some hacker-friendly news websites...
{{#links}}[{{@index}}]{{/links}}
{{#links}}
[{{@index}}]:{{url}}
{{/links}}
[0][1][2][3]
[0]:https://example.com/1
[1]:https://example.com/2
[2]:https://example.com/3
[3]:https://example.com/4
{{#links}}
+ [[{{url}}][{{title}}]]
{{/links}}
+ [[https://example.com/1][Example 1]]
+ [[https://example.com/2][Example 2]]
+ [[https://example.com/3][Example 3]]
+ [[https://example.com/4][Example 4]]
{{#links}}
* [{{url}} {{title}}]
{{/links}}
* [https://example.com/1 Example 1]
* [https://example.com/2 Example 2]
* [https://example.com/3 Example 3]
* [https://example.com/4 Example 4]