Sfoglia il codice sorgente

docs(server): Work on presentation of config options

Michael Bromley 7 anni fa
parent
commit
a817ac16e9

+ 8 - 4
docs/assets/styles/_markdown.scss

@@ -1,6 +1,6 @@
 @import 'variables';
 @import 'variables';
 
 
-$block-border-radius: 0.15rem;
+$block-border-radius: 4px;
 
 
 .markdown {
 .markdown {
     line-height: 1.7;
     line-height: 1.7;
@@ -49,11 +49,9 @@ $block-border-radius: 0.15rem;
 
 
     code {
     code {
         font-family: 'Oxygen Mono', monospace;
         font-family: 'Oxygen Mono', monospace;
-    }
-
-    p code {
         padding: 0 $padding-4;
         padding: 0 $padding-4;
         background: $gray-100;
         background: $gray-100;
+        color: darken($brand-color, 30%);
         border-radius: $block-border-radius;
         border-radius: $block-border-radius;
     }
     }
 
 
@@ -63,6 +61,12 @@ $block-border-radius: 0.15rem;
         border-radius: $block-border-radius;
         border-radius: $block-border-radius;
         font-size: $font-size-14;
         font-size: $font-size-14;
         overflow-x: auto;
         overflow-x: auto;
+
+        code {
+            color: $gray-200;
+            background: none;
+            padding: none;
+        }
     }
     }
 
 
     blockquote {
     blockquote {

+ 20 - 0
docs/assets/styles/_shortcodes.scss

@@ -1,5 +1,8 @@
 @import "variables";
 @import "variables";
 
 
+/**
+ Alert
+ */
 .alert {
 .alert {
     border: 1px solid;
     border: 1px solid;
     border-radius: 2px;
     border-radius: 2px;
@@ -10,3 +13,20 @@
     &.warning { border-color: $color-warning; background: transparentize($color-warning, 0.9); }
     &.warning { border-color: $color-warning; background: transparentize($color-warning, 0.9); }
     &.success { border-color: $color-success; background: transparentize($color-success, 0.9); }
     &.success { border-color: $color-success; background: transparentize($color-success, 0.9); }
 }
 }
+
+/**
+ Config option
+ */
+.config-option-info {
+    display: flex;
+    margin-top: -16px;
+
+    .type, .default {
+        margin-right: 12px;
+    }
+    .label{
+        display: inline-block;
+        color: $gray-700;
+    }
+
+}

+ 6 - 2
docs/content/docs/configuration/config-auth-options.md

@@ -8,6 +8,7 @@ weight: 1
 The `AuthOptions` define how authentication is managed.
 The `AuthOptions` define how authentication is managed.
 
 
 ## tokenMethod
 ## tokenMethod
+{{< config-option type="'cookie' | 'bearer'" default="'cookie'" >}}
 
 
 Sets the method by which the session token is delivered and read.
 Sets the method by which the session token is delivered and read.
 
 
@@ -15,18 +16,21 @@ Sets the method by which the session token is delivered and read.
 * "bearer": Upon login, the token is returned in the response and should be then stored by the client app. Each request should include the header "Authorization: Bearer <token>".
 * "bearer": Upon login, the token is returned in the response and should be then stored by the client app. Each request should include the header "Authorization: Bearer <token>".
 
 
 ## sessionSecret
 ## sessionSecret
+{{< config-option type="string" default="'session-secret'" >}}
 
 
 The secret used for signing the session cookies for authenticated users. Only applies when tokenMethod is set to "cookie". In production applications, this should not be stored as a string in source control for security reasons, but may be loaded from an external file not under source control, or from an environment variable, for example.
 The secret used for signing the session cookies for authenticated users. Only applies when tokenMethod is set to "cookie". In production applications, this should not be stored as a string in source control for security reasons, but may be loaded from an external file not under source control, or from an environment variable, for example.
 
 
 ## authTokenHeaderKey
 ## authTokenHeaderKey
+{{< config-option type="string" default="'vendure-auth-token'" >}}
 
 
-Sets the header property which will be used to send the auth token when using the "bearer" method. Defaults to "vendure-auth-token".
+Sets the header property which will be used to send the auth token when using the "bearer" method.
 
 
 ## sessionDuration
 ## sessionDuration
+{{< config-option type="string | number" default="'7d'" >}}
 
 
 Session duration, i.e. the time which must elapse from the last authenticted request after which the user must re-authenticate. 
 Session duration, i.e. the time which must elapse from the last authenticted request after which the user must re-authenticate. 
 
 
-Expressed as a string describing a time span per [zeit/ms](https://github.com/zeit/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`. Defaults to `"7d"`.
+Expressed as a string describing a time span per [zeit/ms](https://github.com/zeit/ms.js). Eg: `60`, `"2 days"`, `"10h"`, `"7d"`.
 
 
 ## requireVerification
 ## requireVerification
 
 

+ 5 - 6
docs/content/docs/getting-started.md

@@ -12,16 +12,15 @@ weight: 0
  
  
 ## Installation
 ## Installation
 
 
-The following instructions describe how to run a development instance of Vendure using ts-node and a MySQL / MariaDB server
+The following instructions describe how to run a development instance of Vendure using ts-node and SQLite.
 
 
 ### Set up the database
 ### Set up the database
 
 
-You'll need a database server available from your local machine. For example, [this MariaDB & phpMyAdmin Docker image](https://github.com/bitnami/bitnami-docker-phpmyadmin) can be used. Create a new database and name it e.g. "vendure".
-
-You'll also need a driver for Vendure to connect to the database. In this case, the `mysql` package.
+You'll need a database to store your shop data. The simplest way to try out Vendure is to use SQLite, since it does not 
+require a separate database server to work.
 
 
 ```bash
 ```bash
-$ npm install mysql --save
+$ npm install sqlite3
 ```
 ```
 
 
 ### Install ts-node
 ### Install ts-node
@@ -35,7 +34,7 @@ $ npm install --save-dev ts-node
 ### Install Vendure
 ### Install Vendure
 
 
 ```bash
 ```bash
-$ npm install --save @vendure/core
+$ npm install @vendure/core
 ```
 ```
 
 
 ### Initialize with the Vendure CLI
 ### Initialize with the Vendure CLI

+ 10 - 0
docs/layouts/shortcodes/config-option.html

@@ -0,0 +1,10 @@
+<div class="config-option-info">
+    <div class="type">
+        <div class="label">type:</div>
+        <code>{{ .Get "type" }}</code>
+    </div>
+    <div class="default">
+        <div class="label">default:</div>
+        <code>{{ .Get "default" }}</code>
+    </div>
+</div>