Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit951b88c

Browse files
committed
fixes#63
1 parent0b1f893 commit951b88c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

‎llms_txt/txt2html.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
importmistletoe
2+
frompathlibimportPath
3+
fromfastcore.scriptimportcall_parse
4+
5+
@call_parse
6+
defmain(
7+
file_path='llms.txt'# path to llms.txt file
8+
):
9+
text=Path(file_path).read_text(encoding="utf-8")
10+
fragment=mistletoe.markdown(text)
11+
processed=fragment.replace('.html.md">','.html">')
12+
full=f"""<!DOCTYPE html>
13+
<html>
14+
<head>
15+
<title>llms.html</title>
16+
</head>
17+
<body>
18+
{processed}
19+
</body>
20+
</html>"""
21+
Path("llms.html").write_text(full)
22+

‎settings.ini‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ keywords = nbdev jupyter notebook python LLMs NLP
2727
language = English
2828
status = 3
2929
user = AnswerDotAI
30-
requirements = fastcore>=1.7.3 httpx
30+
requirements = fastcore>=1.7.3 httpx mistletoe
3131
conda_user = fastai
3232
console_scripts =llms_txt2ctx=llms_txt.core:llms_txt2ctx
33+
llms_txt2html=llms_txt.txt2html:main
3334
readme_nb = index.ipynb
3435
allowed_metadata_keys =
3536
allowed_cell_metadata_keys =

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp