Live data from Hacker News

Show HN: Nash, I made a standalone note with single HTML file

keepworking.github.io

71–80 of 153 posts

Re: Show HN: Nash, I made a standalone note with single HTML file

#74
post #20

Noice! UX suggestion. You don't need the "as read only" save options if when you do a normal save the page tells you if it has been changed. That'll get you down to 2 menu options and make me think less.

The "as read only" options produce an HTML document that lacks the editor features - when you open that file from your computer, you'll see static content (although it just changes a couple of HTML attributes and leaves all the JavaScript in, inactive). The normal options re-create the entire page - editor, content and all.

Re: Show HN: Nash, I made a standalone note with single HTML file

#75

I wish browsers had better support for local web apps. If local files can access persistent storage easily, this can open it up a lot of opportunities for quick and easy GUI apps. Basically the opposite of electron.

How file can access anything? It is just data. It can not do anything.

Re: Show HN: Nash, I made a standalone note with single HTML file

#76
post #59

Much of the heavy lifting is done by this simple but powerful attribute, something surprisingly few developers seem to know about. It's been around for quite a while.

Yeah, it's pretty amazing. Back in 2016 I was still doing a lot of custom sites for small/mid businesses, and realized that almost all of this could be done with WP or something except (1) WP styling is really annoying and I don't want to maintain that, (2) I didn't want to rely on plugin functionality and upgrading WP, and (3) I wanted people with different levels of access to be able to edit different parts of the same page, which is basically impossible in most CMSs. So I basically wrote a CMS from scratch that relied on nothing but contenteditable and TinyMCE, and handed those tags to the appropriate portions (with back-end checks on what people could or could not edit before it was committed, obviously). But the point is, once a client (or their employees) are logged in, they get the right to edit the portions of their own pages that they have credentials for. The CMS puts a nice little dashed border around the parts they can edit, and all of their fonts and colors are saved in TinyMCE preferences so they don't need to hunt around or muck with any HTML (although they can, if they want to).

This ends up feeling rather magical to the clients, because they don't need to go to an editing page to make changes before seeing what it will look like. They just literally edit the content in place on the page, and hit save to deploy it live.

Most of these sites are still in operation after 5-10 years and require almost zero maintenance on my end.

Re: Show HN: Nash, I made a standalone note with single HTML file

#77
post #57

Calling it a "note" is a bit confusing. I'd call it a self-modifying editable single-file web app.

Indeed, that one would be more descriptive. At first I thought that the project is a joke about pretend-discovering that you can create a web page without tools other than a text editor, and without embedding external resources, similar to vanilla-js.com. I wonder whether "note" is readily understood as "a document edited in a WYSIWYG editor" by some, possibly because it is called that way in some software.

Re: Show HN: Nash, I made a standalone note with single HTML file

#78
I think something underrated but cool about this is that it's kind of like a virus. It saves its own JS source code in every file it saves, so that file can go on to make other files. Or maybe that's not cool? I guess I could think of some nefarious ways to implant a little malicious script in a standalone I send someone, that doesn't activate until they send it to someone else who was a target...

Re: Show HN: Nash, I made a standalone note with single HTML file

#79
post #54

Earlier quoted context omitted.

It's interesting, I also do not like the implication that we are all using vscode and feel slightly offended that someone would assume that I do. (The original statement is worded ambiguously and can be understood in this way.) Anyway, I find it remarkable that a piece of software that I don't even use can trigger such a reaction in me, from a perfectly benign and innocent statement about the prevalence of HTML.

Sorry I didn't mean to offend anyone. That said, I'm genuinely interested in understanding why you felt that way, is using VSCode considered something to be ashamed of or something, is it because it's a Microsoft product? PS: I have a strong positive bias towards VSCode due to personal history, so just trying to understand the developer perspective :)

> Sorry I didn't mean to offend anyone.

I know, and it's nothing that needs an apology from you. Sometimes people (like me) feel offended over nothing, and it's more interesting for them to question why that is, instead of blamig the other party. That's not to say the reverse can't be true, just that it's tempting and too easy to project one's own offendedness if one isn't careful.

But back to the interesting question of what's up with vscode.

It's a very subjective thing for me, which probably explains the emotional reaction. I'm aware that vscode must be a very solid and practical tool for so many people to use it. But it gives me a negative gut feeling, mostly for the following reasons:

Using what is essentially a browser to edit text feels wrong and bloaty, not unlike going on a cruise ship just so you can eat at a restaurant.

It's made by Microsoft. I'm old enough to remember when they were not ashamed of being openly nasty, how they tried to lock us all into their own walled garden, and the glimpse Internet Explorer gave us into what that would look like. It's hard to trust this company, even if they have taken on a more benign appearance.

So, it just feels very wrong to use a weirdly bloaty browser-editor that a company with a track record of being a Big Bad Influence gives away for free. (I have similar misgivings about Chrome, which does not help vscode.)

Therefore, I prefer dedicated editors and IDEs made by people whose main goal is to make just such tools, and who I can pay for (as a purchase or donation). In summary: vscode works well, but using it makes me feel icky, and there are similar or better alternatives available to me that don't give me such a feeling.

So if there is a public statement that can be read to imply that I'm somehow happily using vscode feels a little like getting mud thrown at me, if that makes any sense, and there's a strong urge to clean up the record and, by extension, myself.

Yeah, I also think it's weird how that works. It's things like this that make me understand better the secret inner workings of people interacting with other people. :)

Re: Show HN: Nash, I made a standalone note with single HTML file

#80
post #18

This is cool. It's funny how we are (or maybe just I am) so used writing the JS parts of websites outside of the actual HTML that my first thought upon seeing this was "wow it's crazy that this can be done with just HTML". And then looking at the source and seeing all the JS in plain old script tags made me remember that that's a thing that you can do.

Not necessarily a thing you should do if you want any kind of separability or version control. But definitely a thing you can do.

What blows my mind is that people use frameworks where they include stuff that's not even JS in their HTML, stuff that needs external JS to attach to it or hydrate it. That feels like the worst of both worlds.

I definitely come from an opposite place where JS is king and I don't have any files with an ".html" extension exept for "index.html". And I don't have any HTML in my JS, either. Anything that's a partial template is ".htm" and gets hydrated before it gets added to the DOM.

Post reply on HN