diff --git a/Dockerfile b/Dockerfile index 81aa65f4420b0907e9b759651235dbe6a6b76059..2022d150c921dda4c7dfe5804d0a0e4bf64cc946 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,10 +26,10 @@ COPY app/ . # Conditionally convert LaTeX to MDX if ENABLE_LATEX_CONVERSION=true ARG ENABLE_LATEX_CONVERSION=false RUN if [ "$ENABLE_LATEX_CONVERSION" = "true" ]; then \ - echo "πŸ”„ LaTeX conversion enabled - running latex:convert..."; \ + echo "πŸ”„ LaTeX importer enabled - running latex:convert..."; \ npm run latex:convert; \ else \ - echo "⏭️ LaTeX conversion disabled - skipping..."; \ + echo "⏭️ LaTeX importer disabled - skipping..."; \ fi # Ensure `public/data` is a real directory with real files (not a symlink) diff --git a/README.md b/README.md index fc7be8374eeed54ea9ff6fc98cea4e50d4687353..ab2fefbc220780720989b3cde50c908439d291d7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,14 @@ - +--- +title: 'Bringing paper to life: A modern template for scientific writing' +emoji: πŸ“ +colorFrom: blue +colorTo: indigo +sdk: docker +pinned: false +header: mini +app_port: 8080 +thumbnail: https://huggingface.co/spaces/tfrere/research-paper-template/thumb.jpg +---
# Research Article Template diff --git a/app/package.json b/app/package.json index df93f49e7bdf92671c00235239e31e14c6b9fb70..6bace040eb0c3d6f08ce003cb889c1ec046bface 100644 Binary files a/app/package.json and b/app/package.json differ diff --git a/app/scripts/latex-to-mdx/README.md b/app/scripts/latex-importer/README.md similarity index 96% rename from app/scripts/latex-to-mdx/README.md rename to app/scripts/latex-importer/README.md index ff447bf0da35180484c085a559277f0396d31e1e..4c8a36f3739569c7d033658e82937ad2da5422e6 100644 --- a/app/scripts/latex-to-mdx/README.md +++ b/app/scripts/latex-importer/README.md @@ -1,6 +1,6 @@ -# LaTeX to MDX Toolkit +# LaTeX Importer -Complete LaTeX to MDX (Markdown + JSX) conversion optimized for Astro with advanced support for references, interactive equations, and components. +Complete LaTeX to MDX (Markdown + JSX) importer optimized for Astro with advanced support for references, interactive equations, and components. ## πŸš€ Quick Start @@ -16,7 +16,7 @@ node mdx-converter.mjs # Markdown β†’ MDX ## πŸ“ Structure ``` -latex-to-mdx/ +latex-importer/ β”œβ”€β”€ index.mjs # Complete LaTeX β†’ MDX pipeline β”œβ”€β”€ latex-converter.mjs # LaTeX β†’ Markdown with Pandoc β”œβ”€β”€ mdx-converter.mjs # Markdown β†’ MDX with Astro components diff --git a/app/scripts/latex-to-mdx/bib-cleaner.mjs b/app/scripts/latex-importer/bib-cleaner.mjs similarity index 100% rename from app/scripts/latex-to-mdx/bib-cleaner.mjs rename to app/scripts/latex-importer/bib-cleaner.mjs diff --git a/app/scripts/latex-to-mdx/filters/equation-ids.lua b/app/scripts/latex-importer/filters/equation-ids.lua similarity index 100% rename from app/scripts/latex-to-mdx/filters/equation-ids.lua rename to app/scripts/latex-importer/filters/equation-ids.lua diff --git a/app/scripts/latex-to-mdx/index.mjs b/app/scripts/latex-importer/index.mjs similarity index 100% rename from app/scripts/latex-to-mdx/index.mjs rename to app/scripts/latex-importer/index.mjs diff --git a/app/scripts/latex-to-mdx/latex-converter.mjs b/app/scripts/latex-importer/latex-converter.mjs similarity index 100% rename from app/scripts/latex-to-mdx/latex-converter.mjs rename to app/scripts/latex-importer/latex-converter.mjs diff --git a/app/scripts/latex-to-mdx/mdx-converter.mjs b/app/scripts/latex-importer/mdx-converter.mjs similarity index 100% rename from app/scripts/latex-to-mdx/mdx-converter.mjs rename to app/scripts/latex-importer/mdx-converter.mjs diff --git a/app/scripts/latex-to-mdx/metadata-extractor.mjs b/app/scripts/latex-importer/metadata-extractor.mjs similarity index 100% rename from app/scripts/latex-to-mdx/metadata-extractor.mjs rename to app/scripts/latex-importer/metadata-extractor.mjs diff --git a/app/scripts/latex-to-mdx/package-lock.json b/app/scripts/latex-importer/package-lock.json similarity index 100% rename from app/scripts/latex-to-mdx/package-lock.json rename to app/scripts/latex-importer/package-lock.json diff --git a/app/scripts/latex-to-mdx/package.json b/app/scripts/latex-importer/package.json similarity index 100% rename from app/scripts/latex-to-mdx/package.json rename to app/scripts/latex-importer/package.json diff --git a/app/scripts/latex-to-mdx/post-processor.mjs b/app/scripts/latex-importer/post-processor.mjs similarity index 100% rename from app/scripts/latex-to-mdx/post-processor.mjs rename to app/scripts/latex-importer/post-processor.mjs diff --git a/app/scripts/latex-to-mdx/reference-preprocessor.mjs b/app/scripts/latex-importer/reference-preprocessor.mjs similarity index 100% rename from app/scripts/latex-to-mdx/reference-preprocessor.mjs rename to app/scripts/latex-importer/reference-preprocessor.mjs diff --git a/app/scripts/notion-to-mdx/.cursorignore b/app/scripts/notion-importer/.cursorignore similarity index 100% rename from app/scripts/notion-to-mdx/.cursorignore rename to app/scripts/notion-importer/.cursorignore diff --git a/app/scripts/notion-to-mdx/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json b/app/scripts/notion-importer/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json similarity index 100% rename from app/scripts/notion-to-mdx/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json rename to app/scripts/notion-importer/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json diff --git a/app/scripts/notion-to-mdx/README.md b/app/scripts/notion-importer/README.md similarity index 97% rename from app/scripts/notion-to-mdx/README.md rename to app/scripts/notion-importer/README.md index ebcf28886227bed3b67f3971a75a7cc622503358..96f8ea895862954f0fa0801e2815b8627029374f 100644 --- a/app/scripts/notion-to-mdx/README.md +++ b/app/scripts/notion-importer/README.md @@ -1,6 +1,6 @@ -# Notion to MDX Toolkit +# Notion Importer -Complete Notion to MDX (Markdown + JSX) conversion optimized for Astro with advanced media handling, interactive components, and seamless integration. +Complete Notion to MDX (Markdown + JSX) importer optimized for Astro with advanced media handling, interactive components, and seamless integration. ## πŸš€ Quick Start @@ -23,7 +23,7 @@ node mdx-converter.mjs # Markdown β†’ MDX ## πŸ“ Structure ``` -notion-to-mdx/ +notion-importer/ β”œβ”€β”€ index.mjs # Complete Notion β†’ MDX pipeline β”œβ”€β”€ notion-converter.mjs # Notion β†’ Markdown with notion-to-md v4 β”œβ”€β”€ mdx-converter.mjs # Markdown β†’ MDX with Astro components diff --git a/app/scripts/notion-to-mdx/custom-code-renderer.mjs b/app/scripts/notion-importer/custom-code-renderer.mjs similarity index 100% rename from app/scripts/notion-to-mdx/custom-code-renderer.mjs rename to app/scripts/notion-importer/custom-code-renderer.mjs diff --git a/app/scripts/notion-to-mdx/debug-properties.mjs b/app/scripts/notion-importer/debug-properties.mjs similarity index 100% rename from app/scripts/notion-to-mdx/debug-properties.mjs rename to app/scripts/notion-importer/debug-properties.mjs diff --git a/app/scripts/notion-to-mdx/env.example b/app/scripts/notion-importer/env.example similarity index 100% rename from app/scripts/notion-to-mdx/env.example rename to app/scripts/notion-importer/env.example diff --git a/app/scripts/notion-to-mdx/index.mjs b/app/scripts/notion-importer/index.mjs similarity index 100% rename from app/scripts/notion-to-mdx/index.mjs rename to app/scripts/notion-importer/index.mjs diff --git a/app/scripts/notion-to-mdx/input/pages.json b/app/scripts/notion-importer/input/pages.json similarity index 100% rename from app/scripts/notion-to-mdx/input/pages.json rename to app/scripts/notion-importer/input/pages.json diff --git a/app/scripts/notion-to-mdx/mdx-converter.mjs b/app/scripts/notion-importer/mdx-converter.mjs similarity index 100% rename from app/scripts/notion-to-mdx/mdx-converter.mjs rename to app/scripts/notion-importer/mdx-converter.mjs diff --git a/app/scripts/notion-to-mdx/notion-converter.mjs b/app/scripts/notion-importer/notion-converter.mjs similarity index 100% rename from app/scripts/notion-to-mdx/notion-converter.mjs rename to app/scripts/notion-importer/notion-converter.mjs diff --git a/app/scripts/notion-to-mdx/notion-metadata-extractor.mjs b/app/scripts/notion-importer/notion-metadata-extractor.mjs similarity index 100% rename from app/scripts/notion-to-mdx/notion-metadata-extractor.mjs rename to app/scripts/notion-importer/notion-metadata-extractor.mjs diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png diff --git a/app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png b/app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png similarity index 100% rename from app/scripts/notion-to-mdx/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png rename to app/scripts/notion-importer/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png diff --git a/app/scripts/notion-to-mdx/output/smol-training-guide.md b/app/scripts/notion-importer/output/smol-training-guide.md similarity index 100% rename from app/scripts/notion-to-mdx/output/smol-training-guide.md rename to app/scripts/notion-importer/output/smol-training-guide.md diff --git a/app/scripts/notion-to-mdx/output/smol-training-guide.mdx b/app/scripts/notion-importer/output/smol-training-guide.mdx similarity index 100% rename from app/scripts/notion-to-mdx/output/smol-training-guide.mdx rename to app/scripts/notion-importer/output/smol-training-guide.mdx diff --git a/app/scripts/notion-to-mdx/package-lock.json b/app/scripts/notion-importer/package-lock.json similarity index 100% rename from app/scripts/notion-to-mdx/package-lock.json rename to app/scripts/notion-importer/package-lock.json diff --git a/app/scripts/notion-to-mdx/package.json b/app/scripts/notion-importer/package.json similarity index 100% rename from app/scripts/notion-to-mdx/package.json rename to app/scripts/notion-importer/package.json diff --git a/app/scripts/notion-to-mdx/post-processor.mjs b/app/scripts/notion-importer/post-processor.mjs similarity index 100% rename from app/scripts/notion-to-mdx/post-processor.mjs rename to app/scripts/notion-importer/post-processor.mjs diff --git a/app/scripts/notion-to-mdx/test-access.mjs b/app/scripts/notion-importer/test-access.mjs similarity index 100% rename from app/scripts/notion-to-mdx/test-access.mjs rename to app/scripts/notion-importer/test-access.mjs diff --git a/app/scripts/notion-to-mdx/yarn.lock b/app/scripts/notion-importer/yarn.lock similarity index 100% rename from app/scripts/notion-to-mdx/yarn.lock rename to app/scripts/notion-importer/yarn.lock diff --git a/app/src/content/article.mdx b/app/src/content/article.mdx index 242c656a1689abf0b197b1ee14491b56a424e123..5e3846426f2e99750529c1abe0697a9552aa0e4e 100644 --- a/app/src/content/article.mdx +++ b/app/src/content/article.mdx @@ -29,7 +29,7 @@ import Markdown from "./chapters/demo/markdown.mdx"; import Components from "./chapters/demo/components.mdx"; import Greetings from "./chapters/demo/greetings.mdx"; import VibeCodingCharts from "./chapters/demo/vibe-coding-charts.mdx"; -import LatexConversion from "./chapters/demo/latex-convertion.mdx"; +import ImportContent from "./chapters/demo/import-content.mdx"; @@ -43,7 +43,7 @@ import LatexConversion from "./chapters/demo/latex-convertion.mdx"; - + diff --git a/app/src/content/chapters/demo/import-content.mdx b/app/src/content/chapters/demo/import-content.mdx new file mode 100644 index 0000000000000000000000000000000000000000..2ca3639c4ae35832e0020838edbeb58e91c889ea --- /dev/null +++ b/app/src/content/chapters/demo/import-content.mdx @@ -0,0 +1,164 @@ +import Note from '../../../components/Note.astro'; +import Accordion from '../../../components/Accordion.astro'; + +## Import from LaTeX or Notion + + +⚠️ **Experimental Features** β€” These conversion toolkits are in active development and may not work perfectly with all source documents. Results may vary depending on your content structure and complexity. + + +Convert your existing content directly to this template using our built-in conversion toolkits. Two powerful systems transform different source formats into fully interactive web articles with all template features. + +### Available Converters + +**LaTeX importer** β€” Transform academic LaTeX papers into interactive web articles + +**Notion importerX** β€” Convert Notion pages with media and components + +Both systems preserve your content while adding modern web features: dark mode, responsive design, optimized figures, and live references. + +### LaTeX importer + +Perfect for academic papers, research documents, and scientific content with equations and references. + +#### Quick Start + +```bash +# Navigate to the LaTeX importer +cd app/scripts/latex-importer/ + +# Place your LaTeX files in input/ +cp your-paper.tex input/main.tex +cp your-paper.bib input/main.bib +cp -r your-figures/ input/figures/ + +# Run the complete conversion +node index.mjs + +# Your converted article is ready! +# β†’ output/main.mdx (ready for the template) +# β†’ assets/image/ (processed figures) +``` + +#### What Gets Converted + +**Mathematical content:** +- `\label{eq:name}` β†’ Interactive equations with `\htmlId{name}` +- `\ref{eq:name}` β†’ Clickable equation links +- Complex math preserved with KaTeX + +**References and citations:** +- `\label{sec:intro}` β†’ Invisible anchors `` +- `\ref{sec:intro}` β†’ Working internal links +- Bibliography integration + +**Visual elements:** +- `\includegraphics{}` β†’ `
` components with zoom +- `\highlight{text}` β†’ `` styling +- Figure captions and numbering + +#### Prerequisites + +- **Pandoc** installed (`brew install pandoc`) +- LaTeX source files and bibliography +- Figures in supported formats (PNG, JPG, PDF) + +### Notion importer + +Ideal for collaborative content, documentation, and pages with rich media and interactive elements. + +#### Quick Start + +```bash +# Navigate to the Notion importer +cd app/scripts/notion-importer/ + +# Install dependencies +npm install + +# Setup environment variables +cp env.example .env +# Edit .env with your Notion token + +# Configure pages to convert +# Edit input/pages.json with your page IDs + +# Run the complete conversion +node index.mjs + +# Your converted content is ready! +# β†’ output/*.mdx (ready for the template) +# β†’ output/media/ (downloaded images and files) +``` + +#### What Gets Converted + +**Media handling:** +- Images, files, PDFs automatically downloaded +- Smart path conversion for web accessibility +- Figure components with zoom/download functionality + +**Interactive components:** +- Callouts β†’ Astro `Note` components +- Enhanced tables with styled containers +- Code blocks with copy functionality + +**Smart formatting:** +- Notion internal links β†’ relative links +- Artifact cleanup and optimization +- Automatic frontmatter generation + +#### Prerequisites + +- **Node.js** with ESM support +- **Notion Integration**: Set up an integration in your Notion workspace +- **Notion Token**: Copy the "Internal Integration Token" +- **Shared Pages**: Share the specific Notion page(s) with your integration + + + +**LaTeX importer:** +```bash +# Step-by-step conversion +node latex-converter.mjs # LaTeX β†’ Markdown +node mdx-converter.mjs # Markdown β†’ MDX + +# Bibliography only +node index.mjs --bib-only + +# Clean output before conversion +node index.mjs --clean +``` + +**Notion importer:** +```bash +# Full workflow with token +NOTION_TOKEN=your_token node index.mjs --clean + +# Notion to Markdown only +node index.mjs --notion-only + +# Markdown to MDX only +node index.mjs --mdx-only +``` + + +πŸ’‘ **Hugging Face Spaces** β€” When deploying on Hugging Face Spaces, add your `NOTION_TOKEN` to the Space secrets for secure access during the build process. + + + + +### Docker Deployment + +When deploying on Hugging Face Spaces, you can enable automatic conversion during the build process: + +- **LaTeX**: Set `ENABLE_LATEX_CONVERSION=true` +- **Notion**: Set `ENABLE_NOTION_CONVERSION=true` + +If these variables are configured in your Space, the build process will automatically execute the conversion, transforming your source content into the final blog post format. + +This allows you to maintain source files in your repository while automatically generating the MDX content for production deployment. + +### Result + +Both conversion systems produce fully interactive articles that preserve your original content while gaining all template benefits: responsive design, interactive equations, zoomable figures, and modern web features. \ No newline at end of file diff --git a/app/src/content/chapters/demo/introduction.mdx b/app/src/content/chapters/demo/introduction.mdx index 684a65e482da2755dd32d8c29a820e623e2ec2e6..52ab7fabeed078fa56fc125c937da6116a27992a 100644 --- a/app/src/content/chapters/demo/introduction.mdx +++ b/app/src/content/chapters/demo/introduction.mdx @@ -1,13 +1,14 @@ import Sidenote from "../../../components/Sidenote.astro"; -Welcome to this single‑page **research article template**. It helps you publish **clear**, **modern**, and **interactive technical writing** with **minimal setup**. +Welcome to this open source **research article template**. It helps you publish **clear**, **modern**, and **interactive technical writing** with **minimal setup**. - Reading time: 20–25 minutes. + Read time: 20–25 minutes. Grounded in up to date good practices in web dev, it favors **interactive explanations**, **clear notation**, and **inspectable examples** over static snapshots. +Available on [GitHub](https://github.com/tfrere/research-article-template) deployable on [Hugging Face Spaces](https://huggingface.co/spaces/tfrere/research-article-template). #### Features diff --git a/app/src/content/chapters/demo/latex-convertion.mdx b/app/src/content/chapters/demo/latex-convertion.mdx deleted file mode 100644 index f6f1451a83e4748280037c63990468357cfaac54..0000000000000000000000000000000000000000 --- a/app/src/content/chapters/demo/latex-convertion.mdx +++ /dev/null @@ -1,121 +0,0 @@ -import Note from '../../../components/Note.astro'; -import Accordion from '../../../components/Accordion.astro'; - -## From LaTeX to Web - - -⚠️ **Highly Experimental Feature** β€” This LaTeX conversion toolkit is in active development and may not work perfectly with all LaTeX documents. Results may vary depending on your document structure and complexity. - - -Convert your existing LaTeX papers directly to this template using the built-in LaTeX to MDX toolkit. This powerful system transforms academic LaTeX documents into fully interactive web articles with all template features. - -### How it works - -The conversion pipeline transforms your LaTeX source into template-ready MDX: - - -**Smart Conversion** β€” The system preserves scientific formatting while adding interactivity: equations become clickable, figures get zoom functionality, and references become live links. - - -```bash -# Navigate to the conversion toolkit -cd app/scripts/latex-to-mdx/ - -# Place your LaTeX files in input/ -cp your-paper.tex input/main.tex -cp your-paper.bib input/main.bib -cp -r your-figures/ input/figures/ - -# Run the complete conversion -node index.mjs - -# Your converted article is ready! -# β†’ output/main.mdx (ready for the template) -# β†’ assets/image/ (processed figures) -``` - -### What gets converted - -The system intelligently transforms LaTeX elements into template components: - -**Mathematical content:** -- `\label{eq:name}` β†’ Interactive equations with `\htmlId{name}` -- `\ref{eq:name}` β†’ Clickable equation links -- Complex math preserved with KaTeX - -**References and citations:** -- `\label{sec:intro}` β†’ Invisible anchors `` -- `\ref{sec:intro}` β†’ Working internal links -- Bibliography integration - -**Visual elements:** -- `\includegraphics{}` β†’ `
` components with zoom -- `\highlight{text}` β†’ `` styling -- Figure captions and numbering - -**Structure:** -- Sections β†’ Proper heading hierarchy -- Custom LaTeX commands β†’ Clean markdown -- Code snippets β†’ Syntax-highlighted blocks - -### Example transformation - -**LaTeX input:** -```latex -\section{Introduction}\label{sec:intro} - -The main equation is: -\begin{equation}\label{eq:main} -E = mc^2 -\end{equation} - -As shown in equation \ref{eq:main}... - -\includegraphics{figure1.png} -``` - -**Generated MDX:** -```mdx -## Introduction - - -The main equation is: -$$\htmlId{main}{E = mc^2}$$ - -As shown in [equation](#main)... - -
-``` - -### Prerequisites - -- **Pandoc** installed (`brew install pandoc`) -- LaTeX source files and bibliography -- Figures in supported formats (PNG, JPG, PDF) - - -```bash -# Conversion pipeline steps -node latex-converter.mjs # LaTeX β†’ Markdown -node mdx-converter.mjs # Markdown β†’ MDX - -# Bibliography only -node index.mjs --bib-only - -# Clean output before conversion -node index.mjs --clean - -# Custom input/output paths -node index.mjs --input=paper.tex --output=../content/ -``` - - -The result is a fully interactive article that preserves your scientific content while gaining all template benefits: responsive design, interactive equations, zoomable figures, and modern web features. - -### Docker deployment with LaTeX conversion - -When deploying on Hugging Face Spaces, you can enable automatic LaTeX conversion during the build process by setting the `ENABLE_LATEX_CONVERSION=true` environment variable. - -If this variable is configured in your Space, the build process will automatically execute the LaTeX to MDX conversion, transforming your LaTeX sources into the final blog post format. - -This allows you to maintain LaTeX sources in your repository while automatically generating the MDX content for production deployment.