Code Monkey home page Code Monkey logo

obsidian-wikipedia's Introduction

Obsidian Wikipedia

This is a plugin for Obsidian (https://obsidian.md).

This plugin gets the first section of Wikipedia and pastes it into your active note.

Usage

This plugin has two commands:

  • Get Wikipedia for Active Note, which gets the first section of Wikipedia using the active note's title as search term.
  • Get Wikipedia for Search Term, which gets the first section of Wikipedia for a search term.

Settings

Settings for this plugin include:

  • Language Prefix: The prefix before wikipedia.org used to access the language of Wikipedia you want. (Default: 'en')
  • Extract Template: The template to use to paste your extract. Available variables are {{text}}, {{searchTerm}}, and {{url}}
  • Bold Search Term?: If set to True, bolds the first instance of the search term in the extract
  • Use Paragraph Template?: If set to true, the paragraph template will be inserted for each paragraph of text for {{text}} in main template.
  • Paragraph Template: If Use Paragraph Template is set to true, this template will be inserted for each paragraph in the text extract. Available variable: {{paragraphText}}.

obsidian-wikipedia's People

Contributors

jmilldotdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

obsidian-wikipedia's Issues

Option to include the first image on the page

As we hover on the wiki links on wikipedia, we have a picture displayed in the pop-up as well. It is the image assigned on the right of it.
image

It would be great if we could grab that image as well (offline saved or just embedded link). It could also help in setting a context quickly and remembering certain facts (eg. Architecture or places)

Talk page integration?

Hi. I was wondering if it'd be possible to have an option for any relevant metadata from the Wiki article's talk page?

Love the plugin. Thanks for the great work! It's streamlined my workflow quite a bit.

Location of Insertion

When I use the search for term option, text gets inserted where my current cursor/key position is.
But when I prompt search for title, text gets inputted in between the properties. Are other plugins interfering or is this something which you can replicate?

Community plugin?

Hi, thanks for the plugin, very useful for me.
Will this be available from the community plugin pane? Currently I can't find it.

[FR] Keep links to other Wikipedia articles intact

hi, love the plugin!
it would be cool to be able to click through to related articles from the snippet provided by the plugin, if links were preserved. this feature would add a lot of utility to the plugin for me.
thanks for your time :)

Option to just insert Wikipedia link

My personal style is that instead of inserting blocks of text from Wikipedia, I like to just insert the link to the Wikipedia page. It would be lovely if this could be an option in your wonderful plugin.

Make searching for the Wikipedia title case-insensitive

E.g.: if I invoke the plugin from an Obsidian page named Synoptic Philosophy, the plugin says there is no Wikipedia page found. But if I change my Obsidian page to Synoptic philosophy the plugin successfully finds Synoptic philosophy - Wikipedia.

The default should be case-insensitive in my opinion, but there should at least be an option to allow for case-insensitivity.

LaTeX formatting issues

I think that this issue is closely related to issue #4, but pages that have latex in them are returned with the formulas almost unreadable. Specifically, formulas are returned twice, once in a string representation with a lot of (seemingly) random spaces, and then in proper latex format but wrapped in {displaystyle <formula> }, instead of $<formula>$.

ex (note that github removes all the gnarly extra spaces):

In functional analysis and operator theory, a bounded linear operator is a linear transformation L : X → Y {\displaystyle L:X\to Y} between topological vector spaces (TVSs) X {\displaystyle X} and Y {\displaystyle Y} that maps bounded subsets of X {\displaystyle X} to bounded subsets of Y . {\displaystyle Y.} If X {\displaystyle X} and Y {\displaystyle Y} are normed vector spaces (a special type of TVS), then L {\displaystyle L} is bounded if and only if there exists some M > 0 {\displaystyle M>0} such that for all x ∈ X , {\displaystyle x\in X,} The smallest such M {\displaystyle M} is called the operator norm of L {\displaystyle L} and denoted by ‖ L ‖ . {\displaystyle |L|.} A bounded operator between normed spaces is continuous and vice versa.The concept of a bounded linear operator has been extended from normed spaces to certain to all topological vector spaces.Outside of functional analysis, when a function f : X → Y {\displaystyle f:X\to Y} is called "bounded" then this usually means that its image f ( X ) {\displaystyle f(X)} is a bounded subset of its codomain. A linear map has this property if and only if it is identically 0. {\displaystyle 0.} Consequently, in functional analysis, when a linear operator is called "bounded" then it is never meant in this abstract sense (of having a bounded image).

