CarterA / Tribo

Extremely fast static site generator written in Objective-C
http://cartera.me/2011/10/16/made-on-a-mac/
Other
42 stars 6 forks source link

Edit stylesheets/layouts #14

Closed sgoodwin closed 12 years ago

sgoodwin commented 12 years ago

You can easily edit new posts in your favorite editor in Tribo, this is great. You should also be able to open your html/css files from inside the app as well. Shouldn't need to go manually hunting around in the folder for em. The less people have to mess with the folders, the less likely they are to mess it up and ruin Tribo's processor.

CarterA commented 12 years ago

Yep, this should definitely happen. The structure is there already to have a tab for layouts and a tab for stylesheets (the Projects tab should just go away, it isn't necessary, but it serves as an example of how the tab bar should work). This is especially important if we move to a bundle format where the site appears as a single file.

sgoodwin commented 12 years ago

Progress: Screenshot

CarterA commented 12 years ago

Cool!

How are you fitting the layouts/templates (we need to decide on a name for these) into the model layer (if at all)?

Also, have you considered using a similar style to the post table view? Bigger table rows, maybe an icon (though .mustache files don't exactly have very exciting icons...). Finally, if the tab says "Templates", then having a sectioned table view with a "Templates" section seems repetitive.

sgoodwin commented 12 years ago

Yeah wasn't sure what to call the bigger tab. I added a model TBTemplateAsset (name might change too) that builds a tree of itself based on the Templates and soon the Sources folders. Then I just feed this into an NSTreeController and bind it to an NSOutlineView.

CarterA commented 12 years ago

Have you considered having more than two tabs? I mean, that's why it's an extensible class. One tab for Layouts, one for Stylesheets, etc. Although the problem there is that stylesheets aren't actually separate from generic HTML files and images, so you're probably on the right track here.

CarterA commented 12 years ago

Give this NSWorkspace method a shot for opening files in their default editor:

- openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:

Passing nil for the bundle ID should open the file in the default editor. Hopefully sandboxing will let this work.