Skip to content

feat: add Markdown export for conference and workshop pages - #23

Open
MaddulaPavan wants to merge 2 commits into
Yeping-Hu:mainfrom
MaddulaPavan:feature/copy-download-md
Open

feat: add Markdown export for conference and workshop pages#23
MaddulaPavan wants to merge 2 commits into
Yeping-Hu:mainfrom
MaddulaPavan:feature/copy-download-md

Conversation

@MaddulaPavan

Copy link
Copy Markdown

Summary & Goal

This PR adds client-side Markdown Export & Sharing capabilities for both conference edition pages and individual workshop pages. The feature allows users to instantly copy or download comprehensive workshop information formatted specifically for use with AI assistants (ChatGPT, Claude, Gemini, Copilot, Cursor, etc.) without needing to manually copy dozens of individual pages.

The implementation is 100% client-side, requiring no backend or API changes, adhering strictly to the repository's static-site design philosophy.


Key Features Implemented

1. Conference Edition Export (/conference/[conf])

  • UI Positioning: Placed directly beneath each conference edition header (e.g. NeurIPS 2026, NeurIPS 2025).
  • Actions: Includes "📋 Copy as Markdown" and "⬇ Download .md" buttons for every edition.
  • Formatted Structure: Outputs a clean Markdown document containing a metadata header (Title, Source, Conference, Edition Year, Generation Date, Total Workshop Count) followed by formatted sections for each workshop.
  • Human-Readable Topics: Resolves raw topic IDs (e.g., safety-alignment) to human-readable labels (e.g., - Safety and Alignment) using topicById.
  • File Download: Downloads {conf-id}-{year}-workshops.md (e.g., neurips-2026-workshops.md).

2. Individual Workshop Export (/workshop/[slug])

  • UI Positioning & Styling: Placed inside the .linkrow header alongside existing links (OpenReview venue ↗, ✎ Edit this entry).
  • Link Variant: Uses variant="link" to match native link font size, link color, hover transitions, and text decoration.
  • Copy Action: Clicking "📋 Copy as Markdown" copies the single workshop Markdown structure directly to clipboard with a 2-second ✓ Copied! green confirmation.

