From 3136d0439f94b4b7d471e1572b93ea3202a83ebd Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sat, 11 Jul 2026 16:23:10 +0200 Subject: [PATCH 01/16] Move header and footer outside main; add section grouping Co-Authored-By: Brian Tremblay --- templates/index.jinja2 | 144 +++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 70 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 57e5a10..b3815b1 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -42,79 +42,83 @@ +

+ Microformats Parser (Python) + {{ mf2py_version }} +

+
-

- Microformats Parser (Python) - {{ mf2py_version }} -

- -
-
- - -
- -
- - -
- -
- -
- - -
- -

OR parse just a snippet of HTML

- -
-
- - -
- -
- - -
- -
- - -
- - -
- - +
+
+
+ + +
+ +
+ + +
+ +
+ +
+ + +
+
+ +
+

OR parse just a snippet of HTML

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ + From c6f16de27dd786c5563b503124f22bf6c25af488 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sat, 11 Jul 2026 19:19:57 +0200 Subject: [PATCH 02/16] Upgrade Bootstrap from 4.0.0-alpha.6 to 5.3.8 --- templates/index.jinja2 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index b3815b1..a961eda 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -6,7 +6,7 @@ Python Microformats Parser - + @@ -52,12 +21,12 @@
- - + +
- + -
@@ -81,17 +50,17 @@
- - + +
- - + +
- + -
- -
- - -
- -
- - -
- - -
-
- -
-

OR parse just a snippet of HTML

- -
-
- - -
- -
- - -
- -
- - -
- - -
-
- - - - +
+

+ Microformats Parser (Python) + {{ mf2py_version }} +

+ +
+ +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ +
+

OR parse just a snippet of HTML

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+ +
+ + +
From 96fce1b135d6c56fdbb4a3261343b0fc570d9a04 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sat, 11 Jul 2026 19:25:34 +0200 Subject: [PATCH 05/16] Refine the section headings and spacing --- templates/index.jinja2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 9e54ee0..25ba63d 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -19,7 +19,9 @@
-
+
+

Parse a URL

+
@@ -46,10 +48,10 @@
-
-

OR parse just a snippet of HTML

+
+

OR parse just a snippet of HTML

