Hacker News new | past | comments | ask | show | jobs | submit login
Write Plain Text Files (2022) (sive.rs)
63 points by arguflow 14 days ago | hide | past | favorite | 47 comments



> Every device, including ones long gone, and ones not invented yet, can read and edit plain text. [...] But plain text? Always. Everywhere.

Somebody needs to watch "Plain Text" (Dylan Beattie, NDC Copenhagen 2022) https://www.youtube.com/watch?v=gd5uJ7Nlvvo

For example, have fun with ISO 8859-2 vs. Windows 1250. And add Windows 1252 for giggles. And for the ASCII-only persons: there still is EBCDIC.


The space of possible encodings and languages is still far smaller than the space of possible document formats.


It's relatively easy to get the document format by using a heuristic on "not so plain" text, not to be talking about more "binary" formats which are even easier to recognise, for example to differentiate between Markdown and Org-Mode and RST, or the different Markdown variants. It is (almost) impossible to get the encoding (welcome to ISO 8859-? vs. Windows-????) or even the used codepage right.

Take at look at the "reality": there are converters for almost any file format and file format descriptions for (almost any imaginable), so there is a chance to read or write almost any format by yourself (yes, some can be really complex, as for example some 3D formats like 3DS or LWO).

I don't mean to say that somebody shouldn't use "plain text" for themselves, but that the idea of "this is plain text, this works everywhere and anytime" is not true.

And the list of known codepages (and I can guarantee you there is some hardware - a printer - out there that uses it's own, because it had been only ever used with it's own printer driver/program/...): https://en.wikipedia.org/wiki/Code_page


Just use utf-8 everywhere. Yes, even on Windows http://utf8everywhere.org/

Full Unicode support is very hard. The best I've seen is in Raku. You can leave without it completely e.g. Zig.


This is a misunderstanding of the term: "pain text" sits opposite of "rich text", formats where the markup is part of the content. The terms are at a higher level of abstraction than just encoding, rich text being things like xml/html or word documents that require specialized parsers to retrieve the content. Plain text refers to files that don't have that kind of special markup language.


> This is a misunderstanding of the term

