obsidian-community / obsidian-community-lib Goto Github PK
View Code? Open in Web Editor NEWAn npm package of commonly used Obsidian plugin utilities.
Home Page: https://obsidian-community.github.io/obsidian-community-lib/
License: ISC License
An npm package of commonly used Obsidian plugin utilities.
Home Page: https://obsidian-community.github.io/obsidian-community-lib/
License: ISC License
Hello,
I've written some code to render Markdown to HTML. The goal was to be able to copy a document to clipboard so it can be pasted for instance to gmail.
Another developer approached me to expose the rendering as an API. I'm not very enthusiastic about other plugins depending directly on my plugin, so I was thinking of extracting the functionality into a separate library. I've seen frequent questions about overcoming Obsidian's MarkdownRenderer shortcomings on Discord, and I've seen this implemented in several plugins, so it would probably have some utility to other plugin developers.
I thought that this library would be a good place to include it. I can of course also publish it as a separate library. What do you think ?
If one compiles their Plugin with this Library, using the esbuild (or old rollup config) from the sample Plugin, all provided methods are included, even the ones that aren't used.
I am not sure if this is an Issue of this Library or the sample Plugin configuration, and while the Library is pretty small it's also not that big of a deal, but it might become one in the Future.
Title says it all. This is the specific line:
https://github.com/obsidian-community/obsidian-community-lib/blob/main/src/utils.ts#L500
@phibr0, when using one of the functions from the lib, I get this error:
The App
I extended in the community-lib
doesn't extend 'obsidians' App
when using a 3rd party lib.
I'm not sure what the solution is. Maybe we can just remove the interface? Or maybe keep it in the lib for type-checking purposes, but don't export it? But I was reading, and declare module ...
is automatically exported, I don't think we have a choice
openOrSwitch tries to access the path of the active file, which is undefined when there is no active file.
Hey there!
A while back, I made a couple of Obsidian libraries for my plugin: obsidian-undocumented
, which contains unofficial type definitions for Obsidian's internal API; and obsidian-extra
, which provides a bunch of functions using those unofficial definitions.
Would there be any interest in merging obsidian-extra
into this project? The projects seem to have a similar goal but are structured slightly differently. Where this project has a single file for all the functions, obsidian-extra
has one file per function/feature and tries to separate its exports into safe and unsafe variants.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.