Readme templating docs

James Peret 6 years ago
parent
commit
0eac3d3519
2 changed files with 18 additions and 3 deletions
  1. 1 1
      package.json
  2. 17 2
      readme.md

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "name": "@jamesperet/codex-server",
3
-  "version": "0.0.4",
3
+  "version": "0.1.0",
4 4
   "description": "A node file server with super powers.",
5 5
   "main": "index.js",
6 6
   "scripts": {

+ 17 - 2
readme.md

@@ -1,11 +1,26 @@
1 1
 # Codex Server
2 2
 
3
-*Create by James Peret*
4
-
5 3
 Codex is a markdown wiki server with mathjax and syntax highlighting.
6 4
 
5
+### How it works
6
+
7
+The codex server works as web server for local files inside a directory and its subdirectorys. Codex will render each filetype with a nice customizable webpage template.
8
+
7 9
 ### Starting
8 10
 
9 11
 To start the server, navigate to the root folder of your file hierarchy and run the command: ```codex``` to start the program.
10 12
 
11 13
 Press ```Ctrl + c``` to stop the process.
14
+
15
+### Templating
16
+
17
+For nice looking pages, you will need to place a templates folder called ```views/``` in the root of your hierarchy. In this folder place ```.html``` or ```.ejs``` files for each type of template:
18
+
19
+- ```index.html``` - This is the main template for rendering most pages (like markdown). Add ```<%- body %>``` somewhere in this file for rendering content passed from codex.
20
+- ```error-404.html``` - A basic error page template.
21
+
22
+Restarting the server is not required when changin templates.
23
+
24
+---
25
+
26
+*Codex Server – create by James Peret – 2017*