13 | ]]>
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
25 | com.intellij.modules.lang
26 | com.intellij.modules.platform
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Ionic Framework IntelliJ Plugin
2 | ===============================
3 |
4 | A plugin for the IntelliJ platform (IntelliJ IDEA, RubyMine, etc) that provides live templates for the Ionic Framework. You can install the plugin (named "Ionic Framework") from the plugins section inside your Jetbrains IDE.
5 |
6 | Feel free to let me know what else you want added via [issues](https://github.com/bodiam/idea-ionic/issues).
7 |
8 | Suggestions, feedback and other comments also welcome via [@epragt](https://twitter.com/epragt) on Twitter.
9 |
10 | ### Installation (in 3 easy steps)
11 |
12 | To install the plugin open your editor (IntelliJ) and hit:
13 |
14 | 1) `File > Settings > Plugins` and click on the `Browse repositories` button.
15 |
16 | 2) Look for `Ionic Framework` the right click and select `Download plugin`.
17 |
18 | 3) Finally hit the `Apply` button, agree to restart your IDE and you're all done!
19 |
20 | ### Usage
21 |
22 | To use the plugin, open an HTML file in the editor, and start typing `ion-`, followed by pressing CMD+J. A list of templates will show up. Alternatively, you can type e.g. `alert`, followed by CMD+J, to immediately show only the alert templates.
23 |
24 | ## What's new
25 |
26 | Since 0.1 (23 Feb 2015):
27 |
28 | Initial release with basic functionality.
29 |
30 | - ion-headers
31 |
32 | ### License
33 |
34 | Ionic Framework - IntelliJ Plugin is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
35 |
--------------------------------------------------------------------------------
/doc/Development.txt:
--------------------------------------------------------------------------------
1 | Templates can be found here:
2 |
3 | cd ~/Library/Preferences/IntelliJIdea13/templates/
--------------------------------------------------------------------------------
/generateReadme.groovy:
--------------------------------------------------------------------------------
1 | @Grapes(
2 | @Grab(group='com.google.guava', module='guava', version='18.0')
3 | )
4 | import com.google.common.base.CaseFormat
5 |
6 | def file = new File("resources/liveTemplates/Bootstrap3.xml")
7 | def root = new XmlParser().parse(file)
8 |
9 | def templates = root.template
10 |
11 | def components = templates.collect {
12 | new Component(text:it.'@description', code: it.'@name', context:findMainContext(it))
13 | }
14 |
15 | def sorted = components.sort { it.code }
16 | def groups = splitInGroups(sorted)
17 |
18 | printToc(groups)
19 | printComponents(groups)
20 |
21 |
22 |
23 |
24 | void printToc(groups) {
25 | groups.each {
26 | println "- [${it.name}](#${CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, it.name)})"
27 | }
28 | }
29 |
30 | void printComponents(groups) {
31 | groups.each { group ->
32 | println ""
33 | println "### ${group.name}"
34 | println ""
35 | println "| Component | Snippet code | Context |"
36 | println "|------------------------------- | -------------------------------| ------- |"
37 |
38 | group.components.each {
39 | println "| ${String.format("%-30s", it.text)} | ${String.format("%-30s", it.code)} | ${String.format("%-7s", it.context)} |"
40 | }
41 | }
42 | }
43 |
44 | def findMainContext(template) {
45 | template.context.option.'@name'.contains('HTML') ? "HTML" : "CSS"
46 | }
47 |
48 | private List splitInGroups(components) {
49 | def groups = []
50 | Group lastGroup = null
51 |
52 | components.each { component ->
53 | def groupName = component.code.split(':')[0][4..-1].capitalize()
54 | def group = new Group(name:groupName)
55 |
56 | if(lastGroup == null || group.name != lastGroup.name) {
57 | lastGroup = new Group(name:groupName)
58 | groups << lastGroup
59 | }
60 |
61 | lastGroup.components.add(component)
62 | }
63 |
64 | return groups
65 | }
66 |
67 | class Group {
68 | String name
69 | List components = []
70 | }
71 |
72 | class Component {
73 | String text, code, context
74 |
75 | String getText() {
76 | text ?: 'No description'
77 | }
78 | }
--------------------------------------------------------------------------------
/generateTemplate.groovy:
--------------------------------------------------------------------------------
1 | import nl.jworks.generator.Template
2 |
3 | def colors = [
4 | "light", // light grey
5 | "stable", // grey
6 | "positive", // blue
7 | "calm", // cyan
8 | "balanced", // green
9 | "energized", // yellow
10 | "assertive", // red
11 | "royal", // purple
12 | "dark" // black
13 | ]
14 |
15 | def headers = colors.collect { color ->
16 | new Template("ion-header:$color", "Header which is fixed at top of the screen ($color)", "
\n" + "
\$title\$
\n" + "
", ["title"])
17 | }
18 | def subheader = new Template("ion-subheader", "A secondary header bar can be placed below the original header bar.", "
\n" + "
Sub Header
\n" + "
")
19 |
20 | def footers = colors.collect { color ->
21 | new Template("ion-footer:$color", "Footers are regions at the bottom of a screen that can contain various types of content. ($color)", "
\n" + "
\$title\$
\n" + "
", ["title"])
22 | }
23 |
24 | def button = new Template("ion-button", "It's a button", "")
25 |
26 | def buttons = colors.collect { color ->
27 | new Template("ion-button:$color", "A button ($color)", "", ["title"])
28 | }
29 |
30 | def blockButtons = colors.collect { color ->
31 | new Template("ion-block-button:$color", "A button with display:block style ($color)", "", ["title"])
32 | }
33 |
34 | def fullWidthBlockButtons = colors.collect { color ->
35 | new Template("ion-full-width-block-button:$color", "A button with display:block style without borders ($color)", "", ["title"])
36 | }
37 |
38 | def smallButtons = colors.collect { color ->
39 | new Template("ion-small-button:$color", "A smaller button ($color)", "", ["title"])
40 | }
41 |
42 | def largeButtons = colors.collect { color ->
43 | new Template("ion-big-button:$color", "A larger button ($color)", "", ["title"])
44 | }
45 |
46 | def outlinedButtons = colors.collect { color ->
47 | new Template("ion-outline-button:$color", "A button with outline style, which also has a transparent background ($color)", "", ["title"])
48 | }
49 |
50 | def clearButtons = colors.collect { color ->
51 | new Template("ion-clear-button:$color", "A button without border ($color)", "", ["title"])
52 | }
53 |
54 | def iconButtons = null // TODO
55 |
56 | def clearHeaderButtons = new Template("ion-clear-header-buttons", "A header with clear buttons", "
\n" + " \n" + "
Header Buttons
\n" + " \n" + "
")
57 |
58 |
59 | //def buttonBar = new Template("ion-button-bar", "A button bar", "
\n" + " \n" + "
Header Buttons
\n" + " \n" + "
")
60 | //def buttonBarColors = new Template("ion-button-bar", "A button bar", "