Giter Site home page Giter Site logo

codex-server's Introduction

Codex Server

Codex is a markdown wiki server with mathjax and syntax highlighting.

How it works

The codex server works as web server for local files inside a directory and its subdirectories. Codex will render each filetype with a nice customizable webpage template.

Configuration

To quickly create a new configuration file, run the command codex create config. This will create the file .codex-data/config/default.json and add a basic configuration:

{
    "server-title" : "Untitled Codex",
    "views-path" : "/Users/james/dev/codex/codex-classic-theme/views/",
    "modules" : [
      {
        "name" : "codex-classic-theme",
        "module" : "../codex-classic-theme"
      }
    ]
}

Starting

To start the server, navigate to the root folder of your file hierarchy and run the command: codex start to start the program.

Press Ctrl + c to stop the process.

Templates

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:

  • 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.
  • error-404.html - A basic error page template.

Restarting the server is not required when changing templates.

Development

Details and ideas about the development of codex-server.

Resources

Codex Server – create by James Peret – 2017

codex-server's People

Contributors

jamesperet avatar

Stargazers

 avatar

Watchers

 avatar  avatar

codex-server's Issues

Use template-literal instead of EJS

Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.

It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS 😀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.