Support » Plugin: footnotes » Transforming older source list to footnotes plugin

  • Resolved erling007


    Hey 🙂

    Hope you all are doing well. I’m working on a project where all the posts are having the reference in the bottom on the page like:
    (1) Some reference about veganism.
    (2) Some other reference
    (3) Some more reference

    In the article just the standard “The amount of people eating vegan is increasing (1)”. Here there is no dynamic link. What would be the best option to transform this to use this footnotes plugin? Any help is highly appreaciated, this will take quite some time if not, and I am sure more people doing it the old way are searching for a good method too.

    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor pewgeuges


    Hello @erling007,

    Many thanks for the topic, very good question indeed. In the system used by most footnotes plugins for WordPress, the reference text is enclosed by start and end delimiters and inserted where the referrer (and tooltip) will be generated.

    Sadly I’m not aware of any program converting all posts from manual footnotes to automation-ready footnotes, but I see that the concept is very promising, like the Word➔WordPress conversion with plugin-compatible footnotes (not preformatted, hard-coded footnotes).

    Regarding the subject matter that you pulled the example text from: I’m a vegan too, and I know that if I were not, I would have failed to help fix the tremendous number of bugs affecting this plugin and its users until October–December 2020. I didn’t use PHP before that year.

    I just need to go shop some vegan / whole / organic food, I’ll think about the footnotes conversion on the road (bicycle), and when back I’ll try to deep-delve into how to achieve this, perhaps using yet another new language; but if it’s to be done server-side we’re likely to stick with PHP (or JavaScript if it should be done in the browser); not much of an idea how, though.

    Would you be fine with doing the conversion one post at a time, and edit each post for the purpose?

    Best regards.

    • This reply was modified 2 months, 3 weeks ago by pewgeuges.
    Thread Starter erling007


    So fun that you’re a vegan too @pewgeuges 🙂

    I’d be glad to try to figure out how to solve this. My skills in php is very basic, and I mostly use python my self. I’ve been thinking of ways to do this, like scraping, search and replace, and now I’m trying to create a simple program to search after a pattern. I don’t know any ways to do the whole job yet, but at least with some automation then it makes it easier.

    I’m looking forward to read what you can come up with. The ultimate solution would be that the “The amount of people eating vegan is increasing (1)” in the article would be understood as a point of reference to the source in the bottom of the text “(1)”

    Wishing to a good shopping 🙂

    Plugin Contributor pewgeuges



    Many thanks for your feedback and documentation. Based on your spec, where the part after the last (1), the URL for instance, should replace (all instances of) the referrer (1) and be preceded by [ref] and followed by [/ref], or whatever delimiters are configured, I’ve set up a test case using PHP. It does something but not what it’s expected to do, and I can’t seem to get it bug-free. Consistently, I was already unable to write an appropriate Word ➔ WordPress converter when a such was requested. These features are unlikely to run properly below 1.000 lines of code; for reference, the Mammoth Docx Converter core is 28.000 lines of JavaScript.

    Another problem is integration. A standalone app as you are writing in Python will be more flexible and won’t depend on bottlenecks outside our control.

    I’m sorry that at this point I can only wish you the best of luck, and thank you again for everything!

    Thread Starter erling007


    Thank you very much @pewgeuges for trying. I have some luck with creating the code myself, but it is not as easy as I first thought. Your communication here has been splendid and I hope I communicate my gratefulness.

    Wish you a great vegan day onwards!

    Plugin Contributor pewgeuges


    Hi @erling007,

    I’m happy that you succeeded and solved the problem.

    Many thanks for your posting, and all the best moving forward!

    • This reply was modified 2 months, 2 weeks ago by pewgeuges.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.