Read your wiki from in-game! #3406
InspectorCaracal
started this conversation in
Community Contribs & Snippets
Replies: 2 comments
-
This is fantastic and very useful, great work! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ah, I totally forgot that I don't need the Q's any more if I'm not combining the queries into one filter, my bad. 😆 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
BEHOLD! In-game Wiki Access
This is an in-game command for reading wiki articles from an integrated django-wiki app! For a typical Evennia game, you can just drop this code directly into your gamedir and add it to your default cmdset. (After you've installed the wiki, of course!)
Adding django-wiki to your Evennia game:
https://www.evennia.com/docs/latest/Howtos/Web-Add-a-wiki.html
Article searching: YES
This works by taking the command args and running queries on the wiki's
Article
manager to check for the args by title, then by content. It doesn't currently take into account the caller's read permissions, but that should be reasonably easy to add in toCmdWiki.search_article
if you don't want players able to read all of the articles. django-wiki has a whole article-permissions system you can ask, and since the accounts are linked, you can useself.account
in the command to check that access. Or make your own checks!Markdown formatting: MOSTLY NO
django-wiki uses markdown for its article formatting, so the article text will display in-game with the markdown syntax. (Fortunately, one of the best features of markdown is that it's much more human-readable than many other markup languages.) And while this
wiki
evennia command doesn't format normal markdown markup, it will catch links!Clickable links: YES!
Markdown and wiki links are both ugly to read normally, plus they're meant to be clicked. You want to be able to click them! Not to mention, they should do different things, because what's the point of being able to read a wiki in-game if you can't click to read other wiki articles in-game, am I right?
For internal wiki links, it replaces them with Evennia's clickable-command syntax:
[[Getting Started]]
will become|lcwiki Getting Started|ltGetting Started|le
For normal markdown links, it replaces them with Evennia's clickable-url syntax:
[click me!](https://example.com)
will become|luhttps://example.com|ltclick me!|le
Beta Was this translation helpful? Give feedback.
All reactions