textfold 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. textfold-0.10.0/LICENSE +202 -0
  2. textfold-0.10.0/NOTICE +17 -0
  3. textfold-0.10.0/PKG-INFO +262 -0
  4. textfold-0.10.0/README.md +230 -0
  5. textfold-0.10.0/pyproject.toml +52 -0
  6. textfold-0.10.0/setup.cfg +4 -0
  7. textfold-0.10.0/textfold/__init__.py +2 -0
  8. textfold-0.10.0/textfold/__main__.py +134 -0
  9. textfold-0.10.0/textfold/agents.py +344 -0
  10. textfold-0.10.0/textfold/biorxiv.py +147 -0
  11. textfold-0.10.0/textfold/bridges.py +115 -0
  12. textfold-0.10.0/textfold/build.py +123 -0
  13. textfold-0.10.0/textfold/engine.py +288 -0
  14. textfold-0.10.0/textfold/epmc.py +88 -0
  15. textfold-0.10.0/textfold/fetch.py +65 -0
  16. textfold-0.10.0/textfold/fold.py +135 -0
  17. textfold-0.10.0/textfold/github.py +91 -0
  18. textfold-0.10.0/textfold/jats.py +395 -0
  19. textfold-0.10.0/textfold/kinds.py +49 -0
  20. textfold-0.10.0/textfold/ladder.py +296 -0
  21. textfold-0.10.0/textfold/langs.py +52 -0
  22. textfold-0.10.0/textfold/links.py +68 -0
  23. textfold-0.10.0/textfold/llm.py +204 -0
  24. textfold-0.10.0/textfold/llm_openai.py +101 -0
  25. textfold-0.10.0/textfold/local.py +143 -0
  26. textfold-0.10.0/textfold/markdown.py +115 -0
  27. textfold-0.10.0/textfold/models.py +144 -0
  28. textfold-0.10.0/textfold/notes.py +298 -0
  29. textfold-0.10.0/textfold/office.py +879 -0
  30. textfold-0.10.0/textfold/omml.py +204 -0
  31. textfold-0.10.0/textfold/parse.py +381 -0
  32. textfold-0.10.0/textfold/pdf.py +85 -0
  33. textfold-0.10.0/textfold/pdfdoc.py +517 -0
  34. textfold-0.10.0/textfold/pipeline.py +70 -0
  35. textfold-0.10.0/textfold/providers.py +205 -0
  36. textfold-0.10.0/textfold/semantic.py +567 -0
  37. textfold-0.10.0/textfold/server.py +682 -0
  38. textfold-0.10.0/textfold/store.py +231 -0
  39. textfold-0.10.0/textfold/tokens.py +130 -0
  40. textfold-0.10.0/textfold/translate.py +228 -0
  41. textfold-0.10.0/textfold/web/app.css +259 -0
  42. textfold-0.10.0/textfold/web/app.html +46 -0
  43. textfold-0.10.0/textfold/web/app.js +805 -0
  44. textfold-0.10.0/textfold/web/i18n.js +330 -0
  45. textfold-0.10.0/textfold/web/reader.css +768 -0
  46. textfold-0.10.0/textfold/web/reader.js +3344 -0
  47. textfold-0.10.0/textfold/web/template.html +28 -0
  48. textfold-0.10.0/textfold/web/tutorial.js +501 -0
  49. textfold-0.10.0/textfold/web/vendor/fonts/OFL-Inter.txt +93 -0
  50. textfold-0.10.0/textfold/web/vendor/fonts/OFL-SourceSerif4.txt +93 -0
  51. textfold-0.10.0/textfold/web/vendor/fonts/fonts.css +172 -0
  52. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-cyrillic-ext.woff2 +0 -0
  53. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-cyrillic.woff2 +0 -0
  54. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-greek-ext.woff2 +0 -0
  55. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-greek.woff2 +0 -0
  56. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-latin-ext.woff2 +0 -0
  57. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-latin.woff2 +0 -0
  58. textfold-0.10.0/textfold/web/vendor/fonts/inter-normal-vietnamese.woff2 +0 -0
  59. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-cyrillic-ext.woff2 +0 -0
  60. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-cyrillic.woff2 +0 -0
  61. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-greek.woff2 +0 -0
  62. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-latin-ext.woff2 +0 -0
  63. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-latin.woff2 +0 -0
  64. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-italic-vietnamese.woff2 +0 -0
  65. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-cyrillic-ext.woff2 +0 -0
  66. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-cyrillic.woff2 +0 -0
  67. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-greek.woff2 +0 -0
  68. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-latin-ext.woff2 +0 -0
  69. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-latin.woff2 +0 -0
  70. textfold-0.10.0/textfold/web/vendor/fonts/sourceserif4-normal-vietnamese.woff2 +0 -0
  71. textfold-0.10.0/textfold/web/vendor/katex/LICENSE +21 -0
  72. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  73. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  74. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  75. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  76. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  77. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  78. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  79. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  80. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  81. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  82. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  83. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  84. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  85. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  86. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  87. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  88. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  89. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  90. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  91. textfold-0.10.0/textfold/web/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  92. textfold-0.10.0/textfold/web/vendor/katex/katex.min.css +1 -0
  93. textfold-0.10.0/textfold/web/vendor/katex/katex.min.js +1 -0
  94. textfold-0.10.0/textfold/web/vendor/pdfjs/LICENSE.txt +177 -0
  95. textfold-0.10.0/textfold/web/vendor/pdfjs/pdf.min.mjs +28 -0
  96. textfold-0.10.0/textfold/web/vendor/pdfjs/pdf.worker.min.mjs +28 -0
  97. textfold-0.10.0/textfold/webpage.py +119 -0
  98. textfold-0.10.0/textfold/wiki.py +199 -0
  99. textfold-0.10.0/textfold.egg-info/PKG-INFO +262 -0
  100. textfold-0.10.0/textfold.egg-info/SOURCES.txt +102 -0
  101. textfold-0.10.0/textfold.egg-info/dependency_links.txt +1 -0
  102. textfold-0.10.0/textfold.egg-info/entry_points.txt +2 -0
  103. textfold-0.10.0/textfold.egg-info/requires.txt +12 -0
  104. textfold-0.10.0/textfold.egg-info/top_level.txt +1 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