Technical & Architecture Details

  • Centralized Formatter (site/src/lib/markdown.ts): Keeps Markdown generation logic decoupled from UI components.
  • Client-Side Event Delegation (MarkdownExport.astro): Uses a global delegated click listener (document.addEventListener('click')) so export handlers continue working seamlessly across Astro View Transitions client-side page navigations.
  • Router Interception Bypass: File downloads dispatch non-bubbling MouseEvents (bubbles: false), preventing client-side routers from intercepting file saves as tab navigations.
  • Cross-Platform Build Compatibility: Fixed Windows quote escaping (\"[data-pf-ws]\") in package.json build scripts and added automated Pagefind indexing sync to public/pagefind/ so local development (npm run dev) works seamlessly alongside production builds (npm run build).

Verification & Testing

  • Tested locally with npm run dev and npm run build.
  • Verified clean build output: all 879 static HTML pages compiled successfully alongside both Pagefind search indexes (pagefind and pagefind-papers).
  • Verified copy feedback UI and native .md downloads across multiple browser sessions.

@Yeping-Hu Yeping-Hu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — it's a genuinely useful idea, and the implementation is clean: a pure formatter separated from the UI, no new dependencies, no backend. I'd like to take it, with some changes.

Numbers below are from merging your branch into current main and building, so they reflect where the repo is now rather than where it was when you branched.

The main thing: page weight

The Markdown for every section is embedded in the HTML as a data attribute, and each section carries it twice (Copy and Download each hold their own copy):

page total markdown payload share
/conference/neurips/ 411,317 B 289,132 B 70.3%
/conference/iros/ 159,495 B 105,914 B 66.4%
a workshop page 16,785 B 884 B 5.3%

That NeurIPS page is ~119 KB on main today, so it more than triples, and every visitor downloads the export text whether or not they use it.

The fix fits a pattern already in the repo: generate the Markdown as build output rather than embedding it, the same way src/pages/feeds/[feed].ics.ts emits 256 calendar feeds and src/pages/api/workshops.json.ts emits JSON. Download becomes a plain link to /exports/neurips-2026-workshops.md; Copy does a fetch() on the same URL. That drops ~289 KB from the page and removes the duplication. It's 24 files, one per conference-year, regenerated on every deploy with no manual upkeep. There's a short write-up of the convention under "What the JSON API exposes for deadlines" in docs/ARCHITECTURE.md.

Given that, could we split this into two PRs? The per-workshop copy link is only 884 bytes and good as-is — I'd like to merge that quickly, separately from the conference-level export.

Fixes for the per-workshop part

  1. Drop notes from the output (or filter the boilerplate). 889 of 898 entries have notes: "Topics were auto-suggested and may be imprecise — edits welcome.", so nearly every export ends with that maintenance note presented as the workshop's Description.

  2. Include abstract_deadline. This landed after you branched: ~3% of venues gate submission behind a mandatory abstract registration before the paper deadline. I decoded the export for neurips-2026-asci on the merged branch — it contains Aug 29 and no mention of Aug 20 or the word "Abstract" anywhere, so anyone pasting that into an assistant gets a deadline nine days later than the real gate. This one I'd treat as a correctness bug rather than a nice-to-have.

  3. Theming. --link, --link-hover, --text and --font-sans aren't defined in this codebase, so the link falls back to #2563eb and renders blue while every other link on the site is var(--accent) green. Dark mode is also keyed on @media (prefers-color-scheme: dark), but the site themes via :root[data-theme="dark"], so a manual theme toggle won't be honoured. var(--accent) / var(--warn) and the [data-theme] selector should cover it.

  4. Real Markdown. Status\nOpen call is a single newline, so Markdown renders it as one paragraph ("Status Open call"). **Status:** Open call or a list would fix it.

  5. Optional, but worth considering: there's now a deadline_history field carrying an append-only log of observed deadline values. A line like "extended by 5 days on 2026-08-04" would give a reader (or an LLM) useful context about how settled a deadline is. Entirely your call — unlike the abstract deadline, nothing is wrong without it.

A short test for markdown.ts would be welcome too — it's a pure function, and CI already runs 16 scripts/*_test.mjs files.

The non-feature changes

I'd rather see these in their own PR:

  • The --root-selector quoting fix for Windows is a good catch and I'll happily take it.
  • Copying the Pagefind index into site/public/ means the next astro build copies the previous index into dist/ before regenerating, so stale index files can accumulate locally. CI is a fresh checkout so production isn't affected, but it makes local builds non-idempotent — worth discussing separately.
  • .gitignore adding site/.astro/: that directory is tracked and actively maintained — I committed a regeneration of site/.astro/content.d.ts last week after bumping Astro to 7.1.6, since Dependabot doesn't run a build. Ignoring the directory would hide that the file needs regenerating on the next upgrade.

One more note

The view-transition handling (global click delegation, non-bubbling MouseEvent to dodge router interception) is solving a problem this site doesn't have — there's no ClientRouter/ViewTransitions anywhere in src/. Not harmful, but a plain listener would be simpler if you'd rather drop it.

You'll also need a rebase: main is 36 commits ahead, including 6 commits to conference/[conf].astro and 4 to workshop/[slug].astro. It still merges cleanly — I checked — but the conference listing is now a two-column grid with full workshop titles under each acronym, and the workshop page carries an abstract-deadline line plus a deadline-history section, so it's worth confirming your component still sits where you intended.

Thanks again for a well-described PR — and happy to take on the build-output route myself if you'd rather not, since it leans on repo conventions you'd have no reason to know.

@MaddulaPavan
MaddulaPavan force-pushed the feature/copy-download-md branch from 5069888 to 47b349e Compare August 6, 2026 20:22
@MaddulaPavan

Copy link
Copy Markdown
Author

Thanks for the detailed review @Yeping-Hu!

As requested, I've split this into two parts. This PR (#23) now focuses strictly on the per-workshop export (/workshop/[slug]) along with all your feedback items:

  • Abstract Deadlines: Included abstract_deadline whenever present.
  • Deadline History: Added deadline_history changes to the export.
  • Boilerplate Notes Filtering: Filtered out machine auto-suggested topic notes from the Description.
  • Real Markdown Formatting: Formatted properties into clean bold bulleted lists (- **Status:** Open call, etc.).
  • Design System & Themes: Uses site CSS variables (var(--accent), var(--ink), etc.), respecting light mode and dark mode toggles (:root[data-theme="dark"]).
  • Unit Tests: Added scripts/markdown_test.mjs (all 17 assertions passing).
  • Non-Feature Cleanup: Kept the Windows --root-selector quoting fix in package.json, removed fs.cpSync, and reverted site/.astro/ from .gitignore.

The conference-level export using static build outputs (/exports/[export].md.ts) has been prepared on a separate branch (feature/conference-markdown-export) and will be submitted as PR #2 right after this one is merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants