Giter Site home page Giter Site logo

better-fn's Introduction

BetterFn

Turning footnote into popover

BetterFnDemo

How to use

  • Hover on footnote to quick preview.
  • Click on footnote to show persistent popover.
  • Double click on footnote to jump to reference at the buttom.
    • Only work if Show reference is enabled in setting

Compatibility

The required API feature is only available for Obsidian v0.12.4+.

Installation

From GitHub

  1. Download the Latest Release from the Releases section of the GitHub Repository
  2. Put files to your vault's plugins folder: <vault>/.obsidian/plugins/better-fn
  3. Reload Obsidian
  4. If prompted about Safe Mode, you can disable safe mode and enable the plugin. Otherwise, head to Settings, third-party plugins, make sure safe mode is off and enable the plugin from there.

Note: The .obsidian folder may be hidden. On macOS, you should be able to press Command+Shift+Dot to show the folder in Finder.

From Obsidian

Not yet available

  1. Open Settings > Third-party plugin
  2. Make sure Safe mode is off
  3. Click Browse community plugins
  4. Search for this plugin
  5. Click Install
  6. Once installed, close the community plugins window and the patch is ready to use.

better-fn's People

Contributors

aidenlx avatar quorafind 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

better-fn's Issues

Change footnote appearance

The plugin is a total gamechanger for me, thank you so much. I'm using footnotes mostly for explanations, so I don't need to actually see the numbers in preview mode. Hence it would be very nice beeing able to modify the appearance of the footnote in preview mode. E.g. 💬 instead of [1].

[Feature Request] Option to disable persistent popover (it breaks 'Jump To Link' plugin)

Please reconsider activating the persistent popover feature using a single click, and instead make it an optional feature (so that it can be turned off and normal single-click link functioning can be restored).

There are a couple of reasons for requesting this:

  1. Interfering with a fundamental primary action (like single left-clicking) results in inconsistency, instead of all links behaving in a consistent and predictable manner. This is even more jarring on systems where everything is set to single-click to begin with (which is what I use in my operating system in order to avoid ever having to double-click).

  2. By intercepting and altering the normal single-click, better-fn breaks extensions like 'Jump To Link' (which uses keys to activate links instead of having to use the mouse). Jump to Link doesn't work for footnotes if better-fn is active because the standard link clicking action has been altered by better-fn.

I really like the in-place popover that better-fn provides, but I don't want or need single-click links to my footnotes being broken just to keep a popover persistently open (which I never use anyway).

Thanks.

Preview and text overlap each other

There should be a non-transparent background for the preview. I don't know why my preview is simply superimposed on the text. I am using obsidian on windows10, and obsidian has been updated to the latest version.
87ecb5444513e0a557867f71e4594f2

Unstable layout

Footnote reference, apparently, triggers layout shift on hover.

Screen.Recording.2023-07-16.at.13.34.35.mov

Obsidian: 1.3.7
Minimal theme: 7.0.7
Better Footnote: 1.0.1

I use a bunch of other plugins so potentially there might be interference but disabling just Better Footnote fixes the issue.

[Bug] Got extra space between block elements

Problem

Extra space between block elements, e.g. list.

Solution

After checking, I located the problem in the code below:

// File: src/modules/renderChild.ts
// Function: createPopover, line no: 87
html = contentEl.innerHTML;

I found that in innerHTML there are \n between two html tags, e.g. <li></li>\n<li></li>, which causes extra space.

When I change it to:

html = contentEl.innerHTML.replaceAll('>\n<', '><');

My problem solved : )

Footnote doesn't work in PDF

Activating the Plugin in Obsidian and exporting the PDFs breaks the link for footnote in PDF.

A fix would be great.

Feature: Respect dark mode

The plugin uses light mode when the app is in dark mode, with apparently the exception of code and code blocks.
Animation

Here's the markdown used:


the plugin1 looks2 off in dark mode

and here's some text after the footnotes

Footnotes

  1. here's some normal text and a link

  2. here's some code and code blocks

    apt update
    

Live Preview support

The plug-in worked up till Obsidian version 0.13.13 included. I just upgraded to 0.13.14 and it does not work anymore: I still get the little hand when I hover over the footnote, but I get no pop-up anymore.

I suspect due to Live Preview.

Do you plan to add support for LP?

Allow defining footer section heading header size

I want to use the footnote section heading, but I do not want it to be an H1, but rather an H2. Please allow us to customise its size.

