mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 02:16:21 +00:00
Adapt docs generation to new integrated README content
This commit is contained in:
1 parent
df16c9f9f5
commit
749bb815ae
4 files changed
+9
-22
No files matched your search
@@ -181,7 +181,7 @@ def autogen_about_intro_features():
|
||||
with open(readme_path, "r", encoding="utf-8") as f:
|
||||
readme_contents = f.read()
|
||||
|
||||
match = re.search(r"<h3.*?>(.*?)</h3>(.*?)^(## Features.*?)^## ", readme_contents, re.DOTALL | re.MULTILINE)
|
||||
match = re.search(r"<h3.*?>(.*?)</h3>(.*?)^## Programming.*?^(## Features.*?)^## ", readme_contents, re.DOTALL | re.MULTILINE)
|
||||
assert match, f"Failed to extract about texts from README.md. {__file__} probably needs to be updated."
|
||||
|
||||
tagline = match.group(1).strip()
|
||||
@@ -194,6 +194,8 @@ def autogen_about_intro_features():
|
||||
f.write(autogen_info)
|
||||
f.write("# About Serena\n\n")
|
||||
f.write(f"**{tagline}**\n\n")
|
||||
about_text = about_text.replace("resources/serena-block-diagram.png", "https://raw.githubusercontent.com/oraios/serena/main/resources/serena-block-diagram.svg")
|
||||
about_text = re.subn(r"^See the \[Quick Start.*?$", r"", about_text, flags=re.MULTILINE)[0]
|
||||
f.write(f"{about_text}\n\n")
|
||||
|
||||
jetbrains_marketplace_link = ('```{raw} html\n'
|
||||
@@ -201,9 +203,11 @@ def autogen_about_intro_features():
|
||||
'<img style="background-color:transparent;" src="../_static/images/jetbrains-marketplace-button.png">'
|
||||
'</a></p>\n```')
|
||||
|
||||
with open(Path(__file__).parent / "01-about" / "005_features.md", "w", encoding="utf-8") as f:
|
||||
with open(Path(__file__).parent / "01-about" / "025_features.md", "w", encoding="utf-8") as f:
|
||||
f.write(autogen_info)
|
||||
features_text = re.subn(r"^#", r"", features_text, flags=re.MULTILINE)[0]
|
||||
features_text = re.subn(r"</?details>", "", features_text, flags=re.MULTILINE)[0]
|
||||
features_text = re.subn(r"<summary>.*?</summary>", "", features_text, flags=re.MULTILINE)[0]
|
||||
features_text = re.sub(r'<a href="https://plugins.jetbrains.com.*?</a>', jetbrains_marketplace_link, features_text, flags=re.DOTALL)
|
||||
f.write(f"{features_text}\n\n")
|
||||
|
||||
|
||||
Reference in new issue
Block a user