thibaud frere commited on
Commit
ead50ba
·
1 Parent(s): 2225c34

add latex auto deploy feature to doc

Browse files
Dockerfile CHANGED
@@ -2,6 +2,15 @@
2
  # Build with Playwright (browsers and deps ready)
3
  FROM mcr.microsoft.com/playwright:v1.55.0-jammy AS build
4
 
 
 
 
 
 
 
 
 
 
5
  # Set the working directory in the container
6
  WORKDIR /app
7
 
@@ -14,6 +23,15 @@ RUN npm install
14
  # Copy the rest of the application code
15
  COPY app/ .
16
 
 
 
 
 
 
 
 
 
 
17
  # Ensure `public/data` is a real directory with real files (not a symlink)
18
  # This handles the case where `public/data` is a symlink in the repo, which
19
  # would be broken inside the container after COPY.
 
2
  # Build with Playwright (browsers and deps ready)
3
  FROM mcr.microsoft.com/playwright:v1.55.0-jammy AS build
4
 
5
+ # Install git, git-lfs, and dependencies for Pandoc (only if ENABLE_LATEX_CONVERSION=true)
6
+ RUN apt-get update && apt-get install -y git git-lfs wget && apt-get clean
7
+
8
+ # Install latest Pandoc from GitHub releases (only installed if needed later)
9
+ RUN wget -qO- https://github.com/jgm/pandoc/releases/download/3.8/pandoc-3.8-linux-amd64.tar.gz | tar xzf - -C /tmp && \
10
+ cp /tmp/pandoc-3.8/bin/pandoc /usr/local/bin/ && \
11
+ cp /tmp/pandoc-3.8/bin/pandoc-lua /usr/local/bin/ && \
12
+ rm -rf /tmp/pandoc-3.8
13
+
14
  # Set the working directory in the container
15
  WORKDIR /app
16
 
 
23
  # Copy the rest of the application code
24
  COPY app/ .
25
 
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 conversion enabled - running latex:convert..."; \
30
+ npm run latex:convert; \
31
+ else \
32
+ echo "⏭️ LaTeX conversion disabled - skipping..."; \
33
+ fi
34
+
35
  # Ensure `public/data` is a real directory with real files (not a symlink)
36
  # This handles the case where `public/data` is a symlink in the repo, which
37
  # would be broken inside the container after COPY.
app/package.json CHANGED
Binary files a/app/package.json and b/app/package.json differ
 
app/src/content/chapters/demo/writing-your-content.mdx CHANGED
@@ -140,9 +140,43 @@ Use the **color picker** below to see how the primary color affects the theme.
140
  Here is an example of an <a href="#">interactive element</a>.
141
  </Sidenote>
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  ### LaTeX to Template Conversion
145
 
 
 
 
 
146
  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.
147
 
148
  #### How it works
@@ -248,32 +282,10 @@ node index.mjs --input=paper.tex --output=../content/
248
 
249
  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.
250
 
251
- #### Color palettes
252
-
253
- Here is a suggestion of **color palettes** for your **data visualizations** that align with your **brand identity**. These palettes are generated from your `--primary-color`.
254
-
255
- <Palettes />
256
- <br/>
257
- **Use color with care.**
258
- Color should rarely be the only channel of meaning.
259
- Always pair it with text, icons, shape or position. The simulation helps you spot palettes and states that become indistinguishable for people with color‑vision deficiencies.
260
-
261
- #### Using the palettes
262
-
263
- You can copy them manually from the palette viewer just above, or fetch colors via `window.ColorPalettes.getColors(key, count)` where `key` is one of `'categorical'`, `'sequential'`, `'diverging'`, and `count` is the desired number of colors (defaults to 6).
264
 
265
- <Accordion title="Code example">
266
- ```js
267
- // Usage (with explicit counts)
268
- const cat = window.ColorPalettes.getColors('categorical', 8);
269
- const seq = window.ColorPalettes.getColors('sequential', 8);
270
- const div = window.ColorPalettes.getColors('diverging', 7);
271
 
272
- // For current primary color string
273
- const primaryHex = window.ColorPalettes.getPrimary();
274
 
275
- // If you change --primary-color dynamically, call refresh to notify listeners
276
- document.documentElement.style.setProperty('--primary-color', '#6D4AFF');
277
- window.ColorPalettes.refresh();
278
- ```
279
- </Accordion>
 
140
  Here is an example of an <a href="#">interactive element</a>.
141
  </Sidenote>
142
 
143
+ #### Color palettes
144
+
145
+ Here is a suggestion of **color palettes** for your **data visualizations** that align with your **brand identity**. These palettes are generated from your `--primary-color`.
146
+
147
+ <Palettes />
148
+ <br/>
149
+ **Use color with care.**
150
+ Color should rarely be the only channel of meaning.
151
+ Always pair it with text, icons, shape or position. The simulation helps you spot palettes and states that become indistinguishable for people with color‑vision deficiencies.
152
+
153
+ #### Using the palettes
154
+
155
+ You can copy them manually from the palette viewer just above, or fetch colors via `window.ColorPalettes.getColors(key, count)` where `key` is one of `'categorical'`, `'sequential'`, `'diverging'`, and `count` is the desired number of colors (defaults to 6).
156
+
157
+ <Accordion title="Code example">
158
+ ```js
159
+ // Usage (with explicit counts)
160
+ const cat = window.ColorPalettes.getColors('categorical', 8);
161
+ const seq = window.ColorPalettes.getColors('sequential', 8);
162
+ const div = window.ColorPalettes.getColors('diverging', 7);
163
+
164
+ // For current primary color string
165
+ const primaryHex = window.ColorPalettes.getPrimary();
166
+
167
+ // If you change --primary-color dynamically, call refresh to notify listeners
168
+ document.documentElement.style.setProperty('--primary-color', '#6D4AFF');
169
+ window.ColorPalettes.refresh();
170
+ ```
171
+ </Accordion>
172
+
173
 
174
  ### LaTeX to Template Conversion
175
 
176
+ <Note variant="warning">
177
+ ⚠️ **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.
178
+ </Note>
179
+
180
  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.
181
 
182
  #### How it works
 
282
 
283
  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.
284
 
285
+ #### Docker deployment with LaTeX conversion
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
+ 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.
 
 
 
 
 
288
 
289
+ 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.
 
290
 
291
+ This allows you to maintain LaTeX sources in your repository while automatically generating the MDX content for production deployment.