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
3 Likes
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ā¦
Thanks!
It was updated 2015-09-07.
It did not work as good as I was hoping for. When doing this:
$page->titl
It finds $page->title()
, so far so good. But when I hit enter it becomesā¦
echo $page->$page->title()
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.
1 Like
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