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

[FEATURE] Treat non-existent page links like regular text #184

Closed
non-descriptive opened this issue May 28, 2023 · 3 comments · Fixed by #186
Closed

[FEATURE] Treat non-existent page links like regular text #184

non-descriptive opened this issue May 28, 2023 · 3 comments · Fixed by #186
Assignees
Labels
type: feature Implements a new feature

Comments

@non-descriptive
Copy link

non-descriptive commented May 28, 2023

Some pages, especially in a smaller language sections of wikipedia and others, might have non-existent page references, which are only meant to be created. I think it's a good idea to ignore such links for now or maybe display proper error message like for external links.

Describe the solution you'd like
Absent page links on wikipedia goes like '/w/index.php?title=PAGE_NAME&action=edit&redlink=1. So we could use it to skip links of that form or show message "page PAGE NAME doesn't exist yet'. Maybe even suggest to open it in browser to write it, but this would require a separate task, since it will require some advanced stuff to do.

Since wiki-tui supports not just wikipedia, but other wikis as well this thing probably should be configure in settings some way like it currently does for language support.
For example fandom.com wikis edit link looks a bit different: /wiki/PAGE_NAME?veaction=edit&source=redlink

Steps to reproduce behaviour

  1. Change language to "Esperanto"
  2. Search "Usona Muzeo de Natura Historio"
  3. Select first result
  4. Navigate to the second link that goes by name "Upper West Side" and click it
@non-descriptive non-descriptive added the type: feature Implements a new feature label May 28, 2023
@Builditluc
Copy link
Owner

Builditluc commented May 29, 2023

Hey @non-descriptive!
Thank you for informing me about those yet-to-be-implemented pages in Wikipedia, didn't know those existed... I think your idea with the displayed message would be really good. We can even add configuration for those "special" links (meaning you can configure them to have a special color, etc.).

Wiki-tui currently kind of supports other wikis running MediaWiki (the program Wikipedia runs on) because they share the same API. In the parser, we don't differentiate between different wikis so the support for them is basic to non-existent (Because they could have different formatting). Until that is worked out I think it would be best to just stick to Wikipedia for now but I already have some ideas on how to support other sites better.

@Builditluc
Copy link
Owner

Hey, @non-descriptive!
I've finished implementing the feature and uploaded it onto the non-existent-pages branch. Whenever a page doesn't exist yet, the following message will be displayed:

Screenshot 2023-06-11 at 06 29 50

Can you check if the feature works on your end?

@Builditluc Builditluc self-assigned this Jun 11, 2023
@non-descriptive
Copy link
Author

Works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Implements a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants