Steps:
- install marked
npm install marked
- create a helper
import { marked } from 'marked';
Steps:
npm install marked
import { marked } from 'marked';
| #!/bin/bash | |
| # 获取第一个参数 | |
| ARG1="$1" | |
| ROOT_FOLDER="" | |
| SCRIPT_NAME="$0" | |
| SCRIPT_VERSION="1.2.3" | |
| VERSION="" | |
| WEB_FOLDER="" | |
| ORG_INDEX_FILE="index.original.html" | |
| INDEX_FILE="index.html" |
| // JavaScript 根据需要动态加载脚本并设置参数 | |
| // refer to https://xmanyou.com/javascript-dynamically-load-script-and-set-parameters/ | |
| async function loadJsAsync(src:string, async:boolean=false, options?:any) { | |
| return new Promise<void>((resolve, reject) => { | |
| const script = document.createElement('script'); | |
| script.src = src; | |
| script.async = async; | |
| if(options) { | |
| for(const key in options) { | |
| // script[key] = options[key]; |
| // TypeScript/JavaScript 异步等待方法的实现 | |
| // refer to https://xmanyou.com/javascript-wait-until-condition-meet-or-timeout/ | |
| function waitUntil(condition:()=>boolean, timeout?:number, interval?:number) { | |
| if (timeout === void 0) { timeout = 0; } // if not set, wait forever | |
| if (interval === void 0) { interval = 50; } // default interval = 50ms | |
| let waitHandler; | |
| let timeoutHandler; | |
| return new Promise<void>(function (resolve, reject) { | |
| var waitFn = function () { | |
| if (condition()) { |
| function tryCreateShortcutAsync(){ | |
| if(!FBInstant){ | |
| console.info("FBInstant Not Available"); | |
| return; | |
| } | |
| console.info("Try Create shortcut"); | |
| FBInstant.canCreateShortcutAsync() | |
| .then(function(canCreateShortcut) { |
| defaultConfig { | |
| applicationId "com.xmanyou.my.game" | |
| minSdkVersion 21 | |
| targetSdkVersion 30 | |
| versionCode 28 | |
| versionName "1.2.5" | |
| def gitCommit = "git rev-parse --short HEAD".execute().text.trim() | |
| archivesBaseName = "${defaultConfig.applicationId}-${defaultConfig.versionName}v${defaultConfig.versionCode}-${gitCommit}" | |
| println 'outputFileName: after = ' + archivesBaseName |
| module SdkHelper{ | |
| export class IronSourceHelper{ | |
| public static ironsource:Laya.IPlatformClass; | |
| public static init(){ | |
| if(!this.ironsource){ | |
| this.ironsource = Laya.PlatformClass.createClass("sdkhelper.IronSourceHelper"); | |
| } | |
| let js1 = `window["IronSourceHelper"].onInterstitialReadyChange(%s)`; |
| // https://xmanyou.com | |
| // in app gradle file | |
| android { | |
| // ... | |
| compileOptions { | |
| sourceCompatibility JavaVersion.VERSION_1_8 | |
| targetCompatibility JavaVersion.VERSION_1_8 | |
| } | |
| } |
| package sdkhelper; | |
| import android.content.Context; | |
| import android.util.Log; | |
| import com.adjust.sdk.Adjust; | |
| import org.json.JSONObject; | |
| import java.util.ArrayList; |
| // 影子工作室为你提供详细步骤 https://xmanyou.com/cocos-creator-open-file-box/ | |
| const {ccclass, property} = cc._decorator; | |
| @ccclass | |
| export default class FileBox extends cc.Component { | |
| // LIFE-CYCLE CALLBACKS: | |
| @property | |
| containerId = "_filebox_container_"; | |
| @property |