tentative micro framework for a new website, potentially some day
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 14 Jan 2016 12:47:24 +0000 (13:47 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 14 Jan 2016 12:47:24 +0000 (13:47 +0100)
website/Makefile [new file with mode: 0644]
website/README.md [new file with mode: 0644]
website/index.md [new file with mode: 0644]
website/install.md [new file with mode: 0644]
website/meta.py [new file with mode: 0755]

diff --git a/website/Makefile b/website/Makefile
new file mode 100644 (file)
index 0000000..4ba3776
--- /dev/null
@@ -0,0 +1,60 @@
+########## contents
+ALL_MDS = $(shell git ls-files | grep '\.md$$')
+PUBLISH_PATH = /var/www/html/nepi
+
+#ALL_PLUGINS = plugins/*.{js,css,html}
+
+########## default target
+all: preview
+
+preview: prepare index meta convert 
+# this is what is invoked by restart-website.sh that is crontab'ed
+install: preview publish
+
+.PHONY: all preview publish install prepare index meta convert 
+preview_and_nepiall: prepare index meta nepi_all convert 
+install_and_nepiall: preview_and_nepiall publish
+
+.PHONY: preview_and_nepiall install_and_nepiall
+
+########## global vars
+# I am using the custom-made 'nepi' layout
+# which was 'exported' (copied) from markdown-styles' 'bootstrap3' 
+
+LAYOUT = ./nepi-layout
+
+##########
+prepare:
+       @[ -d markdown ] || mkdir markdown
+       rsync -av --delete --relative $(ALL_MDS) markdown
+
+# index.py is hard-wired to output in markdown/
+index:
+       @[ -d markdown ] || mkdir markdown
+       export LC_ALL=en_US.UTF-8; ./index.py $(ALL_MDS)
+
+# likewise
+meta:
+       @[ -d markdown ] || mkdir markdown
+       ./meta.py
+
+################################
+
+# compile status informations  by Nepi check
+status:
+       @[ -d markdown ] || mkdir markdown
+       ./status.py
+
+convert: 
+       generate-md --layout $(LAYOUT) --input markdown --output html
+
+# default is ti publish locally as this runs right from r2lab.inria.fr
+publish:
+       rsync -av --delete html/ $(PUBLISH_PATH)/
+
+debug:
+       echo ALL_MDS=$(ALL_MDS)
+
+clean:
+       rm -rf markdown html
+
diff --git a/website/README.md b/website/README.md
new file mode 100644 (file)
index 0000000..d5b92f4
--- /dev/null
@@ -0,0 +1,5 @@
+This is an extremely rough draft of what could become the next iteration of the NEPI website. 
+
+No wiki (use markdown+git), no nonsense, no builtin code browsing or issue tracking either though.
+
+Inspired from the r2lab website.
\ No newline at end of file
diff --git a/website/index.md b/website/index.md
new file mode 100644 (file)
index 0000000..0f7a72b
--- /dev/null
@@ -0,0 +1,32 @@
+# NEPI: Network Experiment Programming Interface
+
+
+## What is NEPI ?
+NEPI is a Python-based library to model and run network experiments on a variety of network evaluation platforms, including PlanetLab, OMF wireless testbeds, ns-3 simulators, and others. It allows to specify resources to use in an experiment, to define experiment workflow constraints and to automate deployment, resource control and result collection.
+
+##Features
+
+ * Automatic experiment deployment
+ * Automatic result collection
+ * Interactive experimentation
+ * Hybrid experiments with multiple platforms
+ * Free open source license (GPLv2)
+ * Support for python2 and python3 (since NEPI 6.0)
+
+***
+
+## News - November 2015
+
+* NEPI is now numbered version 6, and can run under either python2 or python3.
+
+## News - June 2015
+
+* The reference for the NEPI codebase is no longer managed under mercurial, but under *git* together with other experimentation tools; for this reason it has been [moved to another location](http://git.onelab.eu/?p=nepi.git;a=summary) . Please [see this link](http://git.onelab.eu/?p=nepi.git;a=summary) if you need to browse history of changes made to the code.
+
+* Similarly, the [recommended way to install and upgrade nepi](https://pypi.python.org/pypi/nepi) is from now on based on `pypi` and `pip`.
+
+* Finally, all tarballs starting with release 3.2 have moved, and [can now be found here](http://build.onelab.eu/nepi).
+
+|[*Download*](http://build.onelab.eu/nepi/) | [*User Manual*](http://nepi.inria.fr/code/nepi/raw-file/43ae08ad10a3/doc/user_manual/user_manual.pdf) |[*Code Reference*](http://nepi.inria.fr/sphinx) |[*Bug Reporting*](http://nepi.inria.fr/bugzilla/) |
+|---|---|---|---|
+| Latest tarballs | NEPI explained | Classes &amp; Methods | Found a bug ? |
diff --git a/website/install.md b/website/install.md
new file mode 100644 (file)
index 0000000..51da5bc
--- /dev/null
@@ -0,0 +1,67 @@
+# How to install NEPI
+
+## Quick install
+
+The recommended way is to pull NEPI from the [python package index archive](pypi.python.org) using `pip`.
+
+    sudo pip install nepi
+    
+Most likely this is all you need to do to run simple scripts from the tutorials.
+
+Alternatively, you may specify a specific version number, e.g.:
+
+    sudo pip install nepi==6.0.4
+
+
+## Getting `pip`
+
+If you receive `command not found` when invoking `pip`, you will need to install this utility. Depending on your linux distribution, you can use
+
+* Fedora / RedHat / CentOS
+
+    `sudo yum install python-pip`
+    
+* Debian - ubuntu
+
+    `sudo apt-get install python-pip`
+
+## python2 *vs* python3
+
+If you want to use python3, depending on how your system is configured, you might need to invoke
+
+    sudo pip3 install nepi
+    
+and to `yum` or `apt-get` the `python3-pip` package instead.
+
+## More dependencies
+
+The following optional packages can be useful in some setups, but are not automatically pulled by `pip` because of their size and/or because they require additional binary tools in turn:
+
+* `sudo pip install matplotlib`
+* `sudo pip install pygraphviz`
+
+Of course, here again you might wish to use `pip3` instead.
+
+# Installing from sources
+
+Alternatives approaches, more suitable to developers, are as follows:
+
+* In order to install for all users:
+
+#
+    git clone git://git.onelab.eu/nepi.git
+    cd nepi
+    sudo make install
+    
+* And in order to use NEPI without installing:
+
+# 
+    git clone git://git.onelab.eu/nepi.git
+    cd nepi
+    export PYTHONPATH=$(pwd) 
+    cd somewhere_else
+    python3 your-script.nepi 
+    
+
+# Older sheet
+You can also see the [original installation sheet for NEPI 3](http://nepi.inria.fr/Install/WebHome)
\ No newline at end of file
diff --git a/website/meta.py b/website/meta.py
new file mode 100755 (executable)
index 0000000..321b3c0
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+
+import json
+import glob
+
+
+# I prefer writing python code rather than JSON natively
+# plus, this might be the place to inject subindexes for the tutorials page some day
+
+hard_wired_meta = {
+   # '*' means this is visible to all input files unless overridden
+   # in a more specific location
+   '*' : { 'logos_height': '18px'}
+   }
+
+title_header = 'title:'
+
+def tuto_contents(md):
+   """
+   input is a markdown filename
+   which is expected to define title:
+   output is a tuple (name, title)
+   with name having its '.md' removed
+   and title being said title
+   """
+   basename = md.replace('.md', '')
+   title = 'No title set'
+   with open(md) as input:
+      for line in input.readlines():
+         if line.startswith(title_header):
+            title = line[len(title_header):].strip()
+   return (basename, title)
+
+def main():
+
+   meta = hard_wired_meta
+   
+   # enrich it
+   # get the list of tutorials
+   tuto_files = glob.glob("tuto*.md")
+   # make sure the '*' key is present
+   wildcard = meta.setdefault('*', None)
+   wildcard['tutos'] = [ tuto_contents(tf) for tf in tuto_files]
+
+   # save
+   with open('markdown/meta.json', 'w') as output:
+      json.dump(meta, output)
+
+   
+if __name__ == '__main__':
+   main()