In the meantime, I can use Linter plugin to make sure all headers start at H2, which converts this Footnotes heading, but this doesn't actually solve the problem because a new H1 Footnotes heading will be introduced each time a new footnote is created.

Plugin breaks exported footnote links

If a note is exported to PDF with this plugin active, the citations to the footnote don't work. Clicking them doesn't make you go to the footnote, it seems to do nothing at all.

Double click to jump to reference doesn't work

Even if Show reference is enabled double clicking doesn't jump to the bottom or do anything.

Animation

I'm on Windows, Obsidian 0.12.4, 1.0.0 of the plugin. The example is from the default Obsidian Help vault, with only this plugin enabled, but it didn't work anywhere else.

respect hide reference setting in PDF export

虽然设置了不显示references, 但在输出为pdf时,它仍然会显示序号。
用的是ob输出pdf功能。
烦请作者修正为不显示,或者提供一个选项可以开关。

Better Footnote Plugin stopped working

The Better Footnote Plugin stopped working for me after the latest Obsidian-Update (current version now v1.5.8 on a Mac 10.15.1). While in reading mode, the popover does not appear any more. It is the same for inline-footnotes and reference-footnotes. I cannot even click on the footnotes any more, while the Plugin is turned on.

It might have to do with the required API-Feature (see Compatibility in GitHub - aidenlx/better-fn: Footnote hover preview for Obsidian.md). Does anybody know?

Are there alternatives? What can I do? Does anyone else have that problem? This is one of the most essential plugins for me…

Jumping to footnote only works if `[^1]:` is followed by a space

| is cursor before and after jump position.

When auto-numbered hotkey pressed and [^1]: has trailing space:

Test[^1]|

[^1]: |

When auto-numbered hotkey pressed and [^1]: line ends at : (doesn't jump):

Test[^1]|

[^1]:

When auto-numbered hotkey pressed and [^1]: line ends at : followed by a blank new line:

Test[^1]|

[^1]:
|

(The above is also a problem if there are multiple [^#]:s as the cursor will jump to in front of e.g. |[^2]: instead of after [^1]:|.)

Expected: Hotkey should always jump to after [^1]: and add a space if there isn't one.

Thanks.

[Feature Request] better use in preview mode

currently the plugin works perfectly, but in preview mode it has no popup preview. I suggest a temporary solution: add an option to put the footnote right under the current paragraph instead of the whole passage. This might be easier to achieve (I think?) before the compatibility to preview mode.

[Feature Request] Dynamic or explicit floating frame sizing

I am attempting to use the footnotes to view external webpages with behavior similar to how the "Page preview" core plugin treats internal links. For the most part this works, with the exception that the floating frame size is too small to easily view the content. Would it be possible to have dynamic resizing based on the content, or possibly to have an explicit parameter that could be set per footnote?

Code and screenshot included below.

# Jitter
Jitter[^test] is defined as:

[^test]:
	<iframe
	border=0
	frameborder=0
	height=1000
	width=1500
	src="https://en.wikipedia.org/wiki/Jitter?p">
	</iframe>

image

[Bug] Doesn't work on mobile when footnotes placed in the middle of the document

When the footnotes are interspersed throughout the document, rather than at the end of the document, the hover preview doesn't work on mobile. It still works as expected on desktop, however.

If I place the footnotes at the end of the document, it works as expected on mobile.

This behavior is inconsistent with Markdown specifications. Markdown allows the footnotes to be placed anywhere in the document, not only at the end.

[BUG] Switching to preview mode drags view to top of note

I found out why. Apparently, your footnotes trigger this bug with ul ul { position: relative; } that's been seen time and time again.

A fix I've found, if anyone needs one:

ul ul, ol ol{
 padding-left: 54px;
 margin-left: -15px;
 border-left: 2px solid var(--interactive-accent);
}

Remove the problematic line I've cited and switch values according to your theme.

Doesn't work inside html elements (p, span, div...)

Edit: Sorry, just realised there's this philosophy of not intermixing markdown and html in Obsidian (forum.obsidian)... or maybe it's a difficult thing to achieve... Anyway, I can't find the way to delete this now seemingly purposeless message...

Original: I recently started to play with css, which seems to only allow formatting of an individual section of the note if this section is put into html targets such as <p>, <span> or <div> for instance... Unfortunately, footnotes can't seem to display when placed inside one of those : reading view will show a flattened [number inside brackets] without link or accent color, with nothing poping up on hover...

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.