Skip to content

Commit

Permalink
Merge pull request #8 from String10/feature
Browse files Browse the repository at this point in the history
support auto-link github references
  • Loading branch information
String10 committed Feb 6, 2024
2 parents 9a8c271 + 44a70d9 commit e2d50b6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"rehype-external-links": "^3.0.0",
"rehype-katex-svelte": "^1.2.0",
"rehype-slug": "^6.0.0",
"remark-github": "^12.0.0",
"remark-math": "3.0.0",
"rollup-plugin-visualizer": "^5.12.0",
"svelte": "^3.59.2",
Expand Down
9 changes: 8 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeExternalLinks from 'rehype-external-links';
import addClasses from 'rehype-add-classes';
import remarkMath from 'remark-math';
import remarkGithub from 'remark-github';
import rehypeKatexSvelte from 'rehype-katex-svelte';

import dotenv from 'dotenv';
dotenv.config();

/** @type {import('@sveltejs/kit').Config} */
const config = {
extensions: ['.svelte', '.md'],
Expand All @@ -25,7 +29,10 @@ const config = {
highlight: {
alias: { vue: 'html' }
},
remarkPlugins: [remarkMath],
remarkPlugins: [
remarkMath,
[remarkGithub, { repository: `${process.env.GITHUB_USER}/${process.env.REPOSITORY}` }]
],
rehypePlugins: [
rehypeKatexSvelte,
rehypeSlug,
Expand Down
48 changes: 48 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==

"@types/mdast@^4.0.0":
version "4.0.3"
resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.3.tgz#1e011ff013566e919a4232d1701ad30d70cab333"
integrity sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==
dependencies:
"@types/unist" "*"

"@types/node@*":
version "20.11.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.5.tgz#be10c622ca7fcaa3cf226cf80166abc31389d86e"
Expand Down Expand Up @@ -953,6 +960,11 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

escape-string-regexp@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8"
integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==

eslint-config-prettier@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f"
Expand Down Expand Up @@ -1595,6 +1607,23 @@ make-error@^1.1.1:
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

mdast-util-find-and-replace@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz#a6fc7b62f0994e973490e45262e4bc07607b04e0"
integrity sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==
dependencies:
"@types/mdast" "^4.0.0"
escape-string-regexp "^5.0.0"
unist-util-is "^6.0.0"
unist-util-visit-parents "^6.0.0"

mdast-util-to-string@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz#7a5121475556a04e7eddeb67b264aae79d312814"
integrity sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==
dependencies:
"@types/mdast" "^4.0.0"

mdsvex@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/mdsvex/-/mdsvex-0.11.0.tgz#d6672406abbf341933d60c9bfebd39ffb893f851"
Expand Down Expand Up @@ -2010,6 +2039,18 @@ rehype-slug@^6.0.0:
hast-util-to-string "^3.0.0"
unist-util-visit "^5.0.0"

remark-github@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/remark-github/-/remark-github-12.0.0.tgz#c089609226425e2222eb5a853e174e46e3b6e1b8"
integrity sha512-ByefQKFN184LeiGRCabfl7zUJsdlMYWEhiLX1gpmQ11yFg6xSuOTW7LVCv0oc1x+YvUMJW23NU36sJX2RWGgvg==
dependencies:
"@types/mdast" "^4.0.0"
mdast-util-find-and-replace "^3.0.0"
mdast-util-to-string "^4.0.0"
to-vfile "^8.0.0"
unist-util-visit "^5.0.0"
vfile "^6.0.0"

remark-math@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-3.0.0.tgz#a1bb496e2d67805df30d8b55ff36f69cdef8e16e"
Expand Down Expand Up @@ -2288,6 +2329,13 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

to-vfile@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-8.0.0.tgz#4e1282bf251ce2beacae8e23a1752b3b3986bd29"
integrity sha512-IcmH1xB5576MJc9qcfEC/m/nQCFt3fzMHz45sSlgJyTWjRbKW1HAkJpuf3DgE57YzIlZcwcBZA5ENQbBo4aLkg==
dependencies:
vfile "^6.0.0"

trough@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876"
Expand Down

1 comment on commit e2d50b6

@vercel
Copy link

@vercel vercel bot commented on e2d50b6 Feb 6, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.