-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from ev3dev/rtfd
Setup readthedocs.org documentation
- Loading branch information
Showing
21 changed files
with
1,573 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ev3dev language bindings | ||
======================== | ||
|
||
This repository stores the utilities and metadata information for the | ||
ev3dev-lang family of libraries. These libraries are easy-to-use interfaces for | ||
the APIs that are available on `ev3dev`_-based devices. | ||
|
||
The complete documentation is hosted at http://ev3dev-lang.readthedocs.org. | ||
|
||
We support multiple libraries for various programming languages using a | ||
centralized "specification" which we keep updated as kernel changes are made. | ||
We don't have the actual library code here (see below) -- instead we use this | ||
repo to facilitate the maintenance of our bindings. | ||
|
||
We currently support libraries for the following languages: | ||
|
||
- `C++`_ | ||
- `Node.js`_ | ||
- `Python`_ | ||
|
||
Each binding is written based on our central spec, so each has a uniform | ||
interface which is kept close to the ev3dev API surface while still encouraging | ||
language-specific enhancements. | ||
|
||
.. _ev3dev: http://www.ev3dev.org | ||
.. _C++: https://github.com/ddemidov/ev3dev-lang-cpp | ||
.. _Node.js: https://github.com/wasabifan/ev3dev-lang-js | ||
.. _Python: https://github.com/rhempel/ev3dev-lang-python |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
Autogen scripts for ev3dev language bindings | ||
============================================ | ||
|
||
To help us maintain our language bindings, we have written a script to | ||
automatically update sections of code according to changes in our API | ||
specification. We define code templates using Liquid_, which are stored in the | ||
``templates`` folder with the ``.liquid`` extension. | ||
|
||
.. _Liquid: http://liquidmarkup.org | ||
|
||
Usage | ||
----- | ||
|
||
Prerequisites | ||
############# | ||
|
||
- Make sure that you have cloned the repo (including submodules) and ``cd``'d | ||
into the autogen directory | ||
- You must have Node.JS and ``npm`` installed | ||
- If you have not yet done so yet, run ``npm install`` to install the | ||
dependencies for auto-generation | ||
|
||
Running from the command line | ||
############################# | ||
|
||
If you run the script without any parameters, it will look for an | ||
``autogen-config.json`` file in your current working directory. The | ||
autogen-config file specifies the locations to look for templates and source | ||
files. | ||
|
||
.. code-block:: bash | ||
$ node path/to/autogen.js | ||
If you want to specify a config file manually, you can include use a full file | ||
path for the target JSON config file. | ||
|
||
.. code-block:: bash | ||
$ node path/to/autogen.js other/path/to/config.json | ||
How it works | ||
------------ | ||
|
||
Our script searches code files for comments that define blocks of code that it | ||
should automatically generate. The inline comment tags are formatted as follows | ||
(C-style comments): | ||
|
||
.. code-block:: cpp | ||
//~autogen test-template foo.bar>tmp | ||
... | ||
//~autogen | ||
After the initial declaration (``~autogen``), the rest of the comment defines | ||
parameters for the generation script. The first block of text up to the space | ||
is the file name of the template to use. The ``.liquid`` extension is | ||
automatically appended to the given name, and then the file is loaded and | ||
parsed. | ||
|
||
The rest of the comment is a space-separated list of contextual variables. The | ||
section before the ``>`` defines the source, and the section after defines the | ||
destination. The value from the source is copied to the destination, in the | ||
global Liquid context. This makes it possible to use a single template file to | ||
generate multiple classes. | ||
|
||
Implementation Notes | ||
-------------------- | ||
|
||
.. todo:: | ||
|
||
fill this up | ||
|
||
Contributing to the autogen script | ||
---------------------------------- | ||
|
||
Just as we welcome contributions to the language bindings in this repo, we love | ||
to have people update our infrastructure. If you want to make a contribution, | ||
here are some quick tips to get started developing. | ||
|
||
- After making a change, you should run the script and tell it to re-generate | ||
some files to make sure that your changes work as expected. | ||
- If you are making more extensive changes, it may be helpful to create a | ||
temporary regen group with some test files to be able to manually test any | ||
new features or modifications. | ||
- Although you can use any text editor, we recommend using | ||
`Visual Studio Code`_ to edit the autogen scripts. It has great autocomplete, | ||
and their debug GUI works well with node. | ||
|
||
.. _Visual Studio Code: https://code.visualstudio.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pre { | ||
box-shadow: 0px 1px 6px 0px lightgray; | ||
} | ||
|
||
dl.class { | ||
padding: 5px; | ||
box-shadow: 0px 1px 6px 0px lightgray; | ||
} | ||
|
||
pre { | ||
overflow: auto; | ||
word-wrap: normal; | ||
white-space: pre; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{# Import the theme's layout. #} | ||
{% extends "!page.html" %} | ||
|
||
{# Custom CSS overrides #} | ||
{% set bootswatch_css_custom = ['_static/custom.css'] %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../autogen/README.rst |
Oops, something went wrong.