diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-08-20 11:19:18 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-20 12:24:34 +0200 |
commit | cb73d0710b0eb84d4f788ff9b1d36ed0b02bf970 (patch) | |
tree | 7ae6a504b526d2068ebe209325dc360b4b26e655 /public/docs | |
parent | 4f709b04cee3ee9a1df009a8021b84d4f8fe6b81 (diff) | |
download | server-cb73d0710b0eb84d4f788ff9b1d36ed0b02bf970.tar.gz |
Use xmp tag for more docs.
Diffstat (limited to 'public/docs')
-rw-r--r-- | public/docs/install.html | 12 | ||||
-rw-r--r-- | public/docs/module.html | 12 | ||||
-rw-r--r-- | public/docs/production.html | 6 | ||||
-rw-r--r-- | public/docs/style.css | 5 |
4 files changed, 21 insertions, 14 deletions
diff --git a/public/docs/install.html b/public/docs/install.html index a448db8..1b227ba 100644 --- a/public/docs/install.html +++ b/public/docs/install.html @@ -40,9 +40,9 @@ npm install <p> Initialize the database: -<pre> -sqlite3 db < schema.sql -</pre> +<xmp> +sqlite3 db < schema.sql +</xmp> <h2> Install the modules @@ -62,9 +62,9 @@ git clone https://git.rally-the-troops.com/modules/field-cloth-gold public/field <p> Register it in the database: -<pre> -sqlite3 db < public/field-cloth-gold/title.sql -</pre> +<xmp> +sqlite3 db < public/field-cloth-gold/title.sql +</xmp> <h2> Start the server diff --git a/public/docs/module.html b/public/docs/module.html index d392b3e..c75020f 100644 --- a/public/docs/module.html +++ b/public/docs/module.html @@ -67,7 +67,8 @@ The game landing page on the server has a bit of text introducing the game, and <p>Put the about text in the about.html file. -<xmp><p> +<xmp> +<p> Dolorum fugiat dolor temporibus. Debitis ea non illo sed debitis cupiditate ipsum illo. Eos eos molestias illo quisquam dicta. @@ -87,7 +88,8 @@ However, if your game uses custom options these need to be added as form fields. <p> Add a create.html file to inject form fields into the create game page. -<xmp><p> +<xmp> +<p> Player count: <br> <select name="players"> @@ -113,7 +115,8 @@ Client HTML <p> The game needs a play.html file using the following template: -<xmp><!doctype html> +<xmp> +<!doctype html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, interactive-widget=resizes-content, viewport-fit=cover"> @@ -268,6 +271,9 @@ Either a list of roles, or a function returning a list of roles. Create the initial game object with a random number seed, scenario, and options object. <p> +The "setup" function takes three parameters provided by the server: the random seed (generated by the server when starting the game), the scenario (a string with the scenario name) and options (a plain javascript object with key/value pairs for the options chosen by the user when creating the game). + +<p> The options object is filled in with values from the create.html form fields. <h3> exports.view = function (game, player) </h3> diff --git a/public/docs/production.html b/public/docs/production.html index abb0b7c..2cb82a0 100644 --- a/public/docs/production.html +++ b/public/docs/production.html @@ -50,7 +50,7 @@ Customize settings <p> The server reads its settings from the .env file. -<pre> +<xmp> NODE_ENV=production SITE_NAME=Example @@ -61,7 +61,7 @@ HTTP_HOST=localhost HTTP_PORT=8080 # Enable mail notifications -MAIL_FROM=Example Notifications <notifications@example.com> +MAIL_FROM=Example Notifications <notifications@example.com> MAIL_HOST=localhost MAIL_PORT=25 @@ -70,7 +70,7 @@ WEBHOOKS=1 # Enable forum FORUM=1 -</pre> +</xmp> <h2> Expose the server to the internet diff --git a/public/docs/style.css b/public/docs/style.css index a7bc776..845f9e3 100644 --- a/public/docs/style.css +++ b/public/docs/style.css @@ -13,8 +13,9 @@ h1 { font-size: 1.8rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.2rem; } p, ul, ol, dl, figure, blockquote, xmp, pre, table { margin: 1rem 0; font-size: 1rem; } -xmp, pre { font-size: 0.8rem; padding: 1rem 1rem; } -tt, code, kbd { font-size: 0.8rem; } +xmp, pre, tt, code, kbd { font-size: 0.8rem; } +pre { padding: 1rem; } +xmp { padding: 0rem 1rem 1rem 1rem; } kbd { background-color: whitesmoke; padding: 0px 4px; border: 1px solid #444; } dd { margin-bottom: 0.5rem; } |