Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53d4d40f9f | ||
|
|
c320beaff2 | ||
|
|
a7e283a6f9 | ||
|
|
0a17fc1172 | ||
|
|
ae90606263 | ||
|
|
f4d3786496 | ||
|
|
8241a57d88 | ||
|
|
20f2af6571 |
@@ -185,6 +185,7 @@ zenfeed 提供了超多的自定义配置,还有很多玩法等待你挖掘。
|
||||
|
||||
## 鸣谢
|
||||
* 感谢 [eryajf](https://github.com/eryajf) 提供的 [Compose Inline Config](https://github.com/glidea/zenfeed/issues/1) 让部署更易理解
|
||||
* [](https://dartnode.com "Powered by DartNode - Free VPS for Open Source")
|
||||
|
||||
## 👏🏻 欢迎贡献
|
||||
* 目前还没有规范,只要求一点,“代码一致性”,很重要
|
||||
|
||||
@@ -69,7 +69,7 @@ configs:
|
||||
- transform:
|
||||
to_text:
|
||||
prompt: |
|
||||
{{ .summary_html_snippet }} Respond in ${LANGUAGE:-Chinese}
|
||||
{{ .summary_html_snippet_for_small_model }} Respond in ${LANGUAGE:-Chinese}
|
||||
label: summary_html_snippet
|
||||
embedding_llm: embed
|
||||
notify:
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
| :------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------- | :--------------------------- |
|
||||
| `...to_text.type` | `string` | 转换的类型。可选值:<ul><li>`prompt` (默认): 使用 LLM 和指定的 Prompt 转换源文本。</li><li>`crawl`: 将源文本视为 URL,直接抓取该 URL 指向的网页内容,并将其转换为 Markdown 格式。此方式为本地抓取,会尝试遵循 `robots.txt`。</li><li>`crawl_by_jina`: 将源文本视为 URL,通过 [Jina AI Reader API](https://jina.ai/reader/) 抓取和处理网页内容,并返回 Markdown。功能可能更强大,例如处理动态页面,但依赖 Jina AI 服务。</li></ul> | `prompt` | 否 |
|
||||
| `...to_text.llm` | `string` | **仅当 `type` 为 `prompt` 时有效。** 用于转换的 LLM 名称 (来自 `llms` 部分)。如果未指定,将使用在 `llms` 部分中标记为 `default: true` 的 LLM。 | `llms` 部分中的默认 LLM | 否 |
|
||||
| `...to_text.prompt` | `string` | **仅当 `type` 为 `prompt` 时有效。** 用于转换的 Prompt。源文本将被注入。可以使用 Go 模板语法引用内置 Prompt: `{{ .summary }}`, `{{ .category }}`, `{{ .tags }}`, `{{ .score }}`, `{{ .comment_confucius }}`, `{{ .summary_html_snippet }}`。 | | 是 (如果 `type` 是 `prompt`) |
|
||||
| `...to_text.prompt` | `string` | **仅当 `type` 为 `prompt` 时有效。** 用于转换的 Prompt。源文本将被注入。可以使用 Go 模板语法引用内置 Prompt: `{{ .summary }}`, `{{ .category }}`, `{{ .tags }}`, `{{ .score }}`, `{{ .comment_confucius }}`, `{{ .summary_html_snippet }}`, `{{ .summary_html_snippet_for_small_model }}`。 | | 是 (如果 `type` 是 `prompt`) |
|
||||
|
||||
### 调度配置 (`scheduls`)
|
||||
|
||||
@@ -136,14 +136,15 @@
|
||||
|
||||
### 调度规则配置 (`scheduls.rules[]`)
|
||||
|
||||
| 字段 | 类型 | 描述 | 默认值 | 是否必需 |
|
||||
| :-------------------------------- | :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----- | :---------------------------------------- |
|
||||
| `scheduls.rules[].name` | `string` | 规则的名称。 | | 是 |
|
||||
| `scheduls.rules[].query` | `string` | 用于查找相关 Feed 的语义查询。可选。 | | 否 |
|
||||
| `scheduls.rules[].threshold` | `float32` | 相关性得分阈值 (0-1),用于过滤语义查询结果。仅在设置了 `query` 时有效。 | `0.6` | 否 |
|
||||
| `scheduls.rules[].label_filters` | `字符串列表` | 基于 Feed 标签的过滤器 (等于或不等于)。例如 `["category=tech", "source!=github"]`。 | `[]` | 否 |
|
||||
| `scheduls.rules[].every_day` | `string` | 相对于每天结束时间的查询范围。格式: `start~end` (HH:MM)。例如, `00:00~23:59` (今天), `-22:00~07:00` (昨天 22:00 到今天 07:00)。不能与 `watch_interval` 同时设置。 | | 否 (使用 `every_day` 或 `watch_interval`) |
|
||||
| `scheduls.rules[].watch_interval` | `time.Duration` | 运行查询的频率。例如 `10m`。不能与 `every_day` 同时设置。 | `10m` | 否 (使用 `every_day` 或 `watch_interval`) |
|
||||
| 字段 | 类型 | 描述 | 默认值 | 是否必需 |
|
||||
| :-------------------------------- | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----- | :---------------------------------------- |
|
||||
| `scheduls.rules[].name` | `string` | 规则的名称。 | | 是 |
|
||||
| `scheduls.rules[].query` | `string` | 用于查找相关 Feed 的语义查询。可选。 | | 否 |
|
||||
| `scheduls.rules[].threshold` | `float32` | 相关性得分阈值 (0-1),用于过滤语义查询结果。仅在设置了 `query` 时有效。 | `0.6` | 否 |
|
||||
| `scheduls.rules[].label_filters` | `字符串列表` | 基于 Feed 标签的过滤器 (等于或不等于)。例如 `["category=tech", "source!=github"]`。 | `[]` | 否 |
|
||||
| `scheduls.rules[].labels` | `map[string]string` | 附加到此源 Feed 的额外键值标签。 | `{}` | 否 |
|
||||
| `scheduls.rules[].every_day` | `string` | 相对于每天结束时间的查询范围。格式: `start~end` (HH:MM)。例如, `00:00~23:59` (今天), `-22:00~07:00` (昨天 22:00 到今天 07:00)。不能与 `watch_interval` 同时设置。 | | 否 (使用 `every_day` 或 `watch_interval`) |
|
||||
| `scheduls.rules[].watch_interval` | `time.Duration` | 运行查询的频率。例如 `10m`。不能与 `every_day` 同时设置。 | `10m` | 否 (使用 `every_day` 或 `watch_interval`) |
|
||||
|
||||
### 通知配置 (`notify`)
|
||||
|
||||
|
||||
@@ -136,14 +136,15 @@ Defines rules for querying and monitoring feeds.
|
||||
|
||||
### Scheduling Rule Configuration (`scheduls.rules[]`)
|
||||
|
||||
| Field | Type | Description | Default Value | Required |
|
||||
| :-------------------------------- | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :--------------------------------------- |
|
||||
| `scheduls.rules[].name` | `string` | Name of the rule. | | Yes |
|
||||
| `scheduls.rules[].query` | `string` | Semantic query to find relevant feeds. Optional. | | No |
|
||||
| `scheduls.rules[].threshold` | `float32` | Relevance score threshold (0-1) for filtering semantic query results. Only effective if `query` is set. | `0.6` | No |
|
||||
| `scheduls.rules[].label_filters` | `list of strings` | Filters based on feed labels (equals or not equals). E.g., `["category=tech", "source!=github"]`. | `[]` | No |
|
||||
| `scheduls.rules[].every_day` | `string` | Query range relative to the end of each day. Format: `start~end` (HH:MM). E.g., `00:00~23:59` (today), `-22:00~07:00` (yesterday 22:00 to today 07:00). Cannot be set with `watch_interval`. | | No (use `every_day` or `watch_interval`) |
|
||||
| `scheduls.rules[].watch_interval` | `time.Duration` | Frequency to run the query. E.g., `10m`. Cannot be set with `every_day`. | `10m` | No (use `every_day` or `watch_interval`) |
|
||||
| Field | Type | Description | Default Value | Required |
|
||||
| :-------------------------------- | :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :--------------------------------------- |
|
||||
| `scheduls.rules[].name` | `string` | Name of the rule. | | Yes |
|
||||
| `scheduls.rules[].query` | `string` | Semantic query to find relevant feeds. Optional. | | No |
|
||||
| `scheduls.rules[].threshold` | `float32` | Relevance score threshold (0-1) for filtering semantic query results. Only effective if `query` is set. | `0.6` | No |
|
||||
| `scheduls.rules[].label_filters` | `list of strings` | Filters based on feed labels (equals or not equals). E.g., `["category=tech", "source!=github"]`. | `[]` | No |
|
||||
| `scheduls.rules[].labels` | `map[string]string` | Additional key-value labels attached to this source Feed. | `{}` | No |
|
||||
| `scheduls.rules[].every_day` | `string` | Query range relative to the end of each day. Format: `start~end` (HH:MM). E.g., `00:00~23:59` (today), `-22:00~07:00` (yesterday 22:00 to today 07:00). Cannot be set with `watch_interval`. | | No (use `every_day` or `watch_interval`) |
|
||||
| `scheduls.rules[].watch_interval` | `time.Duration` | Frequency to run the query. E.g., `10m`. Cannot be set with `every_day`. | `10m` | No (use `every_day` or `watch_interval`) |
|
||||
|
||||
### Notification Configuration (`notify`)
|
||||
|
||||
|
||||
BIN
docs/images/web-reading-aggr.png
Normal file
BIN
docs/images/web-reading-aggr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 688 KiB |
@@ -10,3 +10,7 @@
|
||||
## 如果你对默认的模型效果不满意,首选推荐
|
||||
* **不缺钱 or “有路子”**:Gemini 2.5 Pro
|
||||
* **再便宜点的**:Gemini 2.5 Flash
|
||||
|
||||
---
|
||||
|
||||
v0.4.0 优化之后,免费 qwen3 的效果应该已经可以满足大部分需求
|
||||
@@ -15,5 +15,15 @@
|
||||
* 让它简便易行:配合 zenfeed 总结,更轻松地阅读要点(进一步了解原文逃不掉,但这时你已经被勾住了,相信这事已经没那么困难了)
|
||||
* 让你感觉到爽:zenfeed 阅读完后的木鱼声,嗯这算一个,确信
|
||||
|
||||
* 提供更多玩法指导
|
||||
* zenfeed 定位是信息管理引擎,普通用户反而搞不清楚状况
|
||||
* 短期并不会考虑做一个没有使用心智成本的 “产品”,但我可以分享一些垂直的使用案例技巧
|
||||
> 灵光一现:最近喜欢上和豆包聊新闻了,或许可以分享下如何把 zenfeed 数据接入豆包
|
||||
|
||||
## 中长期
|
||||
* WIP
|
||||
* Web 上的相关性聚合阅读
|
||||

|
||||
|
||||
---
|
||||
|
||||
如果你觉得 zenfeed 很酷,并且有意愿贡献,请联系我!
|
||||
@@ -151,6 +151,7 @@ type SchedulsRule struct {
|
||||
Query string `yaml:"query,omitempty" json:"query,omitempty" desc:"The semantic query to get the feeds. NOTE it is optional"`
|
||||
Threshold float32 `yaml:"threshold,omitempty" json:"threshold,omitempty" desc:"The threshold to filter the query result by relevance (with 'query') score. It does not work when query is not set. Default is 0.6."`
|
||||
LabelFilters []string `yaml:"label_filters,omitempty" json:"label_filters,omitempty" desc:"The label filters (equal or not equal) to match the feeds. e.g. [category=tech, source!=github]"`
|
||||
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty" desc:"The labels to attach to the feeds."`
|
||||
EveryDay string `yaml:"every_day,omitempty" json:"every_day,omitempty" desc:"The query range at the end time of every day. Format: start~end, e.g. 00:00~23:59, or -22:00~7:00 (yesterday 22:00 to today 07:00)."`
|
||||
WatchInterval timeutil.Duration `yaml:"watch_interval,omitempty" json:"watch_interval,omitempty" desc:"The run and query interval to watch the rule. Default is 10m. It can not be set with every_day at same time."`
|
||||
}
|
||||
|
||||
@@ -70,22 +70,14 @@ You are to act as a professional Content Designer. Your task is to convert the p
|
||||
|
||||
**Core Requirements:**
|
||||
|
||||
* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content):**
|
||||
* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content. It is not necessary to use all of them; choose the ones that best fit the content.):**
|
||||
|
||||
A. **Stylish Quote Block** (for highlighting important points or direct quotes from the original text):
|
||||
<div style="margin:20px 0; padding:20px; background:linear-gradient(to right, #f8f9fa, #ffffff); border-left:5px solid #4285f4; border-radius:5px; box-shadow:0 2px 8px rgba(0,0,0,0.05);">
|
||||
<p style="margin:0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:16px; line-height:1.6; color:#333; font-weight:500;">
|
||||
Insert the key point or finding to be highlighted here.
|
||||
*. **Standard Paragraph** (Required) (This is your primary tool. Use it for introductions, conclusions, and to connect different visual elements to build a cohesive narrative.):
|
||||
<p style="margin:16px 0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:16px; line-height:1.75; color:#3c4043;">
|
||||
Insert your main text, explanations, or transitional sentences here.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
B. **Information Card** (for highlighting key data/metrics):
|
||||
<div style="display:inline-block; margin:10px 10px 10px 0; padding:15px 20px; background-color:#ffffff; border-radius:8px; box-shadow:0 3px 10px rgba(0,0,0,0.08); min-width:120px; text-align:center;">
|
||||
<p style="margin:0 0 5px 0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:14px; color:#666;">Metric Name</p>
|
||||
<p style="margin:0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:24px; font-weight:600; color:#1a73e8;">75%</p>
|
||||
</div>
|
||||
|
||||
C. **Key Points List** (for organizing multiple core points):
|
||||
*. **Key Points List** (Required) (for organizing multiple core points):
|
||||
<ul style="margin:20px 0; padding-left:0; list-style-type:none;">
|
||||
<li style="position:relative; margin-bottom:12px; padding-left:28px; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:15px; line-height:1.6; color:#444;">
|
||||
<span style="position:absolute; left:0; top:0; width:18px; height:18px; background-color:#4285f4; border-radius:50%; color:white; text-align:center; line-height:18px; font-size:12px;">1</span>
|
||||
@@ -97,10 +89,28 @@ You are to act as a professional Content Designer. Your task is to convert the p
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
D. **Emphasized Text** (for highlighting keywords or phrases):
|
||||
*. **Emphasized Text** (Required!!) (for highlighting keywords or phrases):
|
||||
<span style="background:linear-gradient(180deg, rgba(255,255,255,0) 50%, rgba(66,133,244,0.2) 50%); padding:0 2px;">Text to be emphasized</span>
|
||||
|
||||
E. **Comparison Table** (suitable for comparing different solutions or viewpoints):
|
||||
*. **Stylish Quote Block** (Optional) (for highlighting important points or direct quotes from the original text):
|
||||
<div style="margin:20px 0; padding:20px; background:linear-gradient(to right, #f8f9fa, #ffffff); border-left:5px solid #4285f4; border-radius:5px; box-shadow:0 2px 8px rgba(0,0,0,0.05);">
|
||||
<p style="margin:0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:16px; line-height:1.6; color:#333; font-weight:500;">
|
||||
Insert the key point or finding to be highlighted here.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
*. **Image Block** (Optional) (Embed images from the article where appropriate to aid explanation. Remember to use referrerpolicy="no-referrer" to ensure they display correctly):
|
||||
<div style="margin:20px 0; text-align:center;">
|
||||
<img src="URL_of_the_image_from_article" alt="Image description from article" style="max-width:100%; height:auto; border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,0.1);" referrerpolicy="no-referrer">
|
||||
</div>
|
||||
|
||||
*. **Information Card** (Optional) (for highlighting key data/metrics):
|
||||
<div style="display:inline-block; margin:10px 10px 10px 0; padding:15px 20px; background-color:#ffffff; border-radius:8px; box-shadow:0 3px 10px rgba(0,0,0,0.08); min-width:120px; text-align:center;">
|
||||
<p style="margin:0 0 5px 0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:14px; color:#666;">Metric Name</p>
|
||||
<p style="margin:0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:24px; font-weight:600; color:#1a73e8;">75%</p>
|
||||
</div>
|
||||
|
||||
*. **Comparison Table** (Optional) (suitable for comparing different solutions or viewpoints based on the article content):
|
||||
<div style="margin:25px 0; padding:15px; background-color:#f8f9fa; border-radius:8px; overflow-x:auto;">
|
||||
<table style="width:100%; border-collapse:collapse; font-family:'Google Sans',Roboto,Arial,sans-serif;">
|
||||
<thead>
|
||||
@@ -123,15 +133,80 @@ You are to act as a professional Content Designer. Your task is to convert the p
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
* **Output Requirements:**
|
||||
* The design should be **aesthetically pleasing and elegant, with harmonious color schemes**, ensuring sufficient **whitespace and contrast**.
|
||||
* All article snippets must maintain a **consistent visual style**.
|
||||
* You **must use multiple visual elements** and avoid mere text listings. **Use at least 2-3 different visual elements** to enhance readability and intuitive understanding.
|
||||
* **Weave these components together with plain text.** They are not meant to be isolated blocks. Use transitional text to connect them, ensuring a smooth and logical reading experience.
|
||||
* **Appropriately quote important original text snippets** to support explanations.
|
||||
* **Strive to use highlighting styles to mark key points**.
|
||||
* **Ensure overall reading flow is smooth and natural!!!** Guide the reader's thought process appropriately, minimizing abrupt jumps in logic.
|
||||
* **Output only the HTML code snippet.** Do not include the full HTML document structure (i.e., no <html>, <head>, or <body> tags).
|
||||
* **Do not add any explanatory text, extra comments, Markdown formatting, or HTML backticks.** Output the raw HTML code directly.
|
||||
* **Do not add article titles or sources;** these will be automatically injected by the user later.
|
||||
* **Do not use any opening remarks or pleasantries** (e.g., "Hi," "Let's talk about..."). Directly present the processed HTML content.
|
||||
* **Do not refer to "this article," "this piece," "the current text," etc.** The user is aware of this context.
|
||||
* **Only use inline styles, do not use global styles.** Remember to only generate HTML snippets.
|
||||
* Do not explain anything, just output the HTML code snippet.
|
||||
* Use above HTML components & its styles to generate the HTML code snippet, do not customize by yourself, else you will be fired.
|
||||
|
||||
* **Your Personality and Expression Preferences:**
|
||||
* ** Have a strong aversion to jargon, bureaucratic language, redundant embellishments, and grand narratives. Believe that plain, simple language can best convey truth.
|
||||
* Be fluent, plain, concise, and not verbose.
|
||||
* Be **plain, direct, clear, and easy to understand:** Use basic vocabulary and simple sentence structures. Avoid "sophisticated" complex sentences or unnecessary embellishments that increase reading burden.
|
||||
* Enable readers to quickly grasp: "What is this? What is it generally about? What is its relevance/real-world significance to me (an ordinary person)?" Focus on providing an **overview**, not an accumulation of details.
|
||||
* Be well-versed in cognitive science; understand how to phrase information so that someone without prior background can quickly understand the core content.
|
||||
* **Extract key information and core insights,** rather than directly copying the original text. Do not omit crucial information and viewpoints. For example, for forum posts, the main points from comments are also very important!
|
||||
* Avoid large blocks of text, strive for a combination of pictures and text.
|
||||
`,
|
||||
|
||||
"summary_html_snippet_for_small_model": `
|
||||
You are to act as a professional Content Designer. Your task is to convert the provided article into **visually modern HTML email snippets** that render well in modern email clients like Gmail and QQ Mail.
|
||||
|
||||
**Core Requirements:**
|
||||
|
||||
* **Highlighting and Layout Techniques (Based on the article content, you must actually use the HTML structure templates provided below to generate the content. It is not necessary to use all of them; choose the ones that best fit the content.):**
|
||||
|
||||
*. **Standard Paragraph** (Required) (This is your primary tool. Use it for introductions, conclusions, and to connect different visual elements to build a cohesive narrative.):
|
||||
<p style="margin:16px 0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:16px; line-height:1.75; color:#3c4043;">
|
||||
Insert your main text, explanations, or transitional sentences here.
|
||||
</p>
|
||||
|
||||
*. **Key Points List** (Required) (for organizing multiple core points):
|
||||
<ul style="margin:20px 0; padding-left:0; list-style-type:none;">
|
||||
<li style="position:relative; margin-bottom:12px; padding-left:28px; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:15px; line-height:1.6; color:#444;">
|
||||
<span style="position:absolute; left:0; top:0; width:18px; height:18px; background-color:#4285f4; border-radius:50%; color:white; text-align:center; line-height:18px; font-size:12px;">1</span>
|
||||
Description of the first key point
|
||||
</li>
|
||||
<li style="position:relative; margin-bottom:12px; padding-left:28px; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:15px; line-height:1.6; color:#444;">
|
||||
<span style="position:absolute; left:0; top:0; width:18px; height:18px; background-color:#4285f4; border-radius:50%; color:white; text-align:center; line-height:18px; font-size:12px;">2</span>
|
||||
Description of the second key point
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
*. **Emphasized Text** (Required!!) (for highlighting keywords or phrases):
|
||||
<span style="background:linear-gradient(180deg, rgba(255,255,255,0) 50%, rgba(66,133,244,0.2) 50%); padding:0 2px;">Text to be emphasized</span>
|
||||
|
||||
*. **Stylish Quote Block** (Optional) (for highlighting important points or direct quotes from the original text):
|
||||
<div style="margin:20px 0; padding:20px; background:linear-gradient(to right, #f8f9fa, #ffffff); border-left:5px solid #4285f4; border-radius:5px; box-shadow:0 2px 8px rgba(0,0,0,0.05);">
|
||||
<p style="margin:0; font-family:'Google Sans',Roboto,Arial,sans-serif; font-size:16px; line-height:1.6; color:#333; font-weight:500;">
|
||||
Insert the key point or finding to be highlighted here.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
*. **Image Block** (Optional) (Embed images from the article where appropriate to aid explanation. Remember to use referrerpolicy="no-referrer" to ensure they display correctly):
|
||||
<div style="margin:20px 0; text-align:center;">
|
||||
<img src="URL_of_the_image_from_article" alt="Image description from article" style="max-width:100%; height:auto; border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,0.1);" referrerpolicy="no-referrer">
|
||||
</div>
|
||||
|
||||
* **Output Requirements:**
|
||||
* The design should be **aesthetically pleasing and elegant, with harmonious color schemes**, ensuring sufficient **whitespace and contrast**.
|
||||
* All article snippets must maintain a **consistent visual style**.
|
||||
* You **must use multiple visual elements** and avoid mere text listings. **Use at least 2-3 different visual elements** to enhance readability and intuitive understanding.
|
||||
* **Weave these components together with plain text.** They are not meant to be isolated blocks. Use transitional text to connect them, ensuring a smooth and logical reading experience.
|
||||
* **Appropriately quote important original text snippets** to support explanations.
|
||||
* **Strive to use highlighting styles to mark key points**.
|
||||
* **Where appropriate, embed original images from the article to aid explanation.** Pay attention to the referrer policy: use referrerpolicy="no-referrer" on the <img> HTML element to ensure images display correctly.
|
||||
* **Ensure overall reading flow is smooth and natural!!!** Guide the reader's thought process appropriately, minimizing abrupt jumps in logic.
|
||||
* **Output only the HTML code snippet.** Do not include the full HTML document structure (i.e., no <html>, <head>, or <body> tags).
|
||||
* **Do not add any explanatory text, extra comments, Markdown formatting, or HTML backticks.** Output the raw HTML code directly.
|
||||
@@ -143,8 +218,6 @@ You are to act as a professional Content Designer. Your task is to convert the p
|
||||
* Use above HTML components & its styles to generate the HTML code snippet, do not customize by yourself, else you will be fired.
|
||||
|
||||
* **Your Personality and Expression Preferences:**
|
||||
* Focus on the most valuable information, not on every detail. The content should be readable within 3 minutes.
|
||||
* Communicate **concisely and get straight to the point.
|
||||
* ** Have a strong aversion to jargon, bureaucratic language, redundant embellishments, and grand narratives. Believe that plain, simple language can best convey truth.
|
||||
* Be fluent, plain, concise, and not verbose.
|
||||
* Be **plain, direct, clear, and easy to understand:** Use basic vocabulary and simple sentence structures. Avoid "sophisticated" complex sentences or unnecessary embellishments that increase reading burden.
|
||||
|
||||
@@ -83,6 +83,7 @@ func (ls *Labels) FromMap(m map[string]string) {
|
||||
for k, v := range m {
|
||||
*ls = append(*ls, Label{Key: k, Value: v})
|
||||
}
|
||||
ls.EnsureSorted()
|
||||
}
|
||||
|
||||
func (ls Labels) Map() map[string]string {
|
||||
|
||||
@@ -119,6 +119,12 @@ func (r *periodic) execute(ctx context.Context, now time.Time) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Attach labels to feeds.
|
||||
for _, feed := range feeds {
|
||||
feed.Labels = append(feed.Labels, config.labels...)
|
||||
feed.Labels.EnsureSorted()
|
||||
}
|
||||
|
||||
// Notify.
|
||||
r.Dependencies().Out <- &Result{
|
||||
Rule: config.Name,
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/glidea/zenfeed/pkg/component"
|
||||
"github.com/glidea/zenfeed/pkg/model"
|
||||
"github.com/glidea/zenfeed/pkg/storage/feed"
|
||||
"github.com/glidea/zenfeed/pkg/storage/feed/block"
|
||||
)
|
||||
@@ -37,6 +38,8 @@ type Config struct {
|
||||
Query string
|
||||
Threshold float32
|
||||
LabelFilters []string
|
||||
Labels map[string]string
|
||||
labels model.Labels
|
||||
|
||||
// Periodic type.
|
||||
EveryDay string // e.g. "00:00~23:59", or "-22:00~7:00" (yesterday 22:00 to today 07:00)
|
||||
@@ -63,6 +66,9 @@ func (c *Config) Validate() error { //nolint:cyclop,gocognit
|
||||
if c.Threshold < 0 || c.Threshold > 1 {
|
||||
return errors.New("threshold must be between 0 and 1")
|
||||
}
|
||||
if len(c.Labels) > 0 {
|
||||
c.labels.FromMap(c.Labels)
|
||||
}
|
||||
if c.EveryDay != "" && c.WatchInterval != 0 {
|
||||
return errors.New("every_day and watch_interval cannot both be set")
|
||||
}
|
||||
|
||||
@@ -101,6 +101,12 @@ func (r *watch) execute(ctx context.Context, start, end time.Time) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Attach labels to feeds.
|
||||
for _, feed := range feeds {
|
||||
feed.Labels = append(feed.Labels, config.labels...)
|
||||
feed.Labels.EnsureSorted()
|
||||
}
|
||||
|
||||
// Split feeds by start time.
|
||||
feedsByStart := make(map[time.Time][]*block.FeedVO) // Start time -> feeds.
|
||||
for _, feed := range feeds {
|
||||
|
||||
@@ -58,6 +58,7 @@ func (c *Config) From(app *config.App) *Config {
|
||||
Query: r.Query,
|
||||
Threshold: r.Threshold,
|
||||
LabelFilters: r.LabelFilters,
|
||||
Labels: r.Labels,
|
||||
EveryDay: r.EveryDay,
|
||||
WatchInterval: time.Duration(r.WatchInterval),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user