Skip to content
4 changes: 4 additions & 0 deletions src/renderer/src/i18n/locales/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,10 @@
"help": "Display the model provider (e.g., OpenAI, Gemini) when exporting to Markdown",
"title": "Show Model Provider"
},
"show_timestamp": {
"title": "Show message timestamps on export",
"help": "When enabled, the creation time of each message will be appended to its heading in the format YYYY-MM-DD HH:mm."
},
"standardize_citations": {
"help": "When enabled, citation markers will be converted to standard Markdown footnote format [^1] and citation lists will be formatted.",
"title": "Standardize Citation Format"
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/src/i18n/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,10 @@
"help": "在导出 Markdown 时显示模型供应商,如 OpenAI、Gemini 等",
"title": "显示模型供应商"
},
"show_timestamp": {
"title": "导出时显示消息时间戳",
"help": "开启后,导出 Markdown 时每条消息标题后会附加发送时间,格式为 YYYY-MM-DD HH:mm"
},
"standardize_citations": {
"help": "开启后,导出 Markdown 时会将引用标记转换为标准 Markdown 脚注格式 [^1],并格式化引用列表",
"title": "标准化引用格式"
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/src/i18n/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -3825,6 +3825,10 @@
"help": "在匯出 Markdown 時顯示模型供應商,如 OpenAI、Gemini 等",
"title": "顯示模型供應商"
},
"show_timestamp": {
"title": "匯出時顯示訊息時間戳記",
"help": "開啟後,匯出 Markdown 時每條訊息標題後會附加傳送時間,格式為 YYYY-MM-DD HH:mm"
},
"standardize_citations": {
"help": "將引用標記轉換為標準 Markdown 腳註格式 [^1],並格式化引用列表",
"title": "標準化引用格式"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
setmarkdownExportPath,
setShowModelNameInMarkdown,
setShowModelProviderInMarkdown,
setShowTimestampInMarkdown,
setStandardizeCitationsInExport,
setUseTopicNamingForMessageTitle
} from '@renderer/store/settings'
Expand All @@ -30,6 +31,7 @@ const MarkdownExportSettings: FC = () => {
const useTopicNamingForMessageTitle = useSelector((state: RootState) => state.settings.useTopicNamingForMessageTitle)
const showModelNameInExport = useSelector((state: RootState) => state.settings.showModelNameInMarkdown)
const showModelProviderInMarkdown = useSelector((state: RootState) => state.settings.showModelProviderInMarkdown)
const showTimestampInMarkdown = useSelector((state: RootState) => state.settings.showTimestampInMarkdown)
const excludeCitationsInExport = useSelector((state: RootState) => state.settings.excludeCitationsInExport)
const standardizeCitationsInExport = useSelector((state: RootState) => state.settings.standardizeCitationsInExport)

Expand Down Expand Up @@ -59,7 +61,11 @@ const MarkdownExportSettings: FC = () => {
const handleToggleShowModelProvider = (checked: boolean) => {
dispatch(setShowModelProviderInMarkdown(checked))
}


const handleToggleShowTimestamp = (checked: boolean) => {
dispatch(setShowTimestampInMarkdown(checked))
}

const handleToggleExcludeCitations = (checked: boolean) => {
dispatch(setExcludeCitationsInExport(checked))
}
Expand Down Expand Up @@ -127,6 +133,14 @@ const MarkdownExportSettings: FC = () => {
<SettingRow>
<SettingHelpText>{t('settings.data.markdown_export.show_model_provider.help')}</SettingHelpText>
</SettingRow>
<SettingDivider />
<SettingRow>
<SettingRowTitle>{t('settings.data.markdown_export.show_timestamp.title')}</SettingRowTitle>
<Switch checked={showTimestampInMarkdown} onChange={handleToggleShowTimestamp} />
</SettingRow>
<SettingRow>
<SettingHelpText>{t('settings.data.markdown_export.show_timestamp.help')}</SettingHelpText>
</SettingRow>
<SettingDivider />
<SettingRow>
<SettingRowTitle>{t('settings.data.markdown_export.exclude_citations.title')}</SettingRowTitle>
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export interface SettingsState {
notionExportReasoning: boolean
excludeCitationsInExport: boolean
standardizeCitationsInExport: boolean
showTimestampInMarkdown: boolean
yuqueToken: string | null
yuqueUrl: string | null
yuqueRepoId: string | null
Expand Down Expand Up @@ -361,6 +362,7 @@ export const initialState: SettingsState = {
thoughtAutoCollapse: true,
notionExportReasoning: false,
excludeCitationsInExport: false,
showTimestampInMarkdown: false,
standardizeCitationsInExport: false,
yuqueToken: '',
yuqueUrl: '',
Expand Down Expand Up @@ -739,6 +741,9 @@ const settingsSlice = createSlice({
setShowModelProviderInMarkdown: (state, action: PayloadAction<boolean>) => {
state.showModelProviderInMarkdown = action.payload
},
setShowTimestampInMarkdown: (state, action: PayloadAction<boolean>) => {
state.showTimestampInMarkdown = action.payload
},
setThoughtAutoCollapse: (state, action: PayloadAction<boolean>) => {
state.thoughtAutoCollapse = action.payload
},
Expand Down Expand Up @@ -904,6 +909,7 @@ const settingsSlice = createSlice({
})

export const {
setShowTimestampInMarkdown,
setShowModelNameInMarkdown,
setShowModelProviderInMarkdown,
setShowAssistants,
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/src/utils/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ const createBaseMarkdown = (
excludeCitations: boolean = false,
normalizeCitations: boolean = true
): { titleSection: string; reasoningSection: string; contentSection: string; citation: string } => {
const { forceDollarMathInMarkdown } = store.getState().settings
const roleText = getRoleText(message.role, message.model?.name, message.model?.provider)
const titleSection = `## ${roleText}`
const { forceDollarMathInMarkdown, showTimestampInMarkdown } = store.getState().settings
const roleText = getRoleText(message.role, message.model?.name, message.model?.provider)
const timestamp = showTimestampInMarkdown ? ` (${dayjs(message.createdAt).format('YYYY-MM-DD HH:mm')})` : ''
const titleSection = `## ${roleText}${timestamp}`
let reasoningSection = ''

if (includeReasoning) {
Expand Down