Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 9d1d62f

Browse files
livecodealilivecodeali
authored andcommitted
[[ Guides ]] Fix some guide formatting
1 parent 7bfd520 commit 9d1d62f

9 files changed

Lines changed: 472 additions & 240 deletions

docs/guides/HTML5 Deployment.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Introduction
1+
# HTML5 Deployment
2+
3+
## Introduction
24

35
**Note: This is an experimental release of HTML5 deployment support and is not recommended for production use.**
46

@@ -38,9 +40,9 @@ Two important unsupported features are unlikely to be added in the near future:
3840
(e.g. `wait 10`)
3941
* externals (including revdb)
4042

41-
# How to deploy an app to HTML5
43+
## How to deploy an app to HTML5
4244

43-
## Step by step
45+
### Step by step
4446

4547
Deploying an app to an HTML5 standalone is straightforward:
4648

@@ -58,7 +60,7 @@ Deploying an app to an HTML5 standalone is straightforward:
5860

5961
Your application will be packaged up and placed in the selected output folder.
6062

61-
## Contents of the HTML5 standalone
63+
### Contents of the HTML5 standalone
6264

6365
The HTML5 standalone contains four files:
6466

@@ -68,7 +70,7 @@ The HTML5 standalone contains four files:
6870

6971
* A test HTML page. This can be opened in a browser and will correctly prepare, download and start your HTML5 app in a convenient test environment.
7072

71-
## Testing your HTML5 app with a local web server
73+
### Testing your HTML5 app with a local web server
7274

7375
Some browsers, such as Google Chrome, do not permit pages to download resources from `file://` URLs. You won't be able to test your application in these browsers unless you run a local HTTP server.
7476

@@ -78,11 +80,11 @@ A quick and easy way to run a simple local HTTP server is to use Python. Open a
7880

7981
This will let you access your standalone by opening your web browser and visiting <http://localhost:8080>.
8082

81-
# Reporting bugs
83+
## Reporting bugs
8284

8385
Please report bugs to the [LiveCode Quality Centre](http://quality.livecode.com/). Make sure to select "HTML5 Standalone" when you're creating your bug report!
8486

85-
# Advanced: HTML5 standalone filesystem
87+
## Advanced: HTML5 standalone filesystem
8688

8789
JavaScript applications running in a browser don't have access to the host system's filesystem. Instead, the filesystem-related features of LiveCode, such as `open file`, use a virtual filesystem (VFS) that exists only in memory. This filesystem is initialised before the engine starts, and is reset and its content discarded when the engine stops (when the user closes the browser view or navigates to a different page).
8890

@@ -100,11 +102,11 @@ There are several special files & directories in the `/boot/` directory:
100102

101103
In general, if you wish to add new files or directories to the `standalone.zip` archive, it is best to add them outside the `/boot/` directory tree.
102104

103-
# Advanced: Embedding an HTML5 standalone in a web page
105+
## Advanced: Embedding an HTML5 standalone in a web page
104106

105107
The default HTML5 page provided by the HTML5 standalone builder is designed for testing and debugging purposes. However, you may want to embed the standalone engine in a more visually appealing page. To do this, you require three elements: 1) a canvas, 2) a JavaScript `Module` object, and 3) an HTML `<script>` element that downloads the engine.
106108

107-
## The canvas
109+
### The canvas
108110

109111
The engine renders into a HTML5 `<canvas>` element. There are three important considerations when creating the canvas:
110112

@@ -120,7 +122,7 @@ The absolute minimum canvas element would look something like this:
120122

121123
By default, most web browsers will indicate when the canvas has focus by displaying a highlighted outline. This helps users identify which part of the web page is capturing their key presses. You can usually disable this outline by adding `outline: none;` to the canvas's CSS styles.
122124

123-
## The Module object
125+
### The Module object
124126

125127
The top-level JavaScript `Module` object contains the parameters that control how the engine runs. At minimum, you need only specify the `Module.canvas`, which should be your canvas element.
126128

@@ -132,7 +134,7 @@ The absolute minimum `Module` object declaration would look something like:
132134
};
133135
</script>
134136

135-
## Engine download
137+
### Engine download
136138

137139
The engine is quite a large JavaScript file, so it's downloaded asynchronously in order to let the rest of the page finish loading and start being displayed.
138140

@@ -142,7 +144,7 @@ Quite straightforwardly:
142144

143145
Make sure to replace `<version>` as appropriate.
144146

145-
## Bringing it all together
147+
### Bringing it all together
146148

147149
Here's the complete skeleton web page for an HTML5 standalone:
148150

@@ -157,7 +159,7 @@ Here's the complete skeleton web page for an HTML5 standalone:
157159
</body>
158160
</html>
159161

160-
# Advanced: Speeding up engine download
162+
## Advanced: Speeding up engine download
161163

162164
Currently, the engine files are almost 30 MB, which is a lot to download before the engine can start. It is possible to speed up the download by enabling deflate compression in the web server configuration.
163165

@@ -166,7 +168,7 @@ Enabling deflate compression reduces the total download size to around 6.3 MB.
166168
* For the Apache web server, configure `mod_deflate` to serve [pre-compressed content](https://httpd.apache.org/docs/2.4/mod/mod_deflate.html#precompressed)
167169
* For the NGINX web server, add [`gzip_static on;`](https://www.nginx.com/resources/admin-guide/compression-and-decompression/#send) to your configuration.
168170

169-
# Advanced: Customizing the Module object
171+
## Advanced: Customizing the Module object
170172

171173
There are a number of LiveCode-specific `Module` attributes that you can modify to affect how the engine behaves:
172174

0 commit comments

Comments
 (0)