WP: Footnote renumbering for WordPress.com posts

Preamble

Idea for a PERL script to automatically renumber footnote references that take the form:

This is because a tuple is required8:

or in HTML:

<sup><a href="https://stackoverflow.com/a/66372700/4424636">8</a></sup>

These footnote references have to be entered by hand. If a new footnote reference is added (inserted) before a series of other footnotes then the successive footnote references require renumbering. Renumbering by hand is a major chore.

The script was actually written in Python, using BeautifulSoup.

Code available on Gitlab:

Continue reading WP: Footnote renumbering for WordPress.com posts

Reading WordPress pages in Perl

Preamble

I wanted to add some functionality to the WordPress to table of contents Perl script to grab the HTML code of the WordPress page, rather than require the user to manually copy the HTML from the Text tab of the WordPress editor.

However, whilst researching how to add this functionality, I found that a simple get(), using LWP::Simple, doesn’t work when trying to retrieve WordPress pages, and empty string is returned:

Use of uninitialized value $page in print at ./GetPage.pl line 13.

Continue reading Reading WordPress pages in Perl

Create an external “links” section for WordPress.com posts

Preamble

Following on from my partial success (issues due to the automatic HTML formatting of WordPress are causing the lack of total success) of the table of contents (ToC) creator, see Create table of contents for WordPress.com posts. I then thought that it would be useful to have a script that pulls out all of the (external) links referenced and places them under the heading of “Links”…

Continue reading Create an external “links” section for WordPress.com posts

Perl in Eclipse

Preamble

After my success in getting Eclipse up and running with Arduino and Java, see Eclipse for Arduino and Java grapher for Arduino serial monitor, I thought I’d try it with Perl, whilst developing my table of contents for WordPress script, see Create table of contents for WordPress.com posts.

There is a plug in for Perl called Epic, which I have been using for about a week. However it is a bit weak in some areas…

Continue reading Perl in Eclipse

Create table of contents for WordPress.com posts

Preamble

Whilst writing particularly long posts I realised that a table of contents (ToC) would be most useful, based on the headings in the post.

It wouldn’t be that hard to do, in Perl.

Code on GitLab.

Continue reading Create table of contents for WordPress.com posts