Skip to content

Auto compiles .pyj files or rapydscript code on webpage to javascript

Notifications You must be signed in to change notification settings

adousen/RapydScript-pyjTransformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pyjTransformer for RapydScript

Doc

pyjTransformer.js is modified from the JSXTransformer in ReactJS.

Functionality:

  1. Auto compiles .pyj files or rapydscript code on webpage to javascript in browser.
  2. Run RapydScript with external framework, such as jQuery, AngularJS, ReactJS and so on.

NOTE: To run rapydscript correctly in browser with AngularJS(ensure that rapydscript compiles an executes before it), you should set attributes async="false" in the <script> tag.

To run it right with ReactJS, you should also set attributes async="false" in the <script> tag, and set otype="text/jsx" .

Example:

<script type="text/pyj" otype="text/jsx" src="helloworld.pyj" async="false"></script>

RapydScript introduction

Rapydscript is a pre-compiler for JavaScript, similar to CoffeeScript, but with cleaner, more readable python-like syntax.

links

demo

others

说明文档(中文)

pyjTransformer.js 的代码是从ReactJS中的 JSXTransformer 改的。

实现的功能:

  1. 自动将浏览器中的.pyj文件或页面上的RapydScript代码编译成javascript代码。
  2. 可以与jQuery、AngularJS、ReactJS等外部框架共同工作。

注意: 要使RapydScript在浏览器中与AngularJS正确地工作(即保证rapydscript代码的编译和运行在AngularJS之前),你需要在 <script> 中添加属性 async="false"

要使RapydScript与ReactJS正常工作,你需要在 <script> 中添加属性 async="false" ,以及添加属性 otype="text/jsx"

示例:

<script type="text/pyj" otype="text/jsx" src="helloworld.pyj" async="false"></script>

RapydScript简介

RapydScript是一个可以被预编译为JavaScript的脚本语言。 RapydScript与CoffeeScript很相似,但是由于它采用的是Python的语法,因而更加容易阅读。

links

在线演示项目

相关项目

About

Auto compiles .pyj files or rapydscript code on webpage to javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages