Spaces:
Running
Running
update
Browse filesThis view is limited to 50 files because it contains too many changes. Β
See raw diff
- Dockerfile +2 -2
- README.md +11 -1
- app/package.json +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/README.md +3 -3
- app/scripts/{latex-to-mdx β latex-importer}/bib-cleaner.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/filters/equation-ids.lua +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/index.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/latex-converter.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/mdx-converter.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/metadata-extractor.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/package-lock.json +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/package.json +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/post-processor.mjs +0 -0
- app/scripts/{latex-to-mdx β latex-importer}/reference-preprocessor.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/.cursorignore +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/README.md +3 -3
- app/scripts/{notion-to-mdx β notion-importer}/custom-code-renderer.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/debug-properties.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/env.example +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/index.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/input/pages.json +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/mdx-converter.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/notion-converter.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/notion-metadata-extractor.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/smol-training-guide.md +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/output/smol-training-guide.mdx +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/package-lock.json +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/package.json +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/post-processor.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/test-access.mjs +0 -0
- app/scripts/{notion-to-mdx β notion-importer}/yarn.lock +0 -0
- app/src/content/article.mdx +2 -2
- app/src/content/chapters/demo/import-content.mdx +164 -0
Dockerfile
CHANGED
|
@@ -26,10 +26,10 @@ COPY app/ .
|
|
| 26 |
# Conditionally convert LaTeX to MDX if ENABLE_LATEX_CONVERSION=true
|
| 27 |
ARG ENABLE_LATEX_CONVERSION=false
|
| 28 |
RUN if [ "$ENABLE_LATEX_CONVERSION" = "true" ]; then \
|
| 29 |
-
echo "π LaTeX
|
| 30 |
npm run latex:convert; \
|
| 31 |
else \
|
| 32 |
-
echo "βοΈ LaTeX
|
| 33 |
fi
|
| 34 |
|
| 35 |
# Ensure `public/data` is a real directory with real files (not a symlink)
|
|
|
|
| 26 |
# Conditionally convert LaTeX to MDX if ENABLE_LATEX_CONVERSION=true
|
| 27 |
ARG ENABLE_LATEX_CONVERSION=false
|
| 28 |
RUN if [ "$ENABLE_LATEX_CONVERSION" = "true" ]; then \
|
| 29 |
+
echo "π LaTeX importer enabled - running latex:convert..."; \
|
| 30 |
npm run latex:convert; \
|
| 31 |
else \
|
| 32 |
+
echo "βοΈ LaTeX importer disabled - skipping..."; \
|
| 33 |
fi
|
| 34 |
|
| 35 |
# Ensure `public/data` is a real directory with real files (not a symlink)
|
README.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
<div align="center">
|
| 3 |
|
| 4 |
# Research Article Template
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: 'Bringing paper to life: A modern template for scientific writing'
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
header: mini
|
| 9 |
+
app_port: 8080
|
| 10 |
+
thumbnail: https://huggingface.co/spaces/tfrere/research-paper-template/thumb.jpg
|
| 11 |
+
---
|
| 12 |
<div align="center">
|
| 13 |
|
| 14 |
# Research Article Template
|
app/package.json
CHANGED
|
Binary files a/app/package.json and b/app/package.json differ
|
|
|
app/scripts/{latex-to-mdx β latex-importer}/README.md
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
# LaTeX
|
| 2 |
|
| 3 |
-
Complete LaTeX to MDX (Markdown + JSX)
|
| 4 |
|
| 5 |
## π Quick Start
|
| 6 |
|
|
@@ -16,7 +16,7 @@ node mdx-converter.mjs # Markdown β MDX
|
|
| 16 |
## π Structure
|
| 17 |
|
| 18 |
```
|
| 19 |
-
latex-
|
| 20 |
βββ index.mjs # Complete LaTeX β MDX pipeline
|
| 21 |
βββ latex-converter.mjs # LaTeX β Markdown with Pandoc
|
| 22 |
βββ mdx-converter.mjs # Markdown β MDX with Astro components
|
|
|
|
| 1 |
+
# LaTeX Importer
|
| 2 |
|
| 3 |
+
Complete LaTeX to MDX (Markdown + JSX) importer optimized for Astro with advanced support for references, interactive equations, and components.
|
| 4 |
|
| 5 |
## π Quick Start
|
| 6 |
|
|
|
|
| 16 |
## π Structure
|
| 17 |
|
| 18 |
```
|
| 19 |
+
latex-importer/
|
| 20 |
βββ index.mjs # Complete LaTeX β MDX pipeline
|
| 21 |
βββ latex-converter.mjs # LaTeX β Markdown with Pandoc
|
| 22 |
βββ mdx-converter.mjs # Markdown β MDX with Astro components
|
app/scripts/{latex-to-mdx β latex-importer}/bib-cleaner.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/filters/equation-ids.lua
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/index.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/latex-converter.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/mdx-converter.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/metadata-extractor.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/package-lock.json
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/package.json
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/post-processor.mjs
RENAMED
|
File without changes
|
app/scripts/{latex-to-mdx β latex-importer}/reference-preprocessor.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/.cursorignore
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/.notion-to-md/media/27877f1c-9c9d-804d-9c82-f7b3905578ff_media.json
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/README.md
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
# Notion
|
| 2 |
|
| 3 |
-
Complete Notion to MDX (Markdown + JSX)
|
| 4 |
|
| 5 |
## π Quick Start
|
| 6 |
|
|
@@ -23,7 +23,7 @@ node mdx-converter.mjs # Markdown β MDX
|
|
| 23 |
## π Structure
|
| 24 |
|
| 25 |
```
|
| 26 |
-
notion-
|
| 27 |
βββ index.mjs # Complete Notion β MDX pipeline
|
| 28 |
βββ notion-converter.mjs # Notion β Markdown with notion-to-md v4
|
| 29 |
βββ mdx-converter.mjs # Markdown β MDX with Astro components
|
|
|
|
| 1 |
+
# Notion Importer
|
| 2 |
|
| 3 |
+
Complete Notion to MDX (Markdown + JSX) importer optimized for Astro with advanced media handling, interactive components, and seamless integration.
|
| 4 |
|
| 5 |
## π Quick Start
|
| 6 |
|
|
|
|
| 23 |
## π Structure
|
| 24 |
|
| 25 |
```
|
| 26 |
+
notion-importer/
|
| 27 |
βββ index.mjs # Complete Notion β MDX pipeline
|
| 28 |
βββ notion-converter.mjs # Notion β Markdown with notion-to-md v4
|
| 29 |
βββ mdx-converter.mjs # Markdown β MDX with Astro components
|
app/scripts/{notion-to-mdx β notion-importer}/custom-code-renderer.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/debug-properties.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/env.example
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/index.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/input/pages.json
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/mdx-converter.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/notion-converter.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/notion-metadata-extractor.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8013-b668-f14bd1ac0ec0.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8014-834f-d700b623256b.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-801d-841a-e35011491566.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8031-ac8d-c5678af1bdd5.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8048-9b7e-db4fa7485915.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-804d-bd0a-e0b1c15e504f.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8075-ae2e-dc24fe9296ca.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-8078-b6da-c7a4c67c8f35.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808d-9c6d-fae817ac8868.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-808f-b712-c7c608da3fc6.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80a9-b4d0-f2129716632d.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80aa-b968-c54c9fe7e5d7.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b6-be07-e8646502f82a.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80b9-8cfb-f0a6aaaa8760.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e7-a500-fb79cebde7e3.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/media/27877f1c9c9d804d9c82f7b3905578ff/image_27877f1c-9c9d-80e9-b729-dbd328930bed.png
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/smol-training-guide.md
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/output/smol-training-guide.mdx
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/package-lock.json
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/package.json
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/post-processor.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/test-access.mjs
RENAMED
|
File without changes
|
app/scripts/{notion-to-mdx β notion-importer}/yarn.lock
RENAMED
|
File without changes
|
app/src/content/article.mdx
CHANGED
|
@@ -29,7 +29,7 @@ import Markdown from "./chapters/demo/markdown.mdx";
|
|
| 29 |
import Components from "./chapters/demo/components.mdx";
|
| 30 |
import Greetings from "./chapters/demo/greetings.mdx";
|
| 31 |
import VibeCodingCharts from "./chapters/demo/vibe-coding-charts.mdx";
|
| 32 |
-
import
|
| 33 |
|
| 34 |
<Introduction />
|
| 35 |
|
|
@@ -43,7 +43,7 @@ import LatexConversion from "./chapters/demo/latex-convertion.mdx";
|
|
| 43 |
|
| 44 |
<VibeCodingCharts />
|
| 45 |
|
| 46 |
-
<
|
| 47 |
|
| 48 |
<BestPractices />
|
| 49 |
|
|
|
|
| 29 |
import Components from "./chapters/demo/components.mdx";
|
| 30 |
import Greetings from "./chapters/demo/greetings.mdx";
|
| 31 |
import VibeCodingCharts from "./chapters/demo/vibe-coding-charts.mdx";
|
| 32 |
+
import ImportContent from "./chapters/demo/import-content.mdx";
|
| 33 |
|
| 34 |
<Introduction />
|
| 35 |
|
|
|
|
| 43 |
|
| 44 |
<VibeCodingCharts />
|
| 45 |
|
| 46 |
+
<ImportContent />
|
| 47 |
|
| 48 |
<BestPractices />
|
| 49 |
|
app/src/content/chapters/demo/import-content.mdx
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import Note from '../../../components/Note.astro';
|
| 2 |
+
import Accordion from '../../../components/Accordion.astro';
|
| 3 |
+
|
| 4 |
+
## Import from LaTeX or Notion
|
| 5 |
+
|
| 6 |
+
<Note variant="warning">
|
| 7 |
+
β οΈ **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.
|
| 8 |
+
</Note>
|
| 9 |
+
|
| 10 |
+
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.
|
| 11 |
+
|
| 12 |
+
### Available Converters
|
| 13 |
+
|
| 14 |
+
**LaTeX importer** β Transform academic LaTeX papers into interactive web articles
|
| 15 |
+
|
| 16 |
+
**Notion importerX** β Convert Notion pages with media and components
|
| 17 |
+
|
| 18 |
+
Both systems preserve your content while adding modern web features: dark mode, responsive design, optimized figures, and live references.
|
| 19 |
+
|
| 20 |
+
### LaTeX importer
|
| 21 |
+
|
| 22 |
+
Perfect for academic papers, research documents, and scientific content with equations and references.
|
| 23 |
+
|
| 24 |
+
#### Quick Start
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
# Navigate to the LaTeX importer
|
| 28 |
+
cd app/scripts/latex-importer/
|
| 29 |
+
|
| 30 |
+
# Place your LaTeX files in input/
|
| 31 |
+
cp your-paper.tex input/main.tex
|
| 32 |
+
cp your-paper.bib input/main.bib
|
| 33 |
+
cp -r your-figures/ input/figures/
|
| 34 |
+
|
| 35 |
+
# Run the complete conversion
|
| 36 |
+
node index.mjs
|
| 37 |
+
|
| 38 |
+
# Your converted article is ready!
|
| 39 |
+
# β output/main.mdx (ready for the template)
|
| 40 |
+
# β assets/image/ (processed figures)
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
#### What Gets Converted
|
| 44 |
+
|
| 45 |
+
**Mathematical content:**
|
| 46 |
+
- `\label{eq:name}` β Interactive equations with `\htmlId{name}`
|
| 47 |
+
- `\ref{eq:name}` β Clickable equation links
|
| 48 |
+
- Complex math preserved with KaTeX
|
| 49 |
+
|
| 50 |
+
**References and citations:**
|
| 51 |
+
- `\label{sec:intro}` β Invisible anchors `<span id="intro">`
|
| 52 |
+
- `\ref{sec:intro}` β Working internal links
|
| 53 |
+
- Bibliography integration
|
| 54 |
+
|
| 55 |
+
**Visual elements:**
|
| 56 |
+
- `\includegraphics{}` β `<Figure>` components with zoom
|
| 57 |
+
- `\highlight{text}` β `<mark>` styling
|
| 58 |
+
- Figure captions and numbering
|
| 59 |
+
|
| 60 |
+
#### Prerequisites
|
| 61 |
+
|
| 62 |
+
- **Pandoc** installed (`brew install pandoc`)
|
| 63 |
+
- LaTeX source files and bibliography
|
| 64 |
+
- Figures in supported formats (PNG, JPG, PDF)
|
| 65 |
+
|
| 66 |
+
### Notion importer
|
| 67 |
+
|
| 68 |
+
Ideal for collaborative content, documentation, and pages with rich media and interactive elements.
|
| 69 |
+
|
| 70 |
+
#### Quick Start
|
| 71 |
+
|
| 72 |
+
```bash
|
| 73 |
+
# Navigate to the Notion importer
|
| 74 |
+
cd app/scripts/notion-importer/
|
| 75 |
+
|
| 76 |
+
# Install dependencies
|
| 77 |
+
npm install
|
| 78 |
+
|
| 79 |
+
# Setup environment variables
|
| 80 |
+
cp env.example .env
|
| 81 |
+
# Edit .env with your Notion token
|
| 82 |
+
|
| 83 |
+
# Configure pages to convert
|
| 84 |
+
# Edit input/pages.json with your page IDs
|
| 85 |
+
|
| 86 |
+
# Run the complete conversion
|
| 87 |
+
node index.mjs
|
| 88 |
+
|
| 89 |
+
# Your converted content is ready!
|
| 90 |
+
# β output/*.mdx (ready for the template)
|
| 91 |
+
# β output/media/ (downloaded images and files)
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
#### What Gets Converted
|
| 95 |
+
|
| 96 |
+
**Media handling:**
|
| 97 |
+
- Images, files, PDFs automatically downloaded
|
| 98 |
+
- Smart path conversion for web accessibility
|
| 99 |
+
- Figure components with zoom/download functionality
|
| 100 |
+
|
| 101 |
+
**Interactive components:**
|
| 102 |
+
- Callouts β Astro `Note` components
|
| 103 |
+
- Enhanced tables with styled containers
|
| 104 |
+
- Code blocks with copy functionality
|
| 105 |
+
|
| 106 |
+
**Smart formatting:**
|
| 107 |
+
- Notion internal links β relative links
|
| 108 |
+
- Artifact cleanup and optimization
|
| 109 |
+
- Automatic frontmatter generation
|
| 110 |
+
|
| 111 |
+
#### Prerequisites
|
| 112 |
+
|
| 113 |
+
- **Node.js** with ESM support
|
| 114 |
+
- **Notion Integration**: Set up an integration in your Notion workspace
|
| 115 |
+
- **Notion Token**: Copy the "Internal Integration Token"
|
| 116 |
+
- **Shared Pages**: Share the specific Notion page(s) with your integration
|
| 117 |
+
|
| 118 |
+
<Accordion title="Advanced conversion options">
|
| 119 |
+
|
| 120 |
+
**LaTeX importer:**
|
| 121 |
+
```bash
|
| 122 |
+
# Step-by-step conversion
|
| 123 |
+
node latex-converter.mjs # LaTeX β Markdown
|
| 124 |
+
node mdx-converter.mjs # Markdown β MDX
|
| 125 |
+
|
| 126 |
+
# Bibliography only
|
| 127 |
+
node index.mjs --bib-only
|
| 128 |
+
|
| 129 |
+
# Clean output before conversion
|
| 130 |
+
node index.mjs --clean
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
**Notion importer:**
|
| 134 |
+
```bash
|
| 135 |
+
# Full workflow with token
|
| 136 |
+
NOTION_TOKEN=your_token node index.mjs --clean
|
| 137 |
+
|
| 138 |
+
# Notion to Markdown only
|
| 139 |
+
node index.mjs --notion-only
|
| 140 |
+
|
| 141 |
+
# Markdown to MDX only
|
| 142 |
+
node index.mjs --mdx-only
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
<Note variant="info">
|
| 146 |
+
π‘ **Hugging Face Spaces** β When deploying on Hugging Face Spaces, add your `NOTION_TOKEN` to the Space secrets for secure access during the build process.
|
| 147 |
+
</Note>
|
| 148 |
+
|
| 149 |
+
</Accordion>
|
| 150 |
+
|
| 151 |
+
### Docker Deployment
|
| 152 |
+
|
| 153 |
+
When deploying on Hugging Face Spaces, you can enable automatic conversion during the build process:
|
| 154 |
+
|
| 155 |
+
- **LaTeX**: Set `ENABLE_LATEX_CONVERSION=true`
|
| 156 |
+
- **Notion**: Set `ENABLE_NOTION_CONVERSION=true`
|
| 157 |
+
|
| 158 |
+
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.
|
| 159 |
+
|
| 160 |
+
This allows you to maintain source files in your repository while automatically generating the MDX content for production deployment.
|
| 161 |
+
|
| 162 |
+
### Result
|
| 163 |
+
|
| 164 |
+
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.
|