textfold-0.10.0/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ TextFold (formerly PaperFold)
2
+ Copyright 2026 Xia Chen
3
+
4
+ This product includes software developed by Xia Chen
5
+ (https://github.com/chenxiachan/textfold), licensed under the Apache License,
6
+ Version 2.0 (see LICENSE).
7
+
8
+ It includes the fonts Inter and Source Serif 4 (SIL Open Font License 1.1, in web/vendor/fonts), KaTeX
9
+ (MIT License, in web/vendor/katex) and PDF.js (Apache License 2.0, in web/vendor/pdfjs), kept with TextFold
10
+ so that its pages ask no other server for anything.
11
+
12
+
13
+ Papers and their licenses
14
+
15
+ The license covers TextFold's source code only. Papers read with TextFold, and the levels, links,
16
+ translations and pages made from them, remain under the licenses their authors chose. Whoever stores,
17
+ shares or publishes that content is responsible for respecting those licenses.
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: textfold
3
+ Version: 0.10.0
4
+ Summary: Zoom any text from every word to a one-screen map: papers, READMEs, Wikipedia and your agent's replies
5
+ Author: Xia Chen
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/chenxiachan/textfold
8
+ Project-URL: Gallery, https://chenxiachan.github.io/paperfold-gallery/
9
+ Project-URL: Issues, https://github.com/chenxiachan/textfold/issues
10
+ Keywords: reading,stretchtext,semantic zoom,arxiv,summarization,llm
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Text Processing
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ Requires-Dist: beautifulsoup4
21
+ Requires-Dist: lxml
22
+ Requires-Dist: Pillow
23
+ Requires-Dist: markdown-it-py
24
+ Requires-Dist: mdit-py-plugins
25
+ Requires-Dist: latex2mathml
26
+ Requires-Dist: trafilatura>=2.0
27
+ Requires-Dist: mammoth
28
+ Requires-Dist: openpyxl
29
+ Provides-Extra: anthropic
30
+ Requires-Dist: anthropic; extra == "anthropic"
31
+ Dynamic: license-file
32
+
33
+ <div align="center">
34
+
35
+ <img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/logo.svg" width="72" alt="TextFold">
36
+
37
+ # TextFold
38
+
39
+ **Fold any text, from a one-screen map to every word**
40
+
41
+ <sub>Formerly PaperFold</sub>
42
+
43
+ <img alt="Python 3.9+" src="https://img.shields.io/badge/python-3.9%2B-6B5CE7?style=flat-square">
44
+ <img alt="Runs on your computer" src="https://img.shields.io/badge/runs-on_your_computer-E08A3C?style=flat-square">
45
+ <a href="https://github.com/chenxiachan/textfold/blob/main/LICENSE"><img alt="Apache License 2.0" src="https://img.shields.io/badge/license-Apache_2.0-6B5CE7?style=flat-square"></a>
46
+
47
+ **English** · [简体中文](https://github.com/chenxiachan/textfold/blob/main/README.zh-CN.md)
48
+
49
+ <picture>
50
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/sources-dark.webp">
51
+ <img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/sources.webp" width="880" alt="What TextFold reads: arXiv, PubMed Central, bioRxiv, medRxiv, Wikipedia, GitHub READMEs, any web page, PDF, Word, PowerPoint, Excel, EPUB, HTML, pictures, Markdown, text, CSV and an agent's replies, folded from the full text down to a few words">
52
+ </picture>
53
+
54
+ **Paste a link:** any web page · arXiv · PubMed Central · bioRxiv · medRxiv · Wikipedia · GitHub<br>
55
+ **Drop a file:** PDF · Word · PowerPoint · Excel · EPUB · HTML · CSV · pictures · Markdown · text
56
+
57
+ **[Try the demo →](https://chenxiachan.github.io/paperfold-gallery/)** or **[install it ↓](#get-started)** · [What's new ↓](#whats-new)
58
+
59
+ <br>
60
+
61
+ <img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/zoom.gif" width="880" alt="A paper folding from its full text into a map of its sections, and back">
62
+
63
+ </div>
64
+
65
+ ## Read with less in your head
66
+
67
+ Choose the level of detail you need, and lower your cognitive load.
68
+
69
+ | | Level | Each paragraph becomes | In whose words |
70
+ |:-:|---|---|---|
71
+ | **1** | **Full** | the paragraph as written | the author's |
72
+ | **2** | **Brief** | its one to three key sentences, verbatim | the author's |
73
+ | **3** | **Key** | its point and the reason for it | AI, resting on the Brief sentences |
74
+ | **4** | **Takeaway** | one line on the spine of its section | AI |
75
+ | **5** | **Topic** | a few words; the text becomes a map of section cards | AI |
76
+
77
+ ## Also for agent output
78
+
79
+ Your agent writes more than you have time to read. A [Claude Code mod](https://code.claude.com/docs/en/plugins/mods/overview) folds every reply the same way, one key per level. [More ↓](#in-claude-code)
80
+
81
+ <img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/textfold.gif" width="880" alt="A reply in Claude Code folding from the full text to two sentences a paragraph, then one, and back, one key at a time">
82
+
83
+ ## One fold, three places
84
+
85
+ - **Read.** Paste a link or drop a file; it opens as a map of its sections that you zoom into. [Get started ↓](#get-started)
86
+ - **Fold your agent's replies.** One key per level in Claude Code, with no second model. [In Claude Code ↓](#in-claude-code)
87
+ - **Plug it into your workflow.** `python3 -m textfold get` hands your agent or script a document one level at a time, and an open format lets any program read and write folded text. [For agents ↓](#for-agents-and-scripts)
88
+
89
+ ## What you get
90
+
91
+ - **Words that travel.** As you zoom, every word that stays slides to its new place and the rest fade around it.
92
+ - **Zoom under your fingers.** Stop halfway, turn back, or open one paragraph alone.
93
+
94
+ - **Beside the original.** Open a paper's or a PDF's own pages next to the text, each paragraph shown where it stands on its page.
95
+ - **Ask AI about exactly what you read.** Select a passage, or ask about the whole text. The answer comes structured: the short answer first, then the evidence, each point citing the paragraph it rests on, one click away.
96
+ - **Notes that zoom with the text.** Highlight and write in the margin; what you marked stays as you zoom out, and is saved with the page.
97
+
98
+ - **Your language.** Twelve languages, translated sentence by sentence, with every formula as typeset.
99
+
100
+ <table>
101
+ <tr>
102
+ <td width="50%"><img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/notes.png" alt="Highlights in the full text and a note in the margin"></td>
103
+ <td width="50%"><img src="https://raw.githubusercontent.com/chenxiachan/textfold/main/docs/assets/keep.png" alt="The highlighted passages kept at the Takeaway level"></td>
104
+ </tr>
105
+ <tr>
106
+ <td align="center"><sub>Highlight and write in the margin…</sub></td>
107
+ <td align="center"><sub>…and keep what you marked as you zoom out.</sub></td>
108
+ </tr>
109
+ </table>
110
+
111
+ ## Get started
112
+
113
+ ```bash
114
+ python3 -m pip install textfold
115
+ python3 -m textfold serve
116
+ ```
117
+
118
+ Open `http://localhost:3017`. The first time, [connect a model](#connect-a-model); then paste a link or drop a file, and pick a language. You need Python 3.9 or newer (the one macOS ships with works).
119
+
120
+ | Paste or drop | What TextFold reads |
121
+ |---|---|
122
+ | A paper's link or DOI: arXiv, PubMed Central, bioRxiv, medRxiv | its text as the site structures it (an arXiv paper needs its HTML version, as most since late 2023 have; another DOI needs an open full text in Europe PMC) |
123
+ | Any other web page | its article, without the menus, the adverts, or the text it hides from its readers |
124
+ | A Wikipedia article, a GitHub repository | the article; the README, with its pictures |
125
+ | A PDF | the paper online when the PDF names one, with your file beside it; any other PDF, converted on your computer by the PDF engine (MinerU, about 3.4 GB, installed once from the landing) |
126
+ | A Word, PowerPoint or Excel file, a CSV, an EPUB, a saved web page | the document with its headings, tables, pictures and formulas: read by TextFold itself, or more completely by the PDF engine once it is installed |
127
+ | A picture | its text, read by the PDF engine |
128
+ | A Markdown or text file | the file as written |
129
+
130
+ What you read is kept in your system's folder for app data, shared with the desktop app.
131
+
132
+ <details>
133
+ <summary>Run it from the code instead</summary>
134
+
135
+ ```bash
136
+ git clone https://github.com/chenxiachan/textfold.git
137
+ cd textfold
138
+ python3 -m pip install -r requirements.txt
139
+ python3 -m textfold serve
140
+ ```
141
+
142
+ What you read is then kept in the clone.
143
+
144
+ </details>
145
+
146
+ ## Connect a model
147
+
148
+ TextFold uses a model you already have, and there is no account to create. It looks for one when it starts; if it finds none, the first page offers the ways in.
149
+
150
+ | You have | What to do |
151
+ |---|---|
152
+ | Claude Code, Codex or Pi | Nothing. TextFold finds it and uses it. |
153
+ | A ChatGPT plan | Click **Use my ChatGPT plan**. A small bridge starts on your computer and signs in with your account (needs Node.js). |
154
+ | Nothing yet | Click **OpenRouter in one click**. Authorize once, and free models are ready. |
155
+ | An API key | **Settings › Add provider**: Anthropic, OpenAI, DeepSeek, Qwen, Zhipu GLM, Kimi, MiniMax, Google, Ollama, or any OpenAI-compatible endpoint. |
156
+
157
+ ## In the reader
158
+
159
+ | Do | To |
160
+ |---|---|
161
+ | Pinch, or ⌘ / Ctrl + scroll | zoom around the pointer |
162
+ | `1` to `5` | jump to a level |
163
+ | Click a paragraph | open just that paragraph |
164
+ | Click a figure | see it enlarged |
165
+ | **Original**, at the top | read beside the paper's PDF |
166
+ | **Save**, at the top | keep the page as one file, or only your notes |
167
+ | Select text | highlight, write a note, or ask |
168
+ | **Ask the paper**, bottom right | ask about the whole text |
169
+ | `L` | next language |
170
+
171
+ ## For agents and scripts
172
+
173
+ `python3 -m textfold get` gives a document one level at a time, coarsest first, so an agent reads the map before it spends its context on the whole text:
174
+
175
+ ```bash
176
+ python3 -m textfold get https://arxiv.org/abs/2201.11903 # the map: every section's topic
177
+ python3 -m textfold get 2201.11903 --level key --section 3 # one section: its points, each with its reason
178
+ python3 -m textfold get report.pdf --json # the whole document, in the TextFold format
179
+ ```
180
+
181
+ A document not folded yet is folded first, with the model you connected. Every line a model wrote is marked as such and anchored to the author's sentences it rests on: [docs/format.md](https://github.com/chenxiachan/textfold/blob/main/docs/format.md) describes the format, for any program that reads or writes folded text.
182
+
183
+ ## Save a page
184
+
185
+ **Save**, at the top of the reader, keeps a page as one HTML file that opens anywhere without a server: its levels, the notes you choose and, if you like, its original PDF to read beside it. It can also keep only your notes, as a page, a PDF, Markdown for Obsidian or JSON. From the command line, the page without your notes:
186
+
187
+ ```bash
188
+ python3 -m textfold export 2201.11903
189
+ ```
190
+
191
+ TextFold is a tool, and its license covers its code. When you share a file, follow the terms of the original text, shown under its title.
192
+
193
+ ## In Claude Code
194
+
195
+ TextFold puts the five levels on every reply in Claude Code. Press 5 for the answer in one sentence, 3 for the point of every paragraph, 1 for every word. Nothing is paraphrased, so at every level you read exactly what Claude said.
196
+
197
+ <details>
198
+ <summary><b>Install it, and see what each level gives you</b></summary>
199
+
200
+ <br>
201
+
202
+ It needs Claude Code 2.1.287 or later, in the terminal or in the Code tab of the Desktop app.
203
+
204
+ ```bash
205
+ claude plugin marketplace add chenxiachan/textfold
206
+ claude plugin install textfold@textfold
207
+ ```
208
+
209
+ | Key | Level | What you get |
210
+ |:-:|---|---|
211
+ | **1** | **Full** | every word Claude wrote |
212
+ | **2** | **Brief** | each point, with the reason behind it |
213
+ | **3** | **Points** | just the points, at a glance |
214
+ | **4** | **Outline** | the map of a long reply: its sections, and what each one says |
215
+ | **5** | **Gist** | the answer, in one sentence |
216
+
217
+ Type the digit while the prompt is empty, or pick a level in the row above the prompt. Short replies stay whole: one under about 80 words, or one a fold would barely shorten, always shows as written.
218
+
219
+ **Start folded.** A session starts at Full. To start at another level, run `/config` and set **Starting level**; in the session, the row above the prompt and the keys 1 to 5 still change it.
220
+
221
+ **Why you can trust a fold.** TextFold asks Claude to lead with the point: the answer first in every reply, the key sentence first in every paragraph. A fold keeps what Claude put first. There is no second model and no summary, so a fold costs nothing and takes no time.
222
+
223
+ More in [plugins/textfold](https://github.com/chenxiachan/textfold/blob/main/plugins/textfold/README.md).
224
+
225
+ </details>
226
+
227
+ ## What's new
228
+
229
+ - **October 13, 2026: save a page as one file.** **Save**, at the top of the reader, keeps the page as one HTML file, with your notes and its original PDF if you like, or only your notes. [Save a page ↓](#save-a-page)
230
+ - **October 13, 2026: Word, PowerPoint, Excel, e-books and more.** Drop a Word, PowerPoint or Excel file, a CSV, an EPUB or a saved web page, and it opens at once, formulas included, with nothing more to install.
231
+ - **October 13, 2026: whole figures, and a guide.** A figure the PDF engine cut into pieces now comes out whole, cut from its page. A short guide opens on your first visit, and again from **How it works**.
232
+
233
+ <details>
234
+ <summary>Earlier</summary>
235
+
236
+ - **October 9, 2026: PaperFold is now TextFold.** The same reader, named for everything it folds: papers, web pages, PDFs, READMEs and your agent's replies. Links to the old repository lead here, and your settings move over by themselves.
237
+ - **October 9, 2026: any web page, and PDFs.** Paste any web page's link and read its article at five levels, without the text the page hides from its readers. Drop a PDF: when it names a paper that can be read online, that version opens with your PDF beside it; any other PDF is converted on your computer.
238
+ - **October 9, 2026: for agents.** `python3 -m textfold get <link> --level topic` prints a document's map, and `--section` unfolds the part that matters. [More ↓](#for-agents-and-scripts)
239
+ - **October 8, 2026: any GitHub README.** Paste a repository's link and read its README at five levels, with its logo, badges and GIFs as on GitHub.
240
+ - **October 8, 2026: read beside the original.** **Original**, at the top of a paper, opens its PDF at the left and shows each paragraph on its page as you read. A new paper opens as soon as it can be read, while its levels are written.
241
+ - **October 7, 2026: your agent's replies fold too.** [The Claude Code mod](#in-claude-code) puts the five levels on every reply. Press 5 for the answer in one sentence, 1 for every word.
242
+ - **October 6, 2026: more than arXiv.** PubMed Central, bioRxiv, medRxiv, Wikipedia in any language, and your own Markdown files.
243
+
244
+ </details>
245
+
246
+ <br>
247
+
248
+ <div align="center">
249
+
250
+ **If TextFold helps you read, ⭐ star it so others can find it.**
251
+
252
+ </div>
253
+
254
+ ---
255
+
256
+ <div align="center">
257
+
258
+ <sub>Built on [trafilatura](https://github.com/adbar/trafilatura), which finds the article on a web page, [MinerU](https://github.com/opendatalab/MinerU), which converts PDFs, and [mammoth](https://github.com/mwilliamson/python-mammoth), which reads Word files; PDFs are shown with [PDF.js](https://github.com/mozilla/pdf.js) and formulas with [KaTeX](https://katex.org). Thanks to their authors.</sub>
259
+
260
+ [Apache 2.0](https://github.com/chenxiachan/textfold/blob/main/LICENSE) © 2026 Xia Chen · [Development](https://github.com/chenxiachan/textfold/blob/main/docs/DEVELOPMENT.md) · [Format](https://github.com/chenxiachan/textfold/blob/main/docs/format.md) · [Contributing](https://github.com/chenxiachan/textfold/blob/main/CONTRIBUTING.md) · [Security](https://github.com/chenxiachan/textfold/blob/main/SECURITY.md) · [Feedback](https://github.com/chenxiachan/textfold/issues)
261
+
262
+ </div>