{"id":16860799,"url":"https://github.com/keikoro/plaintextref","last_synced_at":"2025-10-31T09:36:19.179Z","repository":{"id":27095769,"uuid":"30562985","full_name":"keikoro/plaintextref","owner":"keikoro","description":"Convert in-text references (like URLs) to sequentially numbered footnotes. :page_facing_up::link:","archived":false,"fork":false,"pushed_at":"2018-10-30T08:52:21.000Z","size":65,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T22:31:31.111Z","etag":null,"topics":["formatting","plaintext","python","python3","text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keikoro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-09T22:48:34.000Z","updated_at":"2024-05-23T23:20:36.000Z","dependencies_parsed_at":"2022-09-02T04:51:07.647Z","dependency_job_id":null,"html_url":"https://github.com/keikoro/plaintextref","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keikoro%2Fplaintextref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keikoro%2Fplaintextref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keikoro%2Fplaintextref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keikoro%2Fplaintextref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keikoro","download_url":"https://codeload.github.com/keikoro/plaintextref/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247328212,"owners_count":20921148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatting","plaintext","python","python3","text"],"created_at":"2024-10-13T14:27:03.532Z","updated_at":"2025-10-31T09:36:19.053Z","avatar_url":"https://github.com/keikoro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plaintextref\n\nA Python3/Python program which converts in-text references (citations, URLs) in text-based files to sequentially numbered footnotes for better readability.\n\nHTML files get stripped of their tags and changed to proper plaintext in the process.\n\n\n## Example\n\nOriginal text:\n\n\u003cpre\u003eFans keep arguing over if Thranduil (\u003ca href=\"http://evankart.deviantart.com/art/Thranduil-419996946\"\u003ehttp://evankart.deviantart.com/art/Thranduil-419996946\u003c/a\u003e) or Thorin (\u003ca href=\"http://evankart.deviantart.com/art/Thorin-Oakenshield-420365763\"\u003ehttp://evankart.deviantart.com/art/Thorin-Oakenshield-420365763\u003c/a\u003e) makes the better [... sassier] king.\u003c/pre\u003e\n\u003cbr /\u003e\nResulting text:\n\n\u003cpre\u003eFans keep arguing over if Thranduil[1] or Thorin[2] makes the better[3] king.\u003cbr\u003e\n___\n[1] \u003ca href=\"http://evankart.deviantart.com/art/Thranduil-419996946\"\u003ehttp://evankart.deviantart.com/art/Thranduil-419996946\u003c/a\u003e\n[2] \u003ca href=\"http://evankart.deviantart.com/art/Thorin-Oakenshield-420365763\"\u003ehttp://evankart.deviantart.com/art/Thorin-Oakenshield-420365763\u003c/a\u003e\n[3] ... sassier\u003c/pre\u003e\n\u003cbr /\u003eSee also sample files [thth.txt](thth.txt) and [thth_plaintext.txt](thth_plaintext.txt)\n\n\n## Description\n\nThis program is particularly useful for making texts like e-mails containing a high number of references (like links to websites) better legible by moving all references out of the running text and into an appendix at the end of the document.\n\nAt the same time, the user writing such texts is not required to change their writing habits too much: URLs are put into (regular, round) brackets like they usually might, asides which are better left in the running text can also be kept in round brackets, only citations that should explicitely be converted to footnotes need to be enclosed in square brackets (which are normally lesser-used punctuation marks).\n\nAnother purpose of this program is the conversion of HTML-formatted e-mails or texts to plaintext for better sharing via mailing lists which only support or prefer the sending of plaintext e-mails.\n\n\n## Usage\n\nStart the script by specifying which file you want to convert. The converted text is saved to a new file which, by default, has ```_plaintext``` appended to the original file name. Save location is the folder containing the original file or any other writable directory you specify.\n\n```$ python3 plaintextref.py myfile.txt``` or\n\n```$ python plaintextref.py myfile.txt```\n\n\n... results in a new file called ```myfile_plaintext.txt```\n\nRun the program with option ```-h``` or ```--help``` for detailed information on which arguments you can pass to the script.\n\n\n##Caveats\n\nThe program assumes that the following signify references that are to be turned into footnotes:\n* round brackets whose contents begin with URLs\n* (most) square brackets\n\u003cbr\u003e\n\nIt ignores:\n* round brackets containing regular text (including any kind of nested brackets)\n* square brackets denoting errors: ```[sic]``` and ```[sic!]```\n* square brackets indicating modified quotes *if* they are inside double quotation marks, e.g. ```\"Could you tell the [other dwarves] I said goodbye?\"```\n\u003cbr\u003e\u003cbr\u003e\n\nThe script currently supports the conversion of regular **text** files as well as **HTML** files. Adding support for **Markdown files** might happen at a later point. See also [#1](/../../issues/1).\n\n\u003cbr\u003e\n\u003chr\u003e\n\nThis program, while mostly different in functionality, was in part motivated by [miniref](https://github.com/Lotterleben/miniref).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeikoro%2Fplaintextref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeikoro%2Fplaintextref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeikoro%2Fplaintextref/lists"}