发布1.0.18

This commit is contained in:
Yeban8090 2025-06-15 13:00:38 +08:00
parent 66073354a1
commit b900096ad5
5 changed files with 26 additions and 9 deletions

View file

@ -1,7 +1,7 @@
{
"id": "note-to-red",
"name": "Note to RED",
"version": "1.0.17",
"version": "1.0.18",
"minAppVersion": "0.15.0",
"description": "Convert Markdown notes to RED (Xiaohongshu) style images",
"author": "Yeban",

View file

@ -58,10 +58,27 @@ export class RedSettingTab extends PluginSettingTab {
}
private renderBasicSettings(containerEl: HTMLElement): void {
// 标题级别设置
new Setting(containerEl)
// 排版管理区域
const typographySection = containerEl.createDiv('red-settings-subsection');
const typographyHeader = typographySection.createDiv('red-settings-subsection-header');
const typographyToggle = typographyHeader.createSpan('red-settings-subsection-toggle');
setIcon(typographyToggle, 'chevron-right');
typographyHeader.createEl('h3', { text: '排版管理' });
const typographyContent = typographySection.createDiv('red-settings-subsection-content');
// 折叠/展开逻辑
typographyHeader.addEventListener('click', () => {
const isExpanded = !typographySection.hasClass('is-expanded');
typographySection.toggleClass('is-expanded', isExpanded);
setIcon(typographyToggle, isExpanded ? 'chevron-down' : 'chevron-right');
});
// 内容分割标题级别设置
new Setting(typographyContent)
.setName('内容分割标题级别')
.setDesc('选择用于分割内容生成图片的标题级别\n• 一级标题(#): 每个一级标题及其下方内容生成一张图片\n• 二级标题(##): 每个二级标题及其下方内容生成一张图片')
.setDesc('选择用于分割内容生成图片的标题级别')
.addDropdown(dropdown => dropdown
.addOption('h1', '一级标题(#) - 按大章节分割')
.addOption('h2', '二级标题(##) - 按小章节分割')

View file

@ -45,7 +45,7 @@ export const DEFAULT_SETTINGS: RedSettings = {
userId: '@Yeban',
showTime: true,
timeFormat: 'zh-CN',
headingLevel: 'h1', // 默认使用一级标题
headingLevel: 'h2', // 默认使用二级标题
footerLeftText: '夜半过后,光明便启程',
footerRightText: '欢迎关注公众号:夜半',
customFonts: [

View file

@ -244,7 +244,7 @@
/* 设置子区域折叠样式 */
.red-settings .red-settings-subsection {
margin: 0 12px;
margin: 0 12px 12px 12px;
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
overflow-y: auto;

View file

@ -316,12 +316,12 @@ export class RedView extends ItemView {
attr: { 'aria-label': '使用指南' }
});
setIcon(helpButton, 'help');
const headingLevel = this.settingsManager.getSettings().headingLevel || 'h1';
parent.createEl('div', {
cls: 'red-help-tooltip',
text: `使用指南:
1. (#)
2. 使 ---
1. ${headingLevel === 'h1' ? '一级标题(#)' : '二级标题(##)'}
2. ${headingLevel === 'h1' ? '一级标题(#)' : '二级标题(##)'}使 ---
3. 20-24px使
4. 14-16px后单独导出
5.