Skip to content

Commit

Permalink
Integrate wiki-link plugin (#51)
Browse files Browse the repository at this point in the history
* added `remark-wiki-link` dependencies

* created plugin to wrap plugin-content-docs

* configure docusaurus to use our wrapper plugin

* wikilink styling

* check in another sample page to demo wikilinks

* page for wikilinks to default to

* simplified wikilink css

Co-authored-by: Daniel Swann <[email protected]>

* various fixes and cleanup

Co-authored-by: Daniel Swann <[email protected]>

---------

Co-authored-by: Daniel Swann <[email protected]>
  • Loading branch information
tukib and danswann authored Dec 4, 2023
1 parent f1ea364 commit 147c254
Show file tree
Hide file tree
Showing 7 changed files with 284 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/create_a_page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Create a Page
unlisted: true
---

Create a page [here](https://github.com/comcode-org/hackmud_wiki).
40 changes: 40 additions & 0 deletions docs/wikilink_demo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Wiki-Link Demo

alias:
- wikilink_example
- wikilink_test

# can also use:
# alias: [wikilink_example, wikilink_test]

# as well as singular alias:
# alias: wikilink_example

unlisted: true
---

This is another page. Check out [[Home]] or [[xena.puppies]].

Example links:

- [[Wiki-Link Demo]]
- [[WiKiLiNK demo]]
- [[/wikilink_demo]]

Aliases:

- [[wikilink_example]]
- [[wikilink_test]]

## Section 1

Ut et eros et justo consectetur semper dictum nec orci. Donec tempor mi orci. In hac habitasse platea dictumst. Phasellus eu elementum mauris. Donec mollis lacus ut dolor rutrum, at ultrices enim cursus. Proin ac velit urna. Vestibulum sollicitudin metus est. Fusce in libero sed lorem tincidunt tempus. Cras consequat urna eu semper interdum. Morbi ornare consectetur tortor, ut sodales est tincidunt id. Donec ipsum enim, aliquam vitae pharetra sagittis, maximus sit amet ipsum. Phasellus a lorem feugiat, iaculis risus vel, mollis lacus. Etiam rutrum cursus ante, at semper mauris tristique ac. Morbi consequat lacus sapien, volutpat dapibus tortor vehicula eu. Suspendisse vulputate, nisi eu scelerisque dapibus, lacus massa faucibus justo, facilisis faucibus ipsum est sodales risus.

## Section 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor ornare orci, vel gravida velit venenatis eget. Sed auctor, sem vitae consectetur egestas, tellus purus gravida nisl, et porta ipsum urna eu mauris. Morbi ultricies libero in iaculis eleifend. Nulla facilisi. Vivamus mattis tempus nisi, nec ultrices mauris tristique in. Nunc pulvinar aliquam lectus nec gravida. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In pellentesque massa et arcu auctor, porttitor ultrices dolor sagittis. Nulla pellentesque volutpat risus id congue.

### Section 2.1

Nullam placerat elit nec turpis imperdiet molestie non ut lacus. Pellentesque a molestie nibh. Fusce viverra egestas felis, et porttitor magna efficitur et. Aenean gravida quam et commodo dignissim. Duis nec nibh dolor. Cras vestibulum in odio vitae posuere. Donec convallis maximus consequat. Nam et mattis purus. Curabitur iaculis quam ligula, at facilisis elit egestas sit amet. Nam a ullamcorper nisi, quis luctus leo. Ut eleifend dui odio, ut maximus elit lobortis id. Phasellus bibendum, purus in bibendum tincidunt, ligula neque vulputate nulla, at sollicitudin lacus lorem vel risus. Nam consectetur scelerisque orci eget convallis. In nec ornare dui. Pellentesque eu felis imperdiet, euismod leo et, euismod ex. Nullam nec dignissim sapien, eu tempor erat.
3 changes: 2 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check
import pluginContentDocsWrapper from "./src/plugins/pluginContentDocsWrapper";

const GITHUB_ORG = "comcode-org";
const GITHUB_PROJECT = "hackmud_wiki";
Expand Down Expand Up @@ -29,7 +30,7 @@ const config = {
// Installed plugins
plugins: [
[
"@docusaurus/plugin-content-docs",
pluginContentDocsWrapper, // wraps @docusaurus/plugin-content-docs
// See: https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#configuration
{
// Path of the docs plugin relative to the root. Since it's the only
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"@docusaurus/plugin-content-docs": "^3.0.1",
"@docusaurus/theme-classic": "^3.0.1",
"@mdx-js/react": "^3.0.0",
"react": "^18.2.0"
"react": "^18.2.0",
"remark-wiki-link": "^2.0.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.1",
Expand Down
94 changes: 94 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* WIKILINK CLASSES
*/
/*.wikilink {}*/
a.wikilink-new {
color: var(--ifm-color-danger);
}
Loading

0 comments on commit 147c254

Please sign in to comment.