BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
14.84k stars 1.86k forks source link

Footnote / source reference support in page editor #2637

Open Silence32 opened 3 years ago

Silence32 commented 3 years ago

A great feature would be to be able to make source references in text. The source references should then be listed collectively at the end of a page.

ssddanbrown commented 2 years ago

Merging in #2745. Possible overlap with #1914

ghost commented 2 years ago

What is the status of this as of today? I think something similar to the DokuWiki references plugin would make BookStack really solid for academic or academic-like content.

ssddanbrown commented 2 years ago

@vogelfreiheit No update or progress currently.

If using the markdown editor, then we generally try to stick to commonmark, and hence support common-mark style reference links in markdown content: https://spec.commonmark.org/0.30/#reference-link. We don't have any automated editor functionality to support this commonmark feature.

grugel-maintro commented 2 years ago

Is this still some how on the agenda?

ssddanbrown commented 1 year ago

For those wanting this for the WYSIWYG editor, I have published a within-WYSIWYG editor hack here: https://www.bookstackapp.com/hacks/wysiwyg-footnotes/ Considerations listed on that page.

nharris-lmg commented 11 months ago

Adding a +1 to this feature as we are coming at it from a scientifically angled use case and would love an easy OOBE for managing cited sources.

Zabien commented 8 months ago

As far as I understood, footnotes are part of Markdown, but not of CommonMark, so not supported here plus there is a hack for the WYSIWYG editor which has not yet been implemented into core and is also not on the roadmap for the near future? Could you please confirm this, @ssddanbrown? Either way, +1 for this feature from us.

ssddanbrown commented 8 months ago

@Zabien That's pretty much correct, apart from "footnotes are part of Markdown", since it really depends on the implementation/flavour of markdown (since markdown is not a standard, which is the point of commonmark).

Zabien commented 8 months ago

Agreed, thank you very much for your quick clarification! 🙏

OddSquirrel commented 3 months ago

For those wanting this for the WYSIWYG editor, I have published a within-WYSIWYG editor hack here: https://www.bookstackapp.com/hacks/wysiwyg-footnotes/ Considerations listed on that page.

Is this working for anybody? Granted, I'm not the sharpest tool in the shed, but I took the script, put it into a file ("footnote.js") without the <script> tags and placed the file inside my bookstack_app_data/www/ volume, where also the index.html is located.

Then, I added <script src="footnote.js"></script> to my custom head setting.

Result: No errors, but also no footnote button. 🙈

EDIT: It does work, when I put the script in the custom head setting as it is. Looks like the footnote.js just can't be found, and I'm too dumb to figure out the right folder. 😒

rosahaj commented 2 months ago

@OddSquirrel Try chaning<script src="footnote.js"></script> to <script src="/footnote.js"></script> (adding a / prefix to the src attribute). The script likely cannot be found because you're using a relative path.

OddSquirrel commented 2 months ago

@rosahaj Thanks for getting back to me! 😊 For now, it's been working just fine with the entire script right in the custom head settings. So far, it hasn't given me any problems other than making the settings a bit convoluted, but I'll definitely give it a spin with your advice when I have a bit more time on my hands. Thanks again! 👍