No, there is more than one valid definition, the one you have used is the one used e.g. by the Unicode standard (but their definition is narrowed to Unicode, so anything not Unicode isn't plain text). But it doesn't matter which definition of "text" somebody uses, encoding is always a problem if not explicitly set like it is possible when using XML and HTML.

> "pain text"

Love that typo :D


Yeah and good luck if your native language requires CJK characters, right-to-left scripts like Arabic, or whatever. Fortunately Unicode is fairly good nowadays but the olden days of the wild west of encoding was terrible.


And if you're already assuming unicode (which all these "plaintext" tools do), why aren't we just using unicode bullet points instead of dashes and *? Why not just use unicode bold and italics instead of *hacks*?


It is a question of the input method first and, as the sibling commenter said, grepping second. Fuzzy search could handle "-" as: "–", "—", "―", "‒" and other dashes. I input slightly more special characters on my phone as it is easier. On my computer I remember how I can easily write ° (on Linux and ChromeOS - Shift-AltGr-0) so I use it more. I don't know how to easily input a bullet point and I am too lazy to open a character table app every time it is needed.

In a way it is the same with programming languages. I think there are now programming languages supporting unicode operators for example, like =, ≠, ∧, ∨, ∩, ∪. But they suffer from the same problem. How to input them, how to search for them?


> Why not just use unicode bold and italics instead of hacks?

To be able to search and grep?


> but the olden days

I welcome you to the world of printers, specially industrial label printers when using their (fast) bitmap fonts instead of e.g. true type ones.


When you have an iPhone, even text files feel like a custom proprietary format that is silo’d in its own world.

My problem is that while vim, markdown to HTML, and headless browser printing to PDF all work great on my desktop Linux machine there isn’t really a way to translate this to iOS and back.

If I could (a) mount my iCloud Drive in my Linux machine and (b) have a markdown centric editor on my phone then it would all work nicely. Unfortunately I feel like the lure of commercial success means Apple won’t allow the former and anyone working on the latter is doing it as a closed, proprietary, commercial system.

I curse myself every day for mixing operating systems!


Use SyncThing, there’s an iOS app. I use it with iA Writer with great success.


You can store iOS notes in IMAP (which is then easy to access from elsewhere) but unfortunately they're promoted* to HTML even if you start with plain text.

Would be nice if there was a "this is a plain text folder" option (but I appreciate you'd get a million customer support queries asking where the formatting has gone when people activate it accidentally.)


> anyone working on the latter is doing it as a closed, proprietary, commercial system.

But that's exactly the point of the article. It doesn't matter which app you use, or whether that specific app goes out of business or enshittifies - text files are portable to any other app. Sync it with rsync or git, they're just text.

That's why so many people on this site love Obsidian despite it being closed-source - the files it uses all exist in the most open file format of all.


I don’t really understand how this addresses my original point. With iOS I have an entire platform that can’t edit text files. What is supposedly a universal format is just not supported in this OS.

I also saw this point being made elsewhere recently regarding how iPadOS still does not have TextEdit: https://www.macstories.net/stories/not-an-ipad-pro-review/#m...


I'm in the same situation and don't have this issue. It's not that the OS doesn't support plain text files, it's that other OSs bundle in plain text editors, and iOS doesn't. Simply install one (like iAWriter), and you're done. You can't use iCloud for syncing, so then also install Syncthing (Mobius).

It's not as shiny a setup as the native offerings, but it's by no means a chore.


Except Obsidian doesn't use Markdown syntax for internal links to other Obsidian files, but (some variation of) Wiki-Syntax. This is something which I had to write my own parser for when converting Obsidian files to Org-Mode files using Pandoc https://github.com/Release-Candidate/Obs2Org


If you dont like wiki-style links, you should turn it off in the Settings > Files and links > Use [[Wikilinks]].


It's not about me and my configuration. The problem with Markdown is that there are so many "extensions" or variants or whatever you want to call them. But the usage of Wiki-style links instead of Markdown or HTML links is something really, well, "interesting". While it may be easier to type than markdown links, they are certainly worse to read as "plain text".


I use Obsidian myself, which simply stores text in Markdown files. It essentially shares all the pros of plain text: it'll be readable in the future, I'm not stuck with a single platform, I can sync and sort them into directories.


And bonus: Obsidian-like apps are their own subcategory now. Once you start using one, you can usually just open the root folder in any of the other apps and give them a spin with very little setup.


This depends on you not using crazy plugins specific to Obsidian that require you to write custom Markdown.


When I switched to Obsidian, I decided to not use any third party plugins. For this very reason. Keep it simple enough that I can switch to something else later or just open the directory in Nvim or VSCode.

And also because they are not sandboxed.


I rebuild my timeline thing to use files as the database instead of PostgreSQL.

Having everything as CSV, markdown, GPX etc means that I can use all the excellent software in the world to manipulate data... Or just a text editor. It's a lot easier than writing my own software to manipulate my own database.

It also means that my data will outlive my software without any effort.

And it means that backups are handled by my existing backup software.

I also moved my website to a static site generator earlier. Same reasons. I edit that website for a living, and using Sublime Text instead of a CMS WYSIWYG editor sped up my work dramatically. I can't overstate how much better it made batch edits.

https://github.com/nicbou/timeline


Plain text is the hacker's file format.

You can jot down ideas every day in markdown somewhere, maybe in a daily journal that's part of your second brain. Then you can move them into documents in a Git repo. Then you can feed them into an LLM and start producing interesting functions for your personal utility library. Then you can string them into a software solution for one problem or another.

This probably sounds vaguely disturbing if you are wearing a software engineer's hat. But if you're wearing a hacker's hat it's nirvana. At no point do you have to worry about being bound by the limitations of a particular tool, you are just transforming one chunk of text into another and moving those chunks around, really.


Previously on HN: 11 months ago [1] (14 points, 4 comments) 2 years ago [0] (739 points, 412 comments)

[0]: https://news.ycombinator.com/item?id=30521545 [1]: https://news.ycombinator.com/item?id=36591494


What is a good way to edit plain text files on a phone?

Do iOS and Android ship the tools to open/edit/save plain text files these days?

Edit: My question is not about third party apps. It is about what ships with iOS and plain Android.


If you're really committed to having lots of text file notes, Obsidian is probably the way to go nowadays. Sync it to a git repo (termux on Android, Working Copy on iOS) or use the first party option (or iCloud if you're in the Apple ecosystem)


I use Emacs as my daily driver but I also have Obsidian and I use that from time to on the Mac to do things like generate PDFs or work with some of the great Obsidian extensions.

To your point about editing in the phone, Obsidian has great iOS and iPadOS versions that work as well as the desktop version (albeit with some wackiness with some extensions that only work on the desktop version).

In combination, this gives me a seamless setup that is all text files (.md) and that works really well across all three form factors.


iOS does not ship with a plain text editor as far as I know. I think it's _kind of_ there underneath when you open a plain text file directly, but it needs to be associated with the app that's accessing it.

As an aside, iAWriter is very good. I use that paired with Syncthing for cross-platform working.


There are a bazillion Markdown editors out there. iA Writer, Textastic, a-Shell gives you vim and other UNIX tools, etc.


iA Writer and it has a nice zen mode


I use Markdown a lot, but for casual everyday stuff... I really like having sync. Keep opens instantly, has Android widgets(Less important now that Google Tasks has taken over some of what I used to do with Keep), and fast search.

But if I'm doing a Real Project, Markdown files in a git repo are perfect.

Luckily it's very easy to just copy from Keep to plan text.


My only problem with all thing plain text is I need cross-platform sync cuz I write on both my phone and laptop. For these I use Simplenote which has served me super well, but still looking for solutions where I can actually write plain text "files" while have convenient syncing.


These are orthogonal problems.

As neighbor poster mentioned, you can use eg Syncthing to sync your plain text files.


> These are orthogonal problems.

Yes and no. Non-plaintext formats can choose to integrate CRDTs or Operational Transform or such to improve sync.

(And, the other way around, plaintext formats are more suitable for long-term history in version control.)


Nextcloud Notes is what I use.


SyncThing. Even on iOS.


Related (in my mind, at least):

Notebooks without lines are the plain text files of the analogue world.

No lines to dictate how and what you want to write or draw.


> Notebooks [...] are the plain text files of the analogue world.

That's a good analogy for other reasons. Only people who can read your handwriting and know what language it should be in have a change of being able to read your "plain text". For example, have fun reading handwritten German in Kurrent (or Sütterlin): https://kurent.bastan.cz/ - and these are really, really legible fonts.


Or dotted notebooks which allow the free-form, but help if you do need things to be level , line up etc.


I do the same in org-mode, simply because pure-textual access (like grep) it's nice but limited, clickable links, attachments, executable links (elisp: but also various over link types like notmuch: for mail) are really a thing.

The issue it's that they are desktop-bound, no matter what you do. You can also run Emacs on Android but such platforms are meant just to consume content and munge data from users, not to produce, so it's not a matter of UI or mere bits availability. For sharing there are a bit of limitations but that's still easy if needed.

Beside that the most IT-frustration is the current state of development done to suck out all power to the user: we have IPv6 since decades, oh yes it's not perfect, but we perfectly can have a global per device and we can buy personal domain names and have subdomains on them. Unfortunately even if NOT having that is hyper-costly and challenging (NAT just to say) that's not there. FLOSS available to uncomfortable self-host is damn limited, we miss things like:

- damn simple desktop screen sharing NO THIRD PARTY, no need for special configs, not need to circumvent NAT and so on

- damn simple VoIP with or without video, P2P or with a personal server, but one, not to be configured with a gazzilion of things (yes we have GNU SIPWitch, Mumble, but still they are not a thing you deploy in a snap)

- damn simple internet-wide file sharing (we have gazillion of options, none simple and effective)

From a technological standpoint, those are perfectly possible, not done because "we need to been able to surveil users", "nobody is interested" (blatantly false, seen the popularity of crappy surveilling proprietary services we all know) and so on.

Long story short: yes we can do some thing to use computers effectively, taking notes is a good example, but we potentially can do MUCH MUCH MUCH more and we could not because of some "interests". That's a real shame simply because we lose decades of evolution and we only have one life, no respawn in the IRL game.


So step one is "be American so everything you want to write fits in American Standard Code for Information Interchange"?


There are more charitable readings of that article. Did it specify an encoding?


If you don't specify an encoding then the claim that "Every device, including ones long gone, and ones not invented yet, can read and edit plain text." is false.

Statements like that clearly shows the author means ASCII is the default everywhere.


I've noticed I'm fairly anti-American most of the time, but even I wouldn't have taken that away from this. Jesus.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: