Giter Site home page Giter Site logo

xeronith / matrix-doc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matrix-org/matrix-spec-proposals

0.0 1.0 0.0 12.14 MB

Matrix Documentation (including The Spec)

License: Apache License 2.0

JavaScript 58.07% CSS 11.94% HTML 0.07% Python 21.51% Shell 0.28% Go 5.04% Perl 3.05% Nix 0.03%

matrix-doc's Introduction

This repository contains the Matrix specification.

If you want to ask more about the specification, join us on #matrix-dev:matrix.org.

We welcome contributions to the spec! See the notes below on Building the specification, and CONTRIBUTING.rst to get started making contributions.

Note that the Matrix Project lists, which were previously kept in this repository, are now in https://github.com/matrix-org/matrix.org.

Structure of this repository

  • api : OpenAPI (swagger) specifications for the the HTTP APIs.
  • attic: historical sections of specification for reference purposes.
  • changelogs: change logs for the various parts of the specification.
  • drafts: Previously, contained documents which were under discussion for future incusion into the specification and/or supporting documentation. This is now historical, as we use separate discussion documents (see CONTRIBUTING.rst).
  • event-schemas: the JSON Schema for all Matrix events contained in the specification, along with example JSON files.
  • meta: documents outlining the processes involved when writing documents, e.g. documentation style, guidelines.
  • scripts: scripts to generate formatted versions of the documentation, typically HTML.
  • specification: the specification split up into sections.

Building the specification

The Matrix Spec is generated by a set of scripts, from the RST documents, API specs and event schemas in this repository.

Preparation

To use the scripts, it is best to create a Python 3.4+ virtualenv as follows:

virtualenv -p python3 env
env/bin/pip install -r scripts/requirements.txt

(Benjamin Synders has contributed a script for Nix users, which can be invoked with nix-shell scripts/contrib/shell.nix.)

Generating the specification

To rebuild the specification, use scripts/gendoc.py:

source env/bin/activate
./scripts/gendoc.py

The above will write the rendered version of the specification to scripts/gen. To view it, point your browser at scripts/gen/index.html.

Windows users

The source program does not exist on Windows, so instead run one of the activate files in .\env\Scripts\ to activate the virtual environment.

If you're on Windows Vista or higher, be sure that the "Symbolic Links" option was selected when installing Git prior to cloning this repository. If you're still seeing errors about files not being found it is likely because the symlink at api/client-server/definitions/event-schemas looks like a file. To correct the problem, open an Administrative/Elevated Command Prompt in your cloned matrix-doc directory and run the following:

cd api\client-server\definitions
del event-schemas
mklink /D event-schemas "..\..\..\event-schemas"

This will delete the file and replace it with a symlink. Git should not detect this as a change, and you should be able to go back to building the project.

Generating the OpenAPI (Swagger) specs

Swagger is a framework for representing RESTful APIs. We use it to generate interactive documentation for our APIs.

Before the Swagger docs can be used in the Swagger UI (or other tool expecting a Swagger specs, they must be combined into a single json file. This can be done as follows:

source env/bin/activate
./scripts/dump-swagger.py

By default, dump-swagger will write to scripts/swagger/api-docs.json.

To make use of the generated file, there are a number of options:

Continuserv

Continuserv is a script which will rebuild the specification every time a file is changed, and will serve it to a browser over HTTP. It is intended for use by specification authors, so that they can quickly see the effects of their changes.

It is written in Go, so you will need the go compiler installed on your computer. You will also need to install fsnotify by running:

go get gopkg.in/fsnotify/fsnotify.v1

Then, create a virtualenv as described above under Preparation, and:

source env/bin/activate
go run ./scripts/continuserv/main.go

You will then be able to view the generated spec by visiting http://localhost:8000/index.html.

Issue tracking

Issues with the Matrix specification are tracked in GitHub.

See meta/github-labels.rst for notes on what the labels mean.

matrix-doc's People

Contributors

anoadragon453 avatar ara4n avatar babolivier avatar benparsons avatar cadair avatar clokep avatar dbkr avatar deepbluev7 avatar erikjohnston avatar half-shot avatar illicitonion avatar jimmycuadra avatar jryans avatar kegsay avatar kitsuneral avatar leonerd avatar lucavb avatar manuroe avatar negativemjark avatar neilisfragile avatar oddvar avatar ralith avatar reivilibre avatar richvdh avatar sorunome avatar t3chguy avatar tulir avatar turt2live avatar uhoreg avatar zil0 avatar

Watchers

 avatar

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.