From 9e4c896c6aa9298de2108cc78f8af5d6cddec5ca Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 3 Mar 2026 17:44:04 +0000 Subject: [PATCH 1/2] Add automated FLoRA citation update from FReD-data - Extend update_fred_citation.py to replace {{flora-ref}} placeholder in content/replication-hub/flora/_index.md with the HTML-formatted citation - Add content/replication-hub/flora/_index.md (source file with placeholder) - Update data-processing workflow to stage and commit the resolved _index.md to the build-resources branch alongside fred_citation.txt The citation update already ran weekly on Sundays; the new _index.md replacement runs on the same schedule with no additional triggers needed. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/data-processing.yml | 12 ++++- content/replication-hub/flora/_index.md | 24 ++++++++++ scripts/update_fred_citation.py | 58 +++++++++++++++++++++++-- 3 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 content/replication-hub/flora/_index.md diff --git a/.github/workflows/data-processing.yml b/.github/workflows/data-processing.yml index 131c2b2c80..3f45e7fdbe 100644 --- a/.github/workflows/data-processing.yml +++ b/.github/workflows/data-processing.yml @@ -474,6 +474,12 @@ jobs: mkdir -p /tmp/generated-resources/static/data cp static/data/fred_citation.txt /tmp/generated-resources/static/data/fred_citation.txt fi + + # Copy updated FLoRA index if it exists + if [ -f content/replication-hub/flora/_index.md ]; then + mkdir -p /tmp/generated-resources/flora + cp content/replication-hub/flora/_index.md /tmp/generated-resources/flora/_index.md + fi # Copy additional generated files mkdir -p /tmp/generated-resources/contributor-analysis @@ -506,7 +512,7 @@ jobs: pushd "$WORKTREE_DIR" # Ensure target directories exist - mkdir -p content/curated_resources content/contributors data content/contributor-analysis content/publications static/data + mkdir -p content/curated_resources content/contributors data content/contributor-analysis content/publications static/data content/replication-hub/flora # Remove old generated resource files (but keep _index.md) find content/curated_resources -type f ! -name '_index.md' -delete 2>/dev/null || true @@ -525,6 +531,9 @@ jobs: if [ -f /tmp/generated-resources/static/data/fred_citation.txt ]; then cp /tmp/generated-resources/static/data/fred_citation.txt static/data/fred_citation.txt fi + if [ -f /tmp/generated-resources/flora/_index.md ]; then + cp /tmp/generated-resources/flora/_index.md content/replication-hub/flora/_index.md + fi if [ -f /tmp/generated-resources/summaries.json ]; then cp /tmp/generated-resources/summaries.json data/summaries.json fi @@ -559,6 +568,7 @@ jobs: git add scripts/forrt_contribs/contributors_cache.csv 2>/dev/null || true git add data/ga_data.json 2>/dev/null || true git add static/data/fred_citation.txt 2>/dev/null || true + git add content/replication-hub/flora/_index.md 2>/dev/null || true git add data/summaries.json 2>/dev/null || true git add content/contributor-analysis/ 2>/dev/null || true git add content/publications/citation_chart.webp 2>/dev/null || true diff --git a/content/replication-hub/flora/_index.md b/content/replication-hub/flora/_index.md new file mode 100644 index 0000000000..dd266dd4b9 --- /dev/null +++ b/content/replication-hub/flora/_index.md @@ -0,0 +1,24 @@ +--- +title: "FORRT Library of Reproduction and Replication Attempts" +url: "/replication-hub/flora/" +date: 2026-02-26 +--- + +The aim of the FORRT Library of Reproduction and Replication Attempts (FLoRA) is to track all attempts to repeatedly test published findings across the sciences and humanities. In contrast to the FORRT Replication Database (FReD), FLoRA does not contain statistical data. This allows FLoRA to include references from any field of research, and to be maintained with limited resources. + +# Structure of FLoRA + +1. Link repetition (replication/reproduction) references to original references + +2. Provide a standardized outcome (e.g., success, failure) based on the repetition report + +With this simple structure FLoRA allows for tracking of replication rates across time, disciplines, academic journals, and more. FLoRA is used for a wide range of existing projects, such as the [FLoRA Annotator](https://forrt.org/apps/fred_annotator.html), a tool that lists replication and reproduction attempts for the reference that you provide it with. + +In FLoRA, years of work from a large community of volunteers culminate. If you would like to contribute to the project or use the data for your own research, we would strongly appreciate you reaching out to us. + +::: {.callout-note icon="false"} +## How to cite: + +{{flora-ref}} + +::: diff --git a/scripts/update_fred_citation.py b/scripts/update_fred_citation.py index b98a431b3c..3c4e397609 100644 --- a/scripts/update_fred_citation.py +++ b/scripts/update_fred_citation.py @@ -24,6 +24,8 @@ # Constants CITATION_URL = "https://raw.githubusercontent.com/forrtproject/FReD-data/refs/heads/main/output/citation.txt" OUTPUT_FILE = "static/data/fred_citation.txt" +FLORA_INDEX_FILE = "content/replication-hub/flora/_index.md" +FLORA_PLACEHOLDER = "{{flora-ref}}" def fetch_fred_citation(): """ @@ -90,21 +92,69 @@ def repl(match): logger.error(f"Failed to save citation: {e}") return False +def update_flora_index(citation_html): + """ + Replace the {{flora-ref}} placeholder in the FLoRA _index.md with the citation HTML. + + Args: + citation_html: The processed citation HTML string (same as saved to fred_citation.txt) + + Returns: + bool: True if successful or placeholder not present, False on error + """ + try: + index_file = Path(FLORA_INDEX_FILE) + if not index_file.exists(): + logger.warning(f"FLoRA index file not found: {FLORA_INDEX_FILE}") + return False + + content = index_file.read_text(encoding='utf-8') + if FLORA_PLACEHOLDER not in content: + logger.info("No {{flora-ref}} placeholder found in FLoRA index, skipping") + return True + + updated = content.replace(FLORA_PLACEHOLDER, citation_html.strip()) + index_file.write_text(updated, encoding='utf-8') + logger.info(f"Successfully updated {FLORA_INDEX_FILE}") + return True + except Exception as e: + logger.error(f"Failed to update FLoRA index: {e}") + return False + + def main(): """Main function to fetch and save the FReD citation.""" logger.info("Starting FReD citation update") - + # Fetch citation citation = fetch_fred_citation() if not citation: logger.error("Failed to fetch citation, exiting") return 1 - - # Save citation + + # Save citation to static data file if not save_citation(citation, OUTPUT_FILE): logger.error("Failed to save citation, exiting") return 1 - + + # Build the HTML-formatted citation string (same logic as save_citation) + import re + citation_stripped = citation.strip() + note = "* These authors contributed equally to this work." + citation_main = citation_stripped + if note in citation_stripped: + citation_main = citation_stripped.split(note)[0].strip() + doi_pattern = r'(https://doi\.org/[\w\./-]+)' + def repl(match): + url = match.group(1) + return f'{url}' + citation_html = re.sub(doi_pattern, repl, citation_main) + "\n\n" + note + + # Replace placeholder in FLoRA _index.md + if not update_flora_index(citation_html): + logger.error("Failed to update FLoRA index, exiting") + return 1 + logger.info("FReD citation update completed successfully") return 0 From 209eee992ca04f88102e097c367a97760bd53f6d Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Tue, 3 Mar 2026 17:45:38 +0000 Subject: [PATCH 2/2] Add /flora/ short URL alias for FLoRA page Co-Authored-By: Claude Sonnet 4.6 --- content/replication-hub/flora/_index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/replication-hub/flora/_index.md b/content/replication-hub/flora/_index.md index dd266dd4b9..aa339e5d1f 100644 --- a/content/replication-hub/flora/_index.md +++ b/content/replication-hub/flora/_index.md @@ -2,6 +2,8 @@ title: "FORRT Library of Reproduction and Replication Attempts" url: "/replication-hub/flora/" date: 2026-02-26 +aliases: + - /flora/ --- The aim of the FORRT Library of Reproduction and Replication Attempts (FLoRA) is to track all attempts to repeatedly test published findings across the sciences and humanities. In contrast to the FORRT Replication Database (FReD), FLoRA does not contain statistical data. This allows FLoRA to include references from any field of research, and to be maintained with limited resources.