instead of

In functional analysis and operator theory, a bounded linear operator is a linear transformation $L:X\to Y$ between topological vector spaces (TVSs) $X$ and $Y$ that maps bounded subsets of $X$ to bounded subsets of $Y.$ If $X$ and $Y$ are normed vector spaces (a special type of TVS), then $L$ is bounded if and only if there exists some $M&gt;0$ such that for all $x\in X,$ The smallest such $M$ is called the operator norm of $L$ and denoted by $|L|.$ A bounded operator between normed spaces is continuous and vice versa.

The concept of a bounded linear operator has been extended from normed spaces to certain to all topological vector spaces.

Outside of functional analysis, when a function $f:X\to Y$ is called "bounded" then this usually means that its image $f(X)$ is a bounded subset of its codomain. A linear map has this property if and only if it is identically $0.$ Consequently, in functional analysis, when a linear operator is called "bounded" then it is never meant in this abstract sense (of having a bounded image).

I have made a sincere effort to get to the bottom of this, and #4, and I've made some headway. This problem seems to arise from the explaintext flag in the PHP api request url. Interested parties can experiment for themselves, the explaintext flag is in the prop=extracts section: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=extracts&titles=Bounded_operator&redirects=1&converttitles=1&formatversion=latest&explaintext=1

One option would be to not use the explaintext flag and parse the HTML, but that would create a lot of additional parsing work for the plugin.

FR: Alternative language

This is one of my favourite plugins, thanks for making this!

I need to switch between english (en) and german (de) wiki. It would be extremely helpful if we could set up a second language prefix and have an additional command for the search with this language.

Even better - have an additional command which lets us enter the language prefix in the search modal.

Thanks!

Paragraph breaks are absent

When grabbing text from the Wikipedia article, paragraph breaks are entirely absent. From context they can usually be inferred because of a lack of a space between sentences.

eg:

In mathematics, a set is a collection of elements. The elements that make up a set can be any kind of mathematical objects: numbers, symbols, points in space, lines, other geometrical shapes, variables, or even other sets. The set with no element is the empty set; a set with a single element is a singleton. A set may have a finite number of elements or be an infinite set. Two sets are equal if they have precisely the same elements.Sets are ubiquitous in modern mathematics. Indeed, set theory, more specifically Zermelo–Fraenkel set theory, has been the standard way to provide rigorous foundations for all branches of mathematics since the first half of the 20th century.

vs

In mathematics, a set is a collection of elements. The elements that make up a set can be any kind of mathematical objects: numbers, symbols, points in space, lines, other geometrical shapes, variables, or even other sets. The set with no element is the empty set; a set with a single element is a singleton. A set may have a finite number of elements or be an infinite set. Two sets are equal if they have precisely the same elements.
Sets are ubiquitous in modern mathematics. Indeed, set theory, more specifically Zermelo–Fraenkel set theory, has been the standard way to provide rigorous foundations for all branches of mathematics since the first half of the 20th century.

Support multiple languages at the same time

Hello, thanks for this amazing plugin.

I usually take my notes in Spanish. I have a new note templater template that triggers the Wikipedia plugin if I choose to add the Wikipedia article. The thing is, it's pretty common that there's no Wikipedia article for my note in Spanish, but it is in English; so I have to manually change the language everytime this happens.

It would be really helpful if I could choose "es, en" in the language settings of the plugin for it to try the first language, and if it doesn't find anything, try the second one. This will be useful only for names of notes that share name in Spanish and English, so maybe a prompt asking for a new article name could be useful.

"Close enough" exception handling

Love this extension, though id love for it to have a "close enough" clause, where if a search term is close enough, the script returns the first instance. Or even simpler, it just always returns the first closest instance.

Insert Extracted Text Into a Single Callout

Thanks a lot for your plugin 👏

I'm wondering if there is some way to combine the extracted text:

{{text}}
> [Wikipedia]({{url}})

To a single callout:

> [!quote]
> {{paragraphText}}
>

Without getting the template multiple times inserted for each paragraph?

That's what I aim for (term: Regression Testing):

image

That's what I get with the current template:
image

If there is any way to achieve this currently, please let me know!

Grab entire page without links and footnotes

Hello!

I would love it if there was a toggle to grab the entire page. And another one to disable links and/or citation/footnotes

Right now my workflow is quite manual with pasting content and removing the links manually.
Would it also be possible to get the entire content without links? I just want the raw markdown from the page. So far this extension with obsidian is the closest I've gotten.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.