I’ve been toying around this this idea for a while and I’d love to implement it, but I know nothing about contributing to Atom, so I’d love some help building this.
Two things that bug be about code editing these days:
- switching between files
- file load order, module exports, globals
What if we can start writing code in one giant file, and denote different sections using anchors. All anchors with the same ending will be concatenated in order so you’ll end up with a
program.html files in a typical web application.
As you create a program, you can just start writing whatever you want. And rather than create a new file, you can just create another anchor tag describing what that sections is. Using these tags you can filter through these sections in different ways so you can have multiple perspectives on the code.
Suppose, I’m creating a new component. I may first write some markdown documentation. I may write some code on the server to handle this new component… Here’s the order of my anchors all within the same canonical file.
~home.docs.md ~home.server.js ~home.client.js ~home.html ~home.css ~user.html ~user.css ~user.client.js ~home.html ~home.css ~utils.docs.md ~utils.js ~home.client.js ~home.html ~home.css
Now, all the different sections will be concatenated in this order and thats your program. But while you’re coding, debugging, or trying to find you create a “new tab” based on querying these anchor tags, such as “home.js” which will take all files with “home” and “js” tags, concatenate them into a file in order, and then you can code within the sections right there. Another query might by “home.html | home.css” which will give you html interlaces with CSS based on the order from the cannonical file.
You can compile documentation by concatenating the results of queries such as “home.docs & utils.docs”. (& being concat, and | being interlace).
Anyways, I think this is pretty neat and not too complicated. You don’t have to switch files as much because you’ll be able to get everything you want right in from of your face by querying anchor tags. The load order is very explicit without the tedium of directory structure, file paths, load order, module exports, requiring modules, exposing variables, etc.
As far as an atom package,
- there needs to be a meta-syntax highlighter that recognizes these anchor tags and highlights the section based on the file ending of the tag.
- you need to be able to create a “new tab” using a “query”. When a section is edited and saved, the package must update the canonical file and any open files with that section.
- the package must concatenate files (this is easy)
I’ve never build anything for Atom, and I don’t really know where to start (but I’m a coffeescript fan ).