Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix: URL record numbers are not dates; research web sources move with their pair

hugohe35988c8f9e3f9
diff --git a/skills/ppt-master/scripts/docs/project.md b/skills/ppt-master/scripts/docs/project.md
index 58daf809..01cf5382 100644
--- a/skills/ppt-master/scripts/docs/project.md
+++ b/skills/ppt-master/scripts/docs/project.md
@@ -22,6 +22,8 @@ python3 scripts/project_manager.py page-context-report <project_path>
```
Notes:
+- A moved topic-research pair `projects/<slug>.md` takes its sibling
+ `projects/<slug>_web_sources/` along to `analysis/research_web_sources/`.
- Local sources under `projects/` are moved into the target project unless
`--copy` is passed; a file inside another project's tree is copied unless
`--move` is explicit, so borrowing a finished project's slices never empties it.
diff --git a/skills/ppt-master/scripts/project_management/cli.py b/skills/ppt-master/scripts/project_management/cli.py
index 6103e697..d7de8953 100644
--- a/skills/ppt-master/scripts/project_management/cli.py
+++ b/skills/ppt-master/scripts/project_management/cli.py
@@ -934,6 +934,7 @@ class ProjectManager:
)
continue
+ web_sources = source_path.with_name(f"{source_path.stem}_web_sources")
archived_markdown, asset_dir, note = self._import_markdown_with_assets(
source_path,
sources_dir,
@@ -941,6 +942,23 @@ class ProjectManager:
)
summary["archived"].append(str(archived_markdown))
summary["markdown"].append(str(archived_markdown))
+ if (
+ effective_move
+ and web_sources.is_dir()
+ and web_sources.resolve().parent == PROJECTS_ROOT.resolve()
+ ):
+ # topic-research fetches pages beside its pair under
+ # projects/; they travel with the pair as provenance
+ # rather than staying behind in the shared directory.
+ target = project_dir / "analysis" / "research_web_sources" / web_sources.name
+ if target.exists():
+ summary["notes"].append(
+ f"{web_sources}: left in place; {target} already exists"
+ )
+ else:
+ target.parent.mkdir(parents=True, exist_ok=True)
+ shutil.move(str(web_sources), str(target))
+ summary["analysis"].append(str(target))
if asset_dir is not None:
summary["assets"].append(str(asset_dir))
self._propagate_image_assets(asset_dir, project_dir)
diff --git a/skills/ppt-master/scripts/source_to_md/web_to_md.py b/skills/ppt-master/scripts/source_to_md/web_to_md.py
index 73af8f4b..903f94a8 100644
--- a/skills/ppt-master/scripts/source_to_md/web_to_md.py
+++ b/skills/ppt-master/scripts/source_to_md/web_to_md.py
@@ -587,11 +587,13 @@ def extract_metadata(soup: BeautifulSoup, url: str) -> dict[str, str]:
if not date:
# Try URL matching
- match = re.search(r"(\d{4})(\d{2})[\/_](?:t\d+_)?", url)
+ # Only a plausible year and month: a handle or record number such as
+ # ".../10665/379812/..." is not May 3798.
+ match = re.search(r"(?<!\d)((?:19|20)\d{2})(0[1-9]|1[0-2])[\/_](?:t\d+_)?", url)
if match:
date = f"{match.group(1)}-{match.group(2)}"
else:
- match = re.search(r"(\d{4})[-\/](\d{2})[-\/](\d{2})", url)
+ match = re.search(r"(?<!\d)((?:19|20)\d{2})[-\/](0[1-9]|1[0-2])[-\/](\d{2})", url)
if match:
date = f"{match.group(1)}-{match.group(2)}-{match.group(3)}"
diff --git a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
index f5d0c8b0..ed836008 100644
--- a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
+++ b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
@@ -521,6 +521,15 @@ class RtlAndTemplateExportTests(unittest.TestCase):
self.assertEqual(_rtl_theme_scripts("zh-CN"), ())
+class IntakeHousekeepingTests(unittest.TestCase):
+ def test_record_numbers_in_urls_are_not_dates(self) -> None:
+ from bs4 import BeautifulSoup
+ empty = BeautifulSoup("<html><title>x</title></html>", "html.parser")
+ date = lambda url: web_to_md.extract_metadata(empty, url)["date"]
+ self.assertEqual(date("https://iris.who.int/bitstream/handle/10665/379812/x.pdf"), "")
+ self.assertEqual(date("https://www.mem.gov.cn/kp/shaq/202205/t20220519_413952.shtml"), "2022-05")
+
+
class SlideSizeTypeTests(unittest.TestCase):
def test_standard_ratios_keep_their_token(self) -> None:
self.assertEqual(_slide_size_type(12192000, 6858000), "screen16x9")