File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ## Help Annotation
2+ The //% helper annotation links an exported function to a runtime helper in a namespace,
3+ so calls to the exported function are replaced with the helper’s implementation at compile time.
4+
5+ ## Dealing with Help
6+ 1 . Make sure you first write ` github: ` , so MakeCode knows to fetch a repository on GitHub
7+ 2 . Write the repository's name ** without any spaces after writing the colon**
8+ 3 . Add a slash command to tell the compiler to read a specific file in the repository
9+ 4 . If it is a folder in a repository, write the folder's name and then another slash command
10+ 5 . Finally, add the file's name (** the file's path must be right or it will not be load** )
11+ 6 . Also, make sure to ** not** add .md in the end of the file path because MakeCode already reads doc files as markdown files.
12+
13+ Here is a snippet showing how to use the helper annotation correctly.
14+ ``` ts
15+ // % help=github:pxt-hardware-programming-docs/docs/_getFactoryInstance
16+ function _getFactoryInstance() { }
17+ _getFactoryInstance ()
18+ ```
You can’t perform that action at this time.
0 commit comments