document structure for single-page site development

37 views
Skip to first unread message

Gauvins

unread,
Oct 25, 2019, 8:40:33 AM10/25/19
to BBEdit Talk
I'll be working for a few-to-many weeks on a single-page site and was wondering how experienced developers structure such a project. 

The site involves very little html (50 lines), a fair amount of styling (200+ lines), javaScript (1000+ lines), and AJAX procedures handled by php scripts. 

Once in production, the code will be minified and stored in 3 distinct files + helpers (.html, .css, .js, .php). But during development I prefer to not bother with linked files. I find it more convenient to navigate inside a single file where code resides between <style></style> and <script></script> tags. Now, BBEdit's project feature might be a better alternative (i.e. split in logical modules and navigate across documents, not inside a large integrated one).

Any piece of advice?

David Donachie

unread,
Oct 25, 2019, 8:59:10 AM10/25/19
to bbe...@googlegroups.com
If you are using (say) a .vue file, then I don't think there is a specific highlighting mode in BBEdit in the same way that there is in (for example) Visual Studio Code.

Is that the sort of code-help you are looking for?

David

--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/79e2d329-0947-4b7a-9a72-84e5d96958ab%40googlegroups.com.

Sam Hathaway

unread,
Oct 25, 2019, 10:10:48 AM10/25/19
to Gauvins, BBEdit Talk

I’d say do whatever you need to do to become comfortable organizing your code into multiple files. In the long run you’ll be happier with short files that contain all the code—and only the code—that addresses a particular concern. I would consider a 1000 line file to be exceptionally large and probably in need of refactoring.

I think you’re right that BBEdit’s projects feature can help here. Other features that may be able to help are:

File > Open File by Name… - Select the name of a file and hit ⌘D to open that file.

Search > Multi-File Search… - Search all open files, all files in a project, all files in a folder, etc. Filter by file name, type, etc.

Hope you find this useful!
-sam

--
Reply all
Reply to author
Forward
0 new messages