Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions scripts/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// -*- mode: javascript; js-indent-offset: 2; -*-

if (typeof bd=="undefined") {
bd={};
}
Expand All @@ -24,7 +26,7 @@ bd.util.ajaxPost = function(url,params,callback, callbackError){
}
}
http.send(params);
}
};

bd.util.ajaxGet = function(url, callback, callbackError){
var xmlhttp;
Expand All @@ -46,7 +48,7 @@ bd.util.ajaxGet = function(url, callback, callbackError){
xmlhttp.open("GET",url,true);
xmlhttp.send();

}
};

bd.util.getURLParamValue = function(name){

Expand All @@ -59,4 +61,42 @@ bd.util.getURLParamValue = function(name){
} else {
return results[1];
}
}
};

(function() {
if (window.location.search != "") {
var match = /[?&]locale=([^?&]*)/.exec(window.location.search);
if (match) {
var target = match[1].toLowerCase();
var parts = window.location.pathname.split('.');
if (parts.length == 2) {
if (target.indexOf('en') == 0) {
// Already at the English version
return;
}
parts.splice(1, 0, target);
} else if (parts.length == 3) {
if (parts[1] == target) {
// Already here
return;
} else if (target.indexOf('en') == 0) {
// English doesn't have a language tag in the name
parts.splice(1, 1);
} else {
parts[1] = match[1].toLowerCase();
}
} else {
return;
}
var newpath = parts.join('.');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
window.location.pathname = newpath;
}
};
xhr.open('HEAD', newpath);
xhr.send();
}
}
})();
155 changes: 155 additions & 0 deletions yr/tutorials/markdown-tutorial.zh_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
title: App Inventor教程创作
layout: tutorial
---

# App Inventor教程创作

## 介绍

您可以使用Markdown编写App Inventor教程。 本文档简要介绍了如何使用Markdown创建教程。

## 创建标题

手风琴由1级标题组成。 您可以通过两种不同的方式进行指示:

```markdown
# 标头
```

要么

```markdown
标头
===
```

## 创建教程页面

通过在1级标题下创建2级标题来添加教程页面:

```markdown
# 标头

## 第1页标题

第1页内容

## 第2页标题

第2页内容
```

如果您喜欢标题的下划线方法,则可以使用`-`:

```markdown
标头
===

第1页标题
---

第1页内容

第2页标题
---

第2页内容
```

## 添加方法

对于包含有关连接随播广告的信息的教程,您可以使用此技术添加操作方法:

```markdown
# 连接到应用

<howto id="connect_app"></howto>
```

## 添加提示

您可以使用以下技术向本教程添加提示:

```markdown
<hint markdown="block" title="给我一个提示">

提示内容

</hint>
```

您还可以嵌套提示:

```markdown
<hint markdown="block" title="给我一个提示">

提示内容

<hint markdown="block" title="检查我的解决方案">

解决方案内容

</hint>

</hint>
```

## 有序列表

有序列表是使用数字创建的:

```markdown
1. 项目1
2. 项目2
3. 项目3
```

如果您需要更多高级功能(例如起始值),则还可以使用HTML:

```markdown
<ol start="4">
<li>项目4</li>
<li>项目5</li>
</ol>
```

## 无序列表

通过使用某些符号(如项目符号)来使用无序列表:

```markdown
* 第一
* 第二
* 第三
```

您还可以嵌套列表:

```markdown
* 第一
* 子项目
* 子项目
* 子项目
* 第二
```

## 链接和图片

通过将链接的文本放在方括号 `[]` 中并将链接目标放在括号 `()` 中来创建链接:

```markdown
[转到App Inventor](http://ai2.appinventor.mit.edu)
```

要创建图像,请使用链接语法并将感叹号(!)放在前面:

```markdown
![辅助功能的替代文字)(http://link/to/image.png)
```

如果要制作图像以便放大图像,请在图像包含文本的末尾添加 `{:.enlargeImage}`。

```markdown
![大形象](image.png){:.enlargeImage}
```