Closed marcelgerber closed 10 years ago
So, some words about the .json file: Keys:
repo
(required): The GitHub repo where the theme lives. That's what the link points to.screen
(required): The screenshot's URL, relative to the repo's master branchname
(optional, defaults to repo
): The shown name of the themeuser
(optional, defaults to "Brackets-Themes"): The owner of the repo. Currently only "Brackets-Themes", but it may be required later.id:
An id
(HTML anchor) will automatically be created out of the name
key. It will be all lowercase and while special chars will be removed, spaces are replaced by hyphens. So, for example, the name "80's Baby" will result in the id "80s-baby".
JSON format: The JSON format is similar to a normal JS array/object notation, except that all object keys must be surrounded by quotes. I suggest downloading the JSONLint extension from the Extension Manager, it does a good job at linting JSON files.
Order: The order of the themes doesn't matter, they're automatically sorted alphabetically via JS. It'd still be cool to have a little tidiness in there since it makes maintenance easier.
Btw, I removed the anchor
stuff as we don't display it anyway right now.
I can easily re-add it though.
@MarcelGerber What do you think about just loading the package.json from the repo? So, the json file loaded via ajax is just a collection of that. That way we can keep in sync what shows in brackets extension registry and what we show here too.
That'd take much longer and right now, we don't have much use for it. The only thing we could use right away is the name, and maybe the description and version later on. An interesting approach'd be to load the registry.json file Brackets uses and identify our themes (or even ALL themes) there. But I guess we should land this first, there's still plenty of time to improve it later.
@MarcelGerber Coo, I am merging this in right now. Love what you have done :)
For #9.
This PR makes index.html load the currently available themes via AJAX from the newly added
themes.json
file, which can easily be edited.Advantages:
Disadvantages:
So basically, this PR removes all the old, static content about themes and puts in a placeholder where the themes will be displayed later on. At first, a newly added spinner will show up and will soon be replaced by the actual content.
Further changes:
Demo