@portosaur/core 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portosaur/core",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "The engine of portosaur that translates YAML configuration into Docusaurus structures.",
5
5
  "license": "GPL-3.0-only",
6
6
  "author": "soymadip",
@@ -27,9 +27,11 @@
27
27
  },
28
28
  "types": "./src/index.d.ts",
29
29
  "dependencies": {
30
- "@portosaur/logger": "^0.3.0",
30
+ "@portosaur/logger": "^0.5.0",
31
31
  "favicons": "^7.2.0",
32
32
  "js-yaml": "^4.1.1",
33
+ "rehype-katex": "7",
34
+ "remark-math": "6",
33
35
  "sharp": "^0.34.5"
34
36
  },
35
37
  "engines": {
@@ -11,6 +11,9 @@ import {
11
11
  buildHeadTags,
12
12
  } from "../utils/docusaurus.mjs";
13
13
 
14
+ import remarkMath from "remark-math";
15
+ import rehypeKatex from "rehype-katex";
16
+
14
17
  // ------- Main Configuration Generator -------
15
18
 
16
19
  /**
@@ -302,8 +305,15 @@ export function buildDocuConfig(rawUserConfig, projectDir, context = {}) {
302
305
  portoPaths.theme ?? context.portoRoot ?? "",
303
306
  "config/sidebar.jsx",
304
307
  ),
308
+ remarkPlugins: [remarkMath],
309
+ rehypePlugins: [rehypeKatex],
310
+ },
311
+ blog: {
312
+ path: "blog",
313
+ showReadingTime: false,
314
+ remarkPlugins: [remarkMath],
315
+ rehypePlugins: [rehypeKatex],
305
316
  },
306
- blog: { path: "blog", showReadingTime: false },
307
317
  theme: {
308
318
  customCss: path.resolve(
309
319
  portoPaths.theme ?? context.portoRoot ?? "",
@@ -343,7 +353,37 @@ export function buildDocuConfig(rawUserConfig, projectDir, context = {}) {
343
353
 
344
354
  // ------- Plugins -------
345
355
 
356
+ stylesheets: [
357
+ {
358
+ href: "https://cdn.jsdelivr.net/npm/katex@0.17.0/dist/katex.min.css",
359
+ type: "text/css",
360
+ integrity:
361
+ "sha384-vlBdW0r3AcZO/HboRPznQNowvexd3fY8qHOWkBi5q7KGgqJ+F48+DceybYmrVbmB",
362
+ crossorigin: "anonymous",
363
+ },
364
+ ],
365
+
346
366
  plugins: [
367
+ function portosaurWebpackLoader(context, options) {
368
+ return {
369
+ name: "portosaur-webpack-loader",
370
+ configureWebpack(config, isServer, utils) {
371
+ return {
372
+ module: {
373
+ rules: [
374
+ {
375
+ test: /\.jsx?$/,
376
+ include: [
377
+ path.resolve(portoPaths.theme ?? context.portoRoot ?? ""),
378
+ ],
379
+ use: [utils.getJSLoader({ isServer })],
380
+ },
381
+ ],
382
+ },
383
+ };
384
+ },
385
+ };
386
+ },
347
387
  [
348
388
  "@docusaurus/plugin-pwa",
349
389
  {