Skip to content

Commit

Permalink
feat: 新增是否隐藏首页 banner 区域
Browse files Browse the repository at this point in the history
  • Loading branch information
dlzmoe committed Dec 12, 2024
1 parent 880b989 commit dd5a6cd
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 72 deletions.
4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"Vue.volar"
]
"recommendations": ["Vue.volar"]
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2 align="center">linuxdo 增强插件(linuxdo-scripts)</h2>
<p align="center">脚本持续更新,欢迎提出 issues,提交 pr ~</p>
<p align="center">脚本持续更新,欢迎提出 Issues,提交 Pr ~</p>

[中文简体](https://github.com/dlzmoe/linuxdo-scripts/blob/main/README.md) | [English](https://github.com/dlzmoe/linuxdo-scripts/blob/main/README_EN.md)

Expand Down Expand Up @@ -29,7 +29,9 @@ linux.do 增强插件,话题列表显示创建时间,显示楼层数,新
- [目录](#目录)
- [功能特性](#功能特性)
- [使用方法](#使用方法)
- [小白法](#小白法)
- [开发说明](#开发说明)
- [CSP 问题](#csp-问题)
- [更新日志](#更新日志)
- [贡献历史](#贡献历史)
- [免责声明](#免责声明)
Expand Down Expand Up @@ -87,7 +89,7 @@ linux.do 增强插件,话题列表显示创建时间,显示楼层数,新
[https://greasyfork.org/scripts/501827](https://greasyfork.org/scripts/501827)


### 小白法
### 小白法

- [Chrome - 暴力猴](https://chromewebstore.google.com/detail/jinjaccalgkegednnccohejagnlnfdag)
- [Edge - 暴力猴](https://microsoftedge.microsoft.com/addons/detail/violentmonkey/eeagobfjdenkkddmbclomhiblgggliao)
Expand Down
103 changes: 54 additions & 49 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,71 @@
## linuxdo Enhancement Plugin (linuxdo-scripts)
## linuxdo Enhanced Plugin (linuxdo-scripts)

Scripts are continuously updated. Issues and pull requests are welcome!
Scripts are continuously updated. Issues and PR submissions are welcome!

[简体中文](https://github.com/dlzmoe/linuxdo-scripts/blob/main/README.md) | [English](https://github.com/dlzmoe/linuxdo-scripts/blob/main/README_EN.md)

![Release](https://img.shields.io/github/v/release/dlzmoe/linuxdo-scripts?label=linuxdo%20%E5%A2%9E%E5%BC%BA%E6%8F%92%E4%BB%B6&labelColor=%235D5D5D&color=%23E97435) ![Last Commit](https://img.shields.io/github/last-commit/dlzmoe/linuxdo-scripts) ![Stars](https://img.shields.io/github/stars/dlzmoe%2Flinuxdo-scripts?style=flat) ![License](https://img.shields.io/github/license/dlzmoe/linuxdo-scripts)
![Release Badge](https://img.shields.io/github/v/release/dlzmoe/linuxdo-scripts?label=linuxdo%20%E5%A2%9E%E5%BC%BA%E6%8F%92%E4%BB%B6&labelColor=%235D5D5D&color=%23E97435)
![Last Commit Badge](https://img.shields.io/github/last-commit/dlzmoe/linuxdo-scripts)
![Stars Badge](https://img.shields.io/github/stars/dlzmoe%2Flinuxdo-scripts?style=flat)
![License Badge](https://img.shields.io/github/license/dlzmoe/linuxdo-scripts)

The linux.do enhancement plugin provides features such as displaying the creation time of topics, showing floor numbers, opening topics in new tabs, forcing block (blacklisting) of certain topics, convenient replies (customizable), optimizing signature image display, previewing details and comments directly in the topic list, import/export settings panel, floor lotteries, user-defined tags, view only the author's posts, auto-scrolling reading, support for custom CSS styles, mixed rendering of Chinese and English, level information queries, AI-based topic summary feature, intelligent reply generation, support for WebDAV synchronization, switching forum theme skins, and more. Please check the settings list for continuous updates and feel free to propose new ideas!
The linux.do enhanced plugin adds features such as displaying creation time for topics, showing floor count, opening topics in a new tab, forcing block on certain users' topics, quick replies (customizable), optimizing signature image display, directly previewing details and comments in the topic list, import/export settings panel, floor lottery, user-defined tags, view only the original poster, auto-scrolling reading, support for custom CSS styles, mixed Chinese and English optimization, rank information query, AI topic summarization, intelligent reply generation, WebDAV sync support, theme skin switching, and more! More features can be found in the settings list. Continuous updates are made, and new ideas are welcome!

[GitHub Repository](https://github.com/dlzmoe/linuxdo-scripts) | [Install from Greasyfork Store](https://greasyfork.org/scripts/501827) | [Bug Reporting & Feature Requests](https://github.com/dlzmoe/linuxdo-scripts/issues/new/choose) | [Usage and Development Documentation](https://linuxdo-scripts-docs.netlify.app/) | [Discord Community](https://discord.gg/n2pErsD7Kg)
[GitHub Repository](https://github.com/dlzmoe/linuxdo-scripts) | [Greasyfork Store Installation](https://greasyfork.org/scripts/501827) | [Bug Feedback & Feature Requests](https://github.com/dlzmoe/linuxdo-scripts/issues/new/choose) | [Usage and Development Documentation](https://linuxdo-scripts-docs.netlify.app/) | [Discord Community](https://discord.gg/n2pErsD7Kg)

> **Note:**
> I will share interesting features in the group chat as soon as possible, as I feel that posting too frequently may be annoying.
> Join the Discord community: https://discord.gg/n2pErsD7Kg
> **TIP**
> I will share any fun features promptly in the group chat. I feel like I post too frequently.
> Discord Community: [https://discord.gg/n2pErsD7Kg](https://discord.gg/n2pErsD7Kg)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/anghunk)

## Table of Contents
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Usage](#usage)
- [Development Notes](#development-notes)
- [Usage Instructions](#usage-instructions)
- [Beginner Method](#beginner-method)
- [Development Instructions](#development-instructions)
- [CSP Issues](#csp-issues)
- [Changelog](#changelog)
- [Contribution History](#contribution-history)
- [Disclaimer](#disclaimer)
- [License Agreement](#license-agreement)
- [Copyright Agreement](#copyright-agreement)

---

The development environment is Windows / Chrome / Violentmonkey. If you encounter errors or it doesn't work with other userscript managers, try using Violentmonkey (which I am currently using and is quite compatible).
The development environment is Windows / Chrome / Violentmonkey. If there are errors or it doesnt work with other userscript managers, try using Violentmonkey (which I’m currently using, with better compatibility).

> **Warning:**
> Arc browser users should use the Violentmonkey extension.
> The tamper monkey extension cannot be used in Arc browser due to compatibility issues.
> **WARNING**
> Arc browser users should use Violentmonkey extension.
> The monkey tampering extension cannot be used under the Arc browser due to compatibility issues.
## Features

- [x] Display creation time in topic list
- [x] Show floor numbers
- [x] Display creation time for topics
- [x] Show floor count
- [x] Open topics in a new tab
- [x] Force block (blacklist) certain topics
- [x] Convenient replies (customizable)
- [x] Optimize signature image display
- [x] Import/export feature settings panel
- [x] Force block (blacklist) certain users' topics
- [x] Quick replies for topics (customizable)
- [x] Optimize signature image display to prevent image breaking
- [x] Import/export settings panel
- [x] Floor lottery
- [x] Toggle view only the author's posts
- [x] Toggle view only the original poster
- [x] Auto-scrolling reading
- [x] Dark mode
- [x] User tagging feature
- [x] Direct preview of details and comments in topic list
- [x] Comment box emoji optimization
- [x] Support for custom CSS styles
- [x] Mixed rendering of Chinese and English is optimized
- [x] Added level information query
- [x] Directly preview details and comments in the topic list
- [x] Emoji optimization in comment boxes
- [x] Support custom CSS styles
- [x] Mixed Chinese and English display optimization
- [x] New rank information query
- [x] Switch forum emoji styles
- [x] AI-based topic summary feature and intelligent reply generation
- [x] Support for WebDAV synchronization
- [x] Switch forum theme skins
- [x] More features, please check the settings list
- [x] AI summarization of topics and intelligent reply generation
- [x] Support WebDAV synchronization
- [x] Switch forum theme skin
- [x] More features are available in the settings list

<details>
<summary>Demo Screenshots:</summary>
<summary>Some Screenshot Demos:</summary>

| ![image](https://github.com/user-attachments/assets/f3fb854f-e6fd-4da4-9a9c-377b6537fab7) | ![image](https://github.com/user-attachments/assets/3b2a9e63-3939-4dbc-a00f-c713ca2c7f33) |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
Expand All @@ -69,48 +74,48 @@ The development environment is Windows / Chrome / Violentmonkey. If you encounte

</details>

## Usage
## Usage Instructions

Click the link to enter the Greasyfork store to download and install.
Click the following link to enter the Greasyfork store for installation.

[https://greasyfork.org/scripts/501827](https://greasyfork.org/scripts/501827)

### (For Beginners)
### Beginner Method

- [Chrome - Violentmonkey](https://chromewebstore.google.com/detail/jinjaccalgkegednnccohejagnlnfdag)
- [Edge - Violentmonkey](https://microsoftedge.microsoft.com/addons/detail/violentmonkey/eeagobfjdenkkddmbclomhiblgggliao)
- [Firefox - Greasemonkey](https://addons.mozilla.org/zh-CN/firefox/addon/greasemonkey/)
- [Firefox - Greasemonkey](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)

First, you need to install a userscript manager by choosing the one that corresponds to your browser. Once installed, you will see the userscript manager in the browser's extensions.
First, you need to install a userscript manager; choose the appropriate manager for your browser, download and install it. After installation, you will see Greasemonkey in the browsers extensions section.

Then, you can click the above link ([https://greasyfork.org/scripts/501827](https://greasyfork.org/scripts/501827)) to download the script. After downloading, click on the extensions icon in the top right corner of the browser, and you will see the linuxdo enhancement plugin, which you can manage freely.
Then, click the link above ([https://greasyfork.org/scripts/501827](https://greasyfork.org/scripts/501827)) to download the script. After downloading, click the extension icon in the upper right corner of your browser, select the Greasemonkey icon, and you'll find the linuxdo enhanced plugin for self-management.

Finally, open the [https://linux.do/](https://linux.do/) forum and the plugin should work normally. (You need to refresh the forum page after installation for it to work properly.)
Finally, open [https://linux.do/](https://linux.do/) forum to use the plugin normally. (You need to refresh the forum page after installation for it to work properly)

## Development Notes
## Development Instructions

```
node: v16.15.1
```

> **Note:**
> Essential: Due to the forum's CSP, scripts cannot be injected during local development, so you need to install the [Chrome extension - Disable-CSP](https://github.com/lisonge/Disable-CSP) to bypass CSP and enable the first option `Disable HTTP CSP`.
> **NOTE**
> Prerequisite: Since the forum has enabled CSP, you cannot inject scripts during local development. You need to install the [Google Extension - Disable-CSP](https://github.com/lisonge/Disable-CSP) to bypass CSP and enable the first option `Disable HTTP CSP`.
Features are developed as components to avoid conflicts when adding new features.
Features are developed as components so that each new feature can register a new component to avoid conflicts.

Clone this repository and install dependencies to run the code.
Clone this repository, install dependencies, and run the code.

```shell
git clone https://github.com/dlzmoe/linuxdo-scripts
yarn # Install dependencies
yarn dev # Run locally
```

No build is required; I will review PR codes and merge them in the shortest time possible if there are no major issues.
No need to build. After submitting a PR, I will review it, and if there are no major issues, it will be merged as soon as possible.

### CSP Issues

If you see `Refused to load the script xxxxx` when loading local scripts, you can use [Disable-CSP](https://github.com/lisonge/Disable-CSP) to temporarily disable CSP. Remember to revert after development.
If loading the local script shows `Refused to load the script xxxxx`, you can use [Disable-CSP](https://github.com/lisonge/Disable-CSP) to temporarily disable CSP. Remember to revert after development completion.

## Changelog

Expand All @@ -124,8 +129,8 @@ If you see `Refused to load the script xxxxx` when loading local scripts, you ca

## Disclaimer

All features provided in this script run solely within the browser. The source code used is open and transparent. This script is for study and research purposes only, does not use any profit-making schemes, or participate in any profit-making organizations. Any disputes arising from the use of this script should be resolved amicably. This script is not responsible for any form of loss or damage that may be caused to the user or others while using the software provided by this script. By downloading, installing, and using the software provided in this product, users indicate their trust in the author and related agreements and disclaimers.
All features provided by this script run only in the browser. The source code used is publicly visible and transparent. This script is for educational research purposes only and does not use any profit schemes or participate in any profit organizations. Any disputes arising from the use of this script or related to it should be resolved amicably. This script is not responsible for any form of loss or harm caused to users or others by using the software provided by this script. By downloading, installing, and using the software provided in this product, users indicate their trust in the author and related agreements & disclaimers.

## License Agreement
## Copyright Agreement

[Apache-2.0 license](https://github.com/dlzmoe/linuxdo-scripts/blob/main/LICENSE)
[Apache-2.0 License](https://github.com/dlzmoe/linuxdo-scripts/blob/main/LICENSE)
3 changes: 2 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ temp
examples-temp
node_modules
pnpm-global
TODOs.md
TODOs.md
yarn.lock
32 changes: 16 additions & 16 deletions toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
import re

def generate_toc(md_file):
toc = []
with open(md_file, 'r', encoding='utf-8') as file:
for line in file:
if line.startswith('## '):
title = line[3:].strip()
link = re.sub(r'\s+', '-', title.lower())
toc.append(f' - [{title}](#{link})')
elif line.startswith('### '):
title = line[4:].strip()
link = re.sub(r'\s+', '-', title.lower())
toc.append(f' - [{title}](#{link})')
toc = []
with open(md_file, 'r', encoding='utf-8') as file:
for line in file:
if line.startswith('## '):
title = line[3:].strip()
link = re.sub(r'\s+', '-', title.lower())
toc.append(f' - [{title}](#{link})')
elif line.startswith('### '):
title = line[4:].strip()
link = re.sub(r'\s+', '-', title.lower())
toc.append(f' - [{title}](#{link})')

return '\n'.join(toc)
return '\n'.join(toc)

if __name__ == "__main__":
md_file = 'README.md'
toc = generate_toc(md_file)
print("## 目录")
print(toc)
md_file = 'README.md'
toc = generate_toc(md_file)
print("## 目录")
print(toc)
1 change: 0 additions & 1 deletion translate_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# 加载 .env 文件中的环境变量
load_dotenv()

# 配置选项
OPENAI_URL = os.getenv("OPENAI_URL")
API_KEY = os.getenv("API_KEY")
MODEL = os.getenv("MODEL")
Expand Down

0 comments on commit dd5a6cd

Please sign in to comment.