Jump to content

ProcessWire Cheatsheet


Soma

Recommended Posts

Just wanted to mention some updates I was recently working on.

1. The Cheatsheet is now a ProcessWire Site (since couple months already). This allows for easy updating by team members. Also it allows for implementing stuff that wouldn't be easy with a static html. So all entries are now pages. This was very easy to setup and import the html data via a simple script.

2. Since we now got all the power of PW there, my idea was to create a API doc Site that would serve as a alternative extended sort of cheatsheet. Similar to php.net where you can see more details along with simple code examples and further information like what version introduced or if it's depreciated, related links to other API's. Also there's possibility to add comments. 

This opens great possibilities to give more information to you, add a "social" aspect, and at the same time also open it for indexing by search engines . :)

You can see the current (not finished) version of the extended API doc here:

http://cheatsheet.processwire.com/pages/built-in-methods-reference/pages-find-selector/

We are currently adding content and examples to the API's so this will take some time. Also there will be added some cross linking from the Cheatsheet to the extended docs when ready. Hope you like it.

(edit: just realized that this was the 100th response in this thread! great coincidence)

  • Like 15
Link to comment
Share on other sites

It's a pity line numbers change as code evolve, else it would be nice that you could add links to the processwire core where example are.

Good idea. I think on Captain Hook Soma managed to do this. Lines should point to the Stable Release, hence won't change until the next Stable version...

Link to comment
Share on other sites

  • 8 months later...
  • 4 months later...
  • 1 month later...
  • 1 month later...

For the record, "Introduced in" seems a bit off in some cases. http://cheatsheet.processwire.com/page/built-in-methods-reference/page-parentsuntil-selector/ for an example; this was apparently introduced in 2.3, not in 2.0.

I just stumbled on this myself, while working on a 2.2 site..  :)

Edited by teppo
2.3, not 2.4
Link to comment
Share on other sites

  • 5 months later...

Getting back to this topic may I ask if there are any plans to update the cheatsheet in near future? Or is it discontinued? The cheatsheet is such a valuable resource. I would be glad to assist in updating it but I'm afraid my understanding of the API isn't good enough.

Thanks for keeping us informed.

  • Like 3
Link to comment
Share on other sites

  • 3 years later...

Hello everybody. 

Last night (no sleep) I was thinking about the state of the PW documentation and Cheatsheet in general. How about we relaunch this project, make it open and PW based? There seems to be so much knowledge and doc buried in Blog Posts and added in newer Versions of PW but Cheatsheet and Docs don't seem to reflect these…

So i thought about building a new version with the following:

  • New Cheatsheet based on PW
  • Open for contribution by community, the PW community is so great, I think we could keep it uptodate with community effort…
  • Indicate what Version a feature was added
  • Comments on features etc.
  • Links to Blog Articles, PW Weekly & useful Forum entries
  • Example Implementations
  • Hooks and Hook Recipes
  • Maybe open API?

What are your thoughts? Any ideas about how to implement stuff? Am I the only one who regularly finds himself tracking down blog-posts, poking for infos in the forum, comments inside files etc? I'd be happy to kickstart and support the project…

 

  • Like 1
Link to comment
Share on other sites

Yep, just saw the comments and version ? missed that from memory…

How about setting up a workflow: If @ryan adds new features etc. he'd notify a mailing-list and whoever has time could add the stuff to cheatsheet? How could we breath life into it again? Because I think it's already great, it would just need some more love ?

  • Like 1
Link to comment
Share on other sites

Every time this topic comes up I'm slightly worried about the relation between any community-led documentation project and the new(ish) API reference at https://processwire.com/api/ref/. This already gets (somewhat?) automatically populated based on the latest core release, and I seem to remember @ryan mentioning something along the lines of updating / releasing a new cheatsheet that would use same data. If that's really the plan, it could easily make any manually updated documentation obsolete.

That being said, I'm not 100% sure that this actually was Ryan's plan – or even if it was, is that still true? Additionally it might take a long time before he gets there (he's a busy fellow, after all.) Would be great if the man himself could chime in and let us know what the current plan regarding the docs is, and if we can somehow help make that happen ?

One problem with the current, auto-generated docs might be that (as far as I remember correctly) the code that generates it is also powering the (commercial) API Explorer module, which could make Ryan somewhat hesitant to share it with others – which is perfectly fine, of course, but could also mean that we can't do much to help him there. But anyway, this is mostly just guessing.

I've been quite happy with the new API reference, with the main problem being that one can't switch between core versions. For us who manage and work on different ProcessWire versions (for me this means everything from 2.2 .to 3.0) that's a major downside: currently when I'm working on anything other than my own projects, where the core version is generally speaking always the latest one, it's much easier to forget the docs and dive into the codebase to see which methods were available at the time.

  • Like 4
Link to comment
Share on other sites

  • 6 months later...
2 hours ago, Ivan Gretsky said:

The cheatsheet is missing on the new site. Is it by plan or by accident?

 

On 1/9/2019 at 5:28 PM, ryan said:

... currently it's too far out of date so I'm not showing it in the docs navigation at the moment. I'm hoping to get the cheatsheet connected to the API Explorer module so that it can always be up-to-date like the API Reference section. 

 

  • Like 3
Link to comment
Share on other sites

Actually speaking of the cheatsheet - these days I just refer to the API Explorer panel in Tracy - it's all there and always up to date and I generally prefer it to the PW website docs for quickly finding stuff. 

That said, I still think there is a place for the cheatsheet for beginners because it lays out the most used stuff so well.

  • Like 4
Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...