prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  DOC: Website <->README sync
  Following @hoechenberger's PRs I think our README.md (which ends up on PyPI) looks nicer / does better advertising than our docs landing page does
  
  | https://pypi.org/project/mne-bids-pipeline/#description | https://mne.tools/mne-bids-pipeline/1.0/index.html |
  | -- | -- |
  | ![Screenshot from 2022-12-08 13-01-47](https://user-images.githubusercontent.com/2365790/206529981-f1808ad5-49bf-4236-b904-ff72f9e12e70.png) | ![Screenshot from 2022-12-08 13-01-53](https://user-images.githubusercontent.com/2365790/206530007-2bbf52c3-229a-47bf-b2c9-b23812fdc977.png) |
  
  I propose that we should add the tag line and bullet points from the README.md to the landing page for mne-bids-pipeline, and also double check that our project description matches. This would also make it a bit more like MNE-Python, where our landing page tries to quickly convey "This package can do a lot of cool stuff that you want!".
  
  I propose that we should modify `build_docs.sh` to have a `gen_index.py` that takes the bullet points of README.md and pastes them into the `index.md` for the website.
  
  @hoechenberger @drammock WDYT?
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docs/hooks.py`
  Content:
  ```
  1 import logging
  2 from typing import Dict, Any
  3 
  4 from mkdocs.config.defaults import MkDocsConfig
  5 
  6 logger = logging.getLogger("mkdocs")
  7 
  8 config_updated = False
  9 
  10 
  11 # Ideally there would be a better hook, but it's unclear if context can
  12 # be obtained any earlier
  13 def on_template_context(
  14     context: Dict[str, Any],
  15     template_name: str,
  16     config: MkDocsConfig,
  17 ) -> None:
  18     """Update the copyright in the footer."""
  19     global config_updated
  20     if not config_updated:
  21         config_updated = True
  22         now = context["build_date_utc"].strftime("%Y/%m/%d")
  23         config.copyright = f"{config.copyright}, last updated {now}"
  24         logger.info(f"Updated copyright to {config.copyright}")
  25
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/docs/hooks.py b/docs/hooks.py
  --- a/docs/hooks.py
  +++ b/docs/hooks.py
  @@ -2,6 +2,8 @@
   from typing import Dict, Any
   
   from mkdocs.config.defaults import MkDocsConfig
  +from mkdocs.structure.pages import Page
  +from mkdocs.structure.files import Files
   
   logger = logging.getLogger("mkdocs")
   
  @@ -22,3 +24,29 @@
           now = context["build_date_utc"].strftime("%Y/%m/%d")
           config.copyright = f"{config.copyright}, last updated {now}"
           logger.info(f"Updated copyright to {config.copyright}")
  +
  +
  +_EMOJI_MAP = {
  +    "🏆": ":trophy:",
  +    "🛠️": ":tools:",
  +    "📘": ":blue_book:",
  +    "🧑‍🤝‍🧑": ":people_holding_hands_tone1:",
  +    "💻": ":computer:",
  +    "🆘": ":sos:",
  +    "👣": ":footprints:",
  +    "⏩": ":fast_forward:",
  +    "⏏️": ":eject:",
  +    "☁️": ":cloud:",
  +}
  +
  +
  +def on_page_markdown(
  +    markdown: str,
  +    page: Page,
  +    config: MkDocsConfig,
  +    files: Files,
  +) -> str:
  +    if page.file.name == "index" and page.title == "Home":
  +        for rd, md in _EMOJI_MAP.items():
  +            markdown = markdown.replace(rd, md)
  +    return markdown
  
verification_info: {"golden_diff": "diff --git a/docs/hooks.py b/docs/hooks.py\n--- a/docs/hooks.py\n+++ b/docs/hooks.py\n@@ -2,6 +2,8 @@\n from typing import Dict, Any\n \n from mkdocs.config.defaults import MkDocsConfig\n+from mkdocs.structure.pages import Page\n+from mkdocs.structure.files import Files\n \n logger = logging.getLogger(\"mkdocs\")\n \n@@ -22,3 +24,29 @@\n         now = context[\"build_date_utc\"].strftime(\"%Y/%m/%d\")\n         config.copyright = f\"{config.copyright}, last updated {now}\"\n         logger.info(f\"Updated copyright to {config.copyright}\")\n+\n+\n+_EMOJI_MAP = {\n+    \"\ud83c\udfc6\": \":trophy:\",\n+    \"\ud83d\udee0\ufe0f\": \":tools:\",\n+    \"\ud83d\udcd8\": \":blue_book:\",\n+    \"\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1\": \":people_holding_hands_tone1:\",\n+    \"\ud83d\udcbb\": \":computer:\",\n+    \"\ud83c\udd98\": \":sos:\",\n+    \"\ud83d\udc63\": \":footprints:\",\n+    \"\u23e9\": \":fast_forward:\",\n+    \"\u23cf\ufe0f\": \":eject:\",\n+    \"\u2601\ufe0f\": \":cloud:\",\n+}\n+\n+\n+def on_page_markdown(\n+    markdown: str,\n+    page: Page,\n+    config: MkDocsConfig,\n+    files: Files,\n+) -> str:\n+    if page.file.name == \"index\" and page.title == \"Home\":\n+        for rd, md in _EMOJI_MAP.items():\n+            markdown = markdown.replace(rd, md)\n+    return markdown\n", "issue": "DOC: Website <->README sync\nFollowing @hoechenberger's PRs I think our README.md (which ends up on PyPI) looks nicer / does better advertising than our docs landing page does\r\n\r\n| https://pypi.org/project/mne-bids-pipeline/#description | https://mne.tools/mne-bids-pipeline/1.0/index.html |\r\n| -- | -- |\r\n| ![Screenshot from 2022-12-08 13-01-47](https://user-images.githubusercontent.com/2365790/206529981-f1808ad5-49bf-4236-b904-ff72f9e12e70.png) | ![Screenshot from 2022-12-08 13-01-53](https://user-images.githubusercontent.com/2365790/206530007-2bbf52c3-229a-47bf-b2c9-b23812fdc977.png) |\r\n\r\nI propose that we should add the tag line and bullet points from the README.md to the landing page for mne-bids-pipeline, and also double check that our project description matches. This would also make it a bit more like MNE-Python, where our landing page tries to quickly convey \"This package can do a lot of cool stuff that you want!\".\r\n\r\nI propose that we should modify `build_docs.sh` to have a `gen_index.py` that takes the bullet points of README.md and pastes them into the `index.md` for the website.\r\n\r\n@hoechenberger @drammock WDYT?\n", "before_files": [{"content": "import logging\nfrom typing import Dict, Any\n\nfrom mkdocs.config.defaults import MkDocsConfig\n\nlogger = logging.getLogger(\"mkdocs\")\n\nconfig_updated = False\n\n\n# Ideally there would be a better hook, but it's unclear if context can\n# be obtained any earlier\ndef on_template_context(\n    context: Dict[str, Any],\n    template_name: str,\n    config: MkDocsConfig,\n) -> None:\n    \"\"\"Update the copyright in the footer.\"\"\"\n    global config_updated\n    if not config_updated:\n        config_updated = True\n        now = context[\"build_date_utc\"].strftime(\"%Y/%m/%d\")\n        config.copyright = f\"{config.copyright}, last updated {now}\"\n        logger.info(f\"Updated copyright to {config.copyright}\")\n", "path": "docs/hooks.py"}], "after_files": [{"content": "import logging\nfrom typing import Dict, Any\n\nfrom mkdocs.config.defaults import MkDocsConfig\nfrom mkdocs.structure.pages import Page\nfrom mkdocs.structure.files import Files\n\nlogger = logging.getLogger(\"mkdocs\")\n\nconfig_updated = False\n\n\n# Ideally there would be a better hook, but it's unclear if context can\n# be obtained any earlier\ndef on_template_context(\n    context: Dict[str, Any],\n    template_name: str,\n    config: MkDocsConfig,\n) -> None:\n    \"\"\"Update the copyright in the footer.\"\"\"\n    global config_updated\n    if not config_updated:\n        config_updated = True\n        now = context[\"build_date_utc\"].strftime(\"%Y/%m/%d\")\n        config.copyright = f\"{config.copyright}, last updated {now}\"\n        logger.info(f\"Updated copyright to {config.copyright}\")\n\n\n_EMOJI_MAP = {\n    \"\ud83c\udfc6\": \":trophy:\",\n    \"\ud83d\udee0\ufe0f\": \":tools:\",\n    \"\ud83d\udcd8\": \":blue_book:\",\n    \"\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1\": \":people_holding_hands_tone1:\",\n    \"\ud83d\udcbb\": \":computer:\",\n    \"\ud83c\udd98\": \":sos:\",\n    \"\ud83d\udc63\": \":footprints:\",\n    \"\u23e9\": \":fast_forward:\",\n    \"\u23cf\ufe0f\": \":eject:\",\n    \"\u2601\ufe0f\": \":cloud:\",\n}\n\n\ndef on_page_markdown(\n    markdown: str,\n    page: Page,\n    config: MkDocsConfig,\n    files: Files,\n) -> str:\n    if page.file.name == \"index\" and page.title == \"Home\":\n        for rd, md in _EMOJI_MAP.items():\n            markdown = markdown.replace(rd, md)\n    return markdown\n", "path": "docs/hooks.py"}]}