Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wikilink handler interface #104

Closed
wants to merge 4 commits into from
Closed

Wikilink handler interface #104

wants to merge 4 commits into from

Conversation

kmaasrud
Copy link
Member

@kmaasrud kmaasrud commented Aug 30, 2022

Motivation

This PR has a rewrite of how wikilinks are handled, which allows users of the API to add their own handlers to get custom functionality.

Evidences

None yet

To do

  • Main proof-of-concept interface
  • Wikilink preprocessors and renderers
  • New tests for wikilink parsing
  • Revamp CommonMarkHandler to be more easily pluggable
  • Write docs

This is a huge commit that also changes a bit of the code structure.
Arcs are now a part of the `vault` module, and wikilinks get a module
for themselves. The commit has a rewrite of how wikilinks are handled,
which allows users of the API to add their own handlers to get custom
functionality.

For now, the wikilink to CommonMark link conversion is crudely
implemented as a wikilink handler. It is used as a default in
VaultBuilder.
@kmaasrud kmaasrud added the enhancement New feature or request label Aug 30, 2022
@kmaasrud kmaasrud added this to the 1.0.0 milestone Aug 30, 2022
@kmaasrud kmaasrud self-assigned this Aug 30, 2022
@kmaasrud kmaasrud linked an issue Aug 30, 2022 that may be closed by this pull request
src/lib.rs Outdated Show resolved Hide resolved
src/wikilink/context.rs Outdated Show resolved Hide resolved
@MatteoJoliveau
Copy link
Contributor

MatteoJoliveau commented Aug 30, 2022

I think there might be something weird happening with aliases, as now the links come out as <a href="README.html">alias(9, 18)</a> instead of the proper title. Is there something we must do after wikihandlers have run to get the proper text out?

@kmaasrud
Copy link
Member Author

I think there might be something weird happening with aliases, as now the links come out as <a href="README.html">alias(9, 18)</a> instead of the proper title. Is there something we must down after wikihandlers have run to get the proper text out?

Ah fuck... Pest has a weird API to get their rules out as strings 😅 Fixed now

@MatteoJoliveau
Copy link
Contributor

It works! 🚀

@kmaasrud kmaasrud closed this Apr 18, 2023
@kmaasrud kmaasrud deleted the issue-77 branch April 18, 2023 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wikilink handlers
2 participants