-
+
From 589a62123bcfa3a2951280519a812ac3083b6564 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sat, 11 Jul 2026 19:25:50 +0200 Subject: [PATCH 06/16] Describe the mf2util option with Bootstrap form-text instead of a title attribute --- templates/index.jinja2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 25ba63d..81b82d3 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -38,10 +38,11 @@
- -
From 15227c85323effacf5ba4d7430005cb9b5d6ef11 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sat, 11 Jul 2026 20:01:18 +0200 Subject: [PATCH 07/16] Update the README and add Martijn van der Ven as a contributor --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4d81456..9ee3d31 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ https://python.microformats.io ## Deployment -All commits to the `master` branch get auto-deployed to the live website (running on [Heroku](https://python.microformats.io)) +All commits to the `main` branch get auto-deployed to the live website (running on [Heroku](https://python.microformats.io)) ## Getting Started @@ -15,8 +15,8 @@ This website is built using Python Flask. To start working with this project, first clone the repository for this project: ``` -git clone https://github.com/indieweb/microformats-python-parser-website.git -cd microformats-python-parser-website +git clone https://github.com/microformats/microformats-parser-website-python.git +cd microformats-parser-website-python ``` Next, install the required dependencies: @@ -32,6 +32,8 @@ uv run -- app.py --debug (debug mode) uv run -- gunicorn --bind localhost:8080 app:app (production mode) ``` +In debug mode the port defaults to 8080; use `-p`/`--port` to change it. + You can view your running local application at this URL: ``` @@ -40,19 +42,20 @@ http://localhost:8080 ## Requirements -- Python 3.9 +- Python 3.14.5 +- [uv](https://docs.astral.sh/uv/) ## Contributions 1. Fork it -2. Get it running (see Installation above) +2. Get it running (see Getting Started above) 3. Create your feature branch (`git checkout -b my-new-feature`) 4. Commit your changes (`git commit -am 'Add some feature'`) 5. Push to the branch (`git push origin my-new-feature`) 6. Create new Pull Request If you find bugs, have feature requests or questions, please -[file an issue](https://github.com/indieweb/microformats-parser-website-python/issues). +[file an issue](https://github.com/microformats/microformats-parser-website-python/issues). ## License @@ -63,4 +66,5 @@ http://creativecommons.org/publicdomain/zero/1.0 ## Contributors - Kyle Mahan / [@kylewm](https://github.com/kylewm) (Author) -- [@capjamesg](https://github.com/capjamesg) (Contributor) \ No newline at end of file +- [@capjamesg](https://github.com/capjamesg) (Contributor) +- Martijn van der Ven / [@Zegnat](https://github.com/Zegnat) (Contributor) From 270740019b2e1e2377133a917bd9b81f381acff4 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:27:33 +0200 Subject: [PATCH 08/16] Load the microformats.io logo as the favicon --- templates/index.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 81b82d3..adeaf2e 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -7,7 +7,7 @@ Python Microformats Parser - + From 004bb12374ecc5aaf55a7a4328b4461919d8945b Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:27:51 +0200 Subject: [PATCH 09/16] Cap the parser select width on wider viewports --- templates/index.jinja2 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index adeaf2e..dff80a7 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -30,11 +30,13 @@
- +
+ +
@@ -65,11 +67,13 @@
- +
+ +
From ceafbc14c8e55dc514f9f171eeaf8398d282556d Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:28:04 +0200 Subject: [PATCH 10/16] Add Rust to the list of other Microformats parser websites --- templates/index.jinja2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index dff80a7..09c597e 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -92,8 +92,9 @@ Other Microformats Parser websites: Go, Node, - PHP, and - Ruby. + PHP, + Ruby, and + Rust. From f8d9019fbe9c9724411f2ccb0ddbd6dcdb834447 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:28:18 +0200 Subject: [PATCH 11/16] Add a link to the list of Microformats parsers on the wiki --- templates/index.jinja2 | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 09c597e..c555c80 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -96,6 +96,7 @@ Ruby, and Rust. +
  • More Microformats parsers
  • From e7b7631dcb6bc0faba7767c6e21edd0e2b377b3b Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:28:35 +0200 Subject: [PATCH 12/16] Randomise the order of the other parser websites on load --- templates/index.jinja2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index c555c80..8cbf4c2 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -88,7 +88,7 @@
  • Source code for this site
  • Source code for the Microformats mf2py Parser
  • -
  • +
  • Other Microformats Parser websites: Go, Node, @@ -99,6 +99,17 @@
  • More Microformats parsers
  • + + From 4abafd00dac9918ea4a640602c8bc34eafea98a0 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:28:48 +0200 Subject: [PATCH 13/16] Add a bookmarklet card to the parser page --- templates/index.jinja2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 8cbf4c2..dee09ea 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -80,6 +80,14 @@
    +
    +
    +

    Bookmarklet

    +

    Drag this link to your bookmarks toolbar to parse a page with one click!

    + mf2 parser +
    +
    +
    From 8beb3f4c3e248a5a4c91f8f0a76049703c4d2643 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:29:16 +0200 Subject: [PATCH 14/16] Show the site and library versions as badges in the footer --- app.py | 12 +++++++++++- templates/index.jinja2 | 15 +++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index 0f29ceb..8441029 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,8 @@ import json +import tomllib import traceback from collections import OrderedDict +from pathlib import Path import mf2py import mf2util @@ -11,6 +13,10 @@ mf2py.Parser.user_agent = "python.microformats.io (mf2py/" + mf2py.__version__ + ") Mozilla/5.0 Chrome/29.0.1547.57 Safari/537.36" mf2py.Parser.dict_class = OrderedDict +SITE_VERSION = tomllib.loads( + (Path(__file__).parent / "pyproject.toml").read_text(encoding="utf-8") +)["project"]["version"] + @app.route("/", methods=["GET", "POST"]) def index(): try: @@ -50,7 +56,11 @@ def fetch_mf2(url): response.headers["Content-Type"] = "application/json" return response - return render_template("index.jinja2", mf2py_version=mf2py.__version__) + return render_template( + "index.jinja2", + site_version=SITE_VERSION, + mf2py_version=mf2py.__version__, + ) except BaseException as e: traceback.print_exc() return jsonify(error="%s: %s" % (type(e).__name__, e)), 400 diff --git a/templates/index.jinja2 b/templates/index.jinja2 index dee09ea..fa84c71 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -12,10 +12,7 @@
    -

    - Microformats Parser (Python) - {{ mf2py_version }} -

    +

    Microformats Parser (Python)

    @@ -93,8 +90,14 @@
    From 3459343f8f0b951b4ceb2f6ba9efa898fa7766ba Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Sun, 19 Jul 2026 14:30:13 +0200 Subject: [PATCH 16/16] Add a CC0 copyright link to the footer --- templates/index.jinja2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 1a3c917..21d712d 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -108,6 +108,9 @@
  • More Microformats parsers
  • +

    + CC0 +