Welcome to Transcrypt's documentation!¶
Can't find what you're looking for? The on-line version of this documentation is frequently updated, reflecting the newest features and troubleshooting procedures.
Table of Contents:¶
- 1. Transcrypt: what and why
- 2. Getting started
- 3. Special facilities
- 3.1. Transcrypt's module mechanism
- 3.2. Using browser stubs to test non-GUI code that uses console.log and window.alert
- 3.3. Creating JavaScript objects with __new__ (<constructor call>)
- 3.4. Identifier aliasing: __pragma__ ('alias', ...) and __pragma__ ('noalias', ...)
- 3.5. Preventing target annotation: __pragma__ ('noanno')
- 3.6. Surpassing the speed of native JavaScript: __pragma__ ('fcall') and __pragma ('nofcall')
- 3.7. Automatic conversion to iterable: __pragma__ ('iconv') and __pragma__ ('noiconv')
- 3.8. Conditional compilation: __pragma__ ('ifdef', <symbol>), __pragma__ ('ifndef', <symbol>), __pragma__ ('else') and __pragma__ ('endif')
- 3.9. Inserting literal JavaScript: __pragma__ ('js', ...) and __include__ (...)
- 3.10. Keeping your code lean: __pragma__ ('kwargs') and __pragma__ ('nokwargs')
- 3.11. Operator overloading: __pragma__ ('opov') and __pragma__ ('noopov')
- 3.12. Skipping fragments while generating code : __pragma__ ('skip') and __pragma__ ('noskip')
- 3.13. Automatic conversion to truth value: __pragma__ ('tconv') and __pragma__ ('notconv')
- 4. Tutorials
- 5. Systematic code examples: a guided tour of Transcrypt
- 5.1. Arguments: **kwargs, *args, defaults, at call and def time, also for lambda's
- 5.2. Accessing attributes by name: getattr, setattr, hasattr
- 5.3. Classes: multiple inheritance and assignment of bound functions
- 5.4. Complex numbers: Python's builtin complex datatype
- 5.5. Conditional expressions: simple and nested
- 5.6. Control structures: for...else, while...else, if...elif...else, break, continue
- 5.7. Data structures: tuple, list, dict, set
- 5.8. Decorators: function and class, with and without parameters
- 5.9. Dict comprehensions
- 5.10. Diverse fixes
- 5.11. Diverse pulls
- 5.12. Dictionaries: dict revisited
- 5.13. Exceptions: exception class hierarchy, finally
- 5.14. Extended slices: facilitating NumScrypt and such
- 5.15. General functions: sort and sorted
- 5.16. Indices and slices: LHS, RHS, basic and extended
- 5.17. Iterators and generators
- 5.18. Lambda functions with all types of args
- 5.19. List comprehensions: multi-loop and nested with multiple if's
- 5.20. Local classes: inside other classes and functions
- 5.21. Module builtin: a small part of it demo'ed
- 5.22. Module cmath: allmost all of Python's cmath module
- 5.23. Module itertools: allmost all of Python's itertools module
- 5.24. Module math: allmost all of Python's math module
- 5.25. Module random: most important functions of Python's random module
- 5.26. Modules: hierarchical, both local to the project and global url-based
- 5.27. Nonlocals
- 5.28. Operator overloading
- 5.29. Properties
- 5.30. Set comprehensions
- 5.31. Simple and augmented assignment
- 5.32. Truthyness: optional Python-style evaluation of truthyness, falsyness and non-empty container selection
- 5.33. Tuple assignment: recursive and in for-headers using enumerate
- 6. Seamless interoperation with the DOM
- 7. Mixed examples
- 7.1. Three ways of integration with JavaScript libraries
- 7.2. Example: Pong
- 7.3. Joined minification
- 7.4. Example: jQuery
- 7.5. Example: iOS web app with native look and feel
- 7.6. Example: D3.js
- 7.7. Example: React
- 7.8. Example: Riot
- 7.9. Example: Using input and print in a DOM __terminal__ element in your browser
- 8. Autotesting Transcrypt code
- 9. The philosophy behind Transcrypt and its impact on design decisions