Skip to content

Add property documentation syntax for Python, CoffeeScript, Lua, Clojure, Io #1237

Open

Description

@nwinter

(See also #399)

Calling all Scribes! In the spell palette, we currently have documentation like this:

screenshot 2014-06-26 17 08 52

But some of these things are written with JavaScript-specific syntax. We need to extend all the current Components' property documentation to handle the new syntax for Python, CoffeeScript, Lua, Clojure and Io.

There's a new process with this that just uses the level editor patch system, so you don't have to set up your dev environment or anything.

There are too many properties/languages to easily track who is working on what in this GitHub issue, so please use this Google Doc to mark when you are doing or have done things, since we can't merge patches instantly. Note that not all properties have any syntax differences between languages, so many fields can just be marked done with no changes.

0. Claim your target Component/Language in the spreadsheet.

screenshot 2014-06-26 17 37 06

1. Open any level in the level editor.

screenshot 2014-06-26 10 54 29

Different levels will have a few different Components needing documentation, but most are shared between most levels.

2. Click the Components tab.

screenshot 2014-06-26 10 55 23

3. Click on one of the Components.

screenshot 2014-06-26 10 56 10

4. Click the Component's Settings sub-tab.

screenshot 2014-06-26 10 57 33

5. Open the Property Documentation at the bottom.

screenshot 2014-06-26 10 56 53

6. Translate the JavaScript documentation into your programming language.

Look at programmable.Allied for a good example. Switch each field that has JavaScript-specific syntax to a multiple-language field, preserving the JavaScript one in a new javascript field, and adding your target language as another field.

Here's an example of changing from single-language (JavaScript) to multi-language:

screenshot 2014-06-26 11 02 55 screenshot 2014-06-26 11 04 14

7. Click "Submit Patch" under the chevron for the component to submit a patch (upper right).

screen shot 2014-08-11 at 4 52 07 pm

8. Mark your language/Component "done" in the spreadsheet.

Good work!

Activity

  1. nemoyatpeace commented on Jul 9, 2014

    @nemoyatpeace
    Contributor

    So as long as the level contains the component, it can be adjusted and patched in that level.

    Could I just make a new level and add a thang that has every component, then patch it that way?

  2. nwinter commented on Jul 9, 2014

    @nwinter
    ContributorAuthor

    Yes, that should work (as long as none of the components conflict with each other so horribly as to break the level–I think they won't, but not sure).

  3. nemoyatpeace commented on Jul 11, 2014

    @nemoyatpeace
    Contributor

    So, I have completed most of the snippets and python documentation with the exception of the programming.UsesXYZ components as the methods and properties for these components are not the same in different languages. Not sure how to work with that.

  4. nwinter commented on Jul 11, 2014

    @nwinter
    ContributorAuthor

    We could leave them for now, or we could document them using code-language-specific syntax, because actually it's mostly just the JavaScript builtins which are available regardless of language.

  5. reesylou commented on Jun 8, 2017

    @reesylou

    I have added Lua to most of the Snippets, and am gradually working through the other items. Is the spreadsheet still used/up to date?

  6. nwinter commented on Jun 8, 2017

    @nwinter
    ContributorAuthor

    Thanks @reesylou! The spreadsheet isn't up-to-date, so the latest state of what has property documentation and snippets is just going to be the Components themselves in the level editor. Most of the important ones are present in my test level, https://direct.codecombat.com/editor/level/items.

  7. reesylou commented on Jun 9, 2017

    @reesylou

    Since I am in checking them all, should those items already with Lua snippets using 'self' be changed to 'hero'? eg actions.Acts, isReady snippet is self:isReady("${1:cleave}")

  8. nwinter commented on Jun 9, 2017

    @nwinter
    ContributorAuthor

    Yes, and not just Lua, but the other languages, too. But it's not that big a deal, because we automatically convert to the new hero format on the front-end in absence of writing some code to do the data migration in the backend: https://github.com/codecombat/codecombat/blob/master/app/views/play/level/tome/editor/autocomplete.coffee#L285-L293

  9. reesylou commented on Jun 10, 2017

    @reesylou

    Did a heap of component patches, but wasn't logged in... so all those seemingly random Lua additions and changing self to hero patches were me in case you wondered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions