I’ve extracted all methods from the Cheat Sheet (camera, content, dimension, exif, field, file, files, language, location, page, pages, pagination, request, roots, site, camera, user and users) to create an Espresso autocomplete-plugin.
While it’s very useful to me it’s still very simple and won’t suggest anything inside the parentheses. I’m going to add that functionality in the future. Sadly it’s very time consuming to create something that saves time . Fortunately, a description of the methods is not necessary since they are so straight-forward and understandable.
Download it here: https://github.com/medienbaecker/kirby-sugar
Since Atom is so “hackable” I’m sure you can quickly convert it. In this file you can find the methods and use search and replace to change the surrounding tag.
I’m using Sublime Text. Would be nice to have something like it there as well.
I just saw this one: https://packagecontrol.io/packages/Kirby2%20CMS%20Snippets
I don’t know if it’s up-to-date and complete, though.
Lol - I’m using Rapid PHP and Visual Studio for web-development…
Looks like all those snippets / auto-complete helpers are not standardized at all
I’ve tried to convert Bootstrap-snippets from Visual Studio to Rapid PHP, but that didn’t work out.
Brackets and Atom are another story as well…
It was updated 2015-09-07.
It did not work as good as I was hoping for. When doing this:
$page->title(), so far so good. But when I hit enter it becomes…
Now I made this topic about the Sublime Text completion. Sorry about that.
No problem. I think it would be awesome to have the Cheat Sheet autocompletion across every text editor.
That doesn’t sound good, but I think you can easily edit it. Sublime Text is very straight-forward with these customizations. Have a look at the references regarding “completions”.
I’m not sure but I feel like it in theory would be possible to have some kind of script that goes through the functions and then by some rules adapt it to multiple text editors at once.
Maybe it would require a list of functions to not include the whole Kirby, but the rest seems doable.
Maybe it would take time, maybe it’s hard, but possible?
I’m not the one for that project. I just looked in my Github and it looks like I have some plugins to maintain already.
It’s actually not very complicated to extract the methods from each individual class. From there, it should be possible to get the information into the different formats, don’t know how complicated that is.
Yes, it’s mostly a case of “search and replace”.
I’ve added a methods.txt to my repository, just take the methods from there.
I once created a Sublime autocomplete file for Kirby 1 (https://github.com/jakobploens/Kirby-CMS-Auto-completion-for-Sublime-Text-2), and I had the same issue with autocompletion. Here was one solution (not sure if this works or not, never tested it): https://github.com/jakobploens/Kirby-CMS-Auto-completion-for-Sublime-Text-2/issues/1