From 7e6825b291f4ae636bebd3af6c92cdf1a52a8381 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:43:46 -0500 Subject: [PATCH] Finally anchor links on markdown headings - this is a bit of a rough solution because now any JSX included in a heading gets lost! --- package.json | 3 +- src/App.css | 14 +++++ src/components/Chapter.js | 1 - src/components/terms-links.tsx | 4 ++ src/content/equatives/other-equatives.mdx | 24 ++++++--- src/content/index.ts | 22 ++++++-- .../inflection/feminine-inflection.mdx | 2 +- .../inflection/inflection-patterns.mdx | 6 +-- src/content/nouns/nouns-gender.mdx | 2 +- src/content/nouns/nouns-plural.mdx | 4 +- src/content/nouns/nouns-unisex.mdx | 4 +- src/content/participles/intro.mdx | 2 +- .../phrase-structure/blocks-and-kids.mdx | 6 +-- src/content/phrase-structure/complement.mdx | 54 +++++++++++++++++++ src/content/verbs/past-verbs.mdx | 12 ++--- src/content/verbs/roots-and-stems.mdx | 2 +- src/content/verbs/verb-aspect.mdx | 8 +-- yarn.lock | 33 +++++++++--- 18 files changed, 160 insertions(+), 43 deletions(-) create mode 100644 src/content/phrase-structure/complement.mdx diff --git a/package.json b/package.json index ce34fb7..02e36f1 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "react-select": "^5.1.0", "react-smooth-collapse": "^2.1.0", "react-swipeable": "^6.2.0", + "unist-util-visit": "^4.1.0", "web-vitals": "^1.0.1" }, "scripts": { @@ -61,7 +62,7 @@ ] }, "devDependencies": { - "@lingdocs/mdx-loader": "^0.0.8", + "@lingdocs/mdx-loader": "^0.1.6", "@types/jest": "^27.0.2", "@types/node": "^16.10.3", "@types/react": "^17.0.27", diff --git a/src/App.css b/src/App.css index d81d964..c0ad9fb 100644 --- a/src/App.css +++ b/src/App.css @@ -18,6 +18,20 @@ overflow-y: auto; } +.heading-link { + text-decoration: none; + color: #21252A; +} +.heading-link:hover { + color: #21252A; +} +.heading-link:active { + color: #21252A; +} +.heading-link:visited { + color: #21252A; +} + @media (max-width: 900px) { .table-of-contents { display: none; diff --git a/src/components/Chapter.js b/src/components/Chapter.js index 94a5ef1..a2e6ba3 100644 --- a/src/components/Chapter.js +++ b/src/components/Chapter.js @@ -31,7 +31,6 @@ const Chapter = ({ children: chapter }) => { } -