Skip to content

Commit f44ffb2

Browse files
committed
get rid of private modules references
1 parent 1ac1465 commit f44ffb2

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

scripts.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,38 @@ def generate_docs():
8585
for f in out.glob("**/*.html"):
8686
f.rename(f.with_suffix(".md"))
8787

88+
8889
def clean_mdx_content(content: str) -> str:
89-
parts = re.split(r'(```[\s\S]*?```)', content)
90-
90+
parts = re.split(r"(```[\s\S]*?```)", content)
91+
9192
cleaned_parts = []
9293
for part in parts:
9394
if part.startswith("```"):
94-
cleaned_parts.append(part)
95+
text = (
96+
part.replace("&lt;", "<")
97+
.replace("&gt;", ">")
98+
.replace("&#39;", "'")
99+
.replace("builtins.", "")
100+
.replace("fishjam.api._client.", "")
101+
.replace("fishjam.api._fishjam_client.", "")
102+
.replace("fishjam.events._protos.fishjam.", "")
103+
.replace("fishjam._openapi_client.models.peer.", "")
104+
.replace("fishjam._openapi_client.models.peer_metadata.", "")
105+
.replace("fishjam._openapi_client.models.peer_status.", "")
106+
.replace("fishjam._openapi_client.models.peer_type.", "")
107+
.replace("fishjam._openapi_client.models.room_config.", "")
108+
.replace("fishjam._openapi_client.models.room_config_room_type.", "")
109+
.replace("fishjam._openapi_client.models.room_config_video_codec.", "")
110+
.replace("fishjam._openapi_client.models.subscriptions.", "")
111+
.replace("fishjam._openapi_client.models.subscribe_mode.", "")
112+
.replace("fishjam._openapi_client.models.track.", "")
113+
.replace("fishjam._openapi_client.types.", "")
114+
)
115+
cleaned_parts.append(text)
95116
else:
96117
text = part.replace("{", "\\{").replace("}", "\\}")
97-
text = text.replace("<", "&lt;")
98118
cleaned_parts.append(text)
99-
119+
100120
return "".join(cleaned_parts)
101121

102122

@@ -133,6 +153,11 @@ def generate_docusaurus():
133153

134154
dest_path.write_text(safe_content, encoding="utf-8")
135155

156+
fishjam_dir = out / "fishjam"
157+
submodules_dir = out / "submodules"
158+
159+
fishjam_dir.rename(submodules_dir)
160+
136161

137162
def update_client():
138163
if len(sys.argv) < 2:

templates/docusaurus/module.html.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{% if module.submodules %}
1414
## Submodules
1515
{% for submodule in module.submodules if is_public(submodule) | trim %}
16-
- [{{ submodule.name }}](fishjam/{{ submodule.name }})
16+
- [{{ submodule.name }}](submodules/{{ submodule.name }})
1717
{% endfor %}
1818
{% endif %}
1919
{% endblock %}

0 commit comments

Comments
 (0)