feat(ui): breadcrumb (Space › parent › page) + export menu (md/txt/html/pdf) on pages & spaces
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// pages & references table below (all pages; refs up to the API max).
|
||||
import { api } from '../api.js';
|
||||
import { el, mount } from '../dom.js';
|
||||
import { exportMenu } from '../components/export_menu.js';
|
||||
|
||||
function projItem(p) {
|
||||
return el('li', {},
|
||||
@@ -51,7 +52,17 @@ export async function render(main, ctx) {
|
||||
];
|
||||
|
||||
mount(main,
|
||||
el('h1', { class: 'view-h1' }, space.name),
|
||||
el('div', { class: 'doc-head' },
|
||||
el('h1', { class: 'view-h1', style: { margin: '0' } }, space.name),
|
||||
exportMenu({
|
||||
filenameBase: 'space-' + (space.slug || space.name),
|
||||
getContent: async () => {
|
||||
const full = await Promise.all(pages.map(p => api.get('/api/pages/' + p.id).catch(() => null)));
|
||||
const md = full.filter(Boolean).map(p => `# ${p.title}\n\n${p.body_md || ''}`).join('\n\n---\n\n');
|
||||
return { title: space.name, md };
|
||||
}
|
||||
})
|
||||
),
|
||||
el('p', { class: 'view-sub' }, space.description || el('span', { class: 'muted' }, 'No description.')),
|
||||
|
||||
// Top: Projects + Open tasks, side by side.
|
||||
|
||||
Reference in New Issue
Block a user