diff --git a/README.md b/README.md index a64436f75fdcd9991cba69e793914ca389c038eb..504603b2a4ce3a90fe48358862f2404f4636ddbc 100644 --- a/README.md +++ b/README.md @@ -2,68 +2,4 @@ This repository contains all presentations related to R3. -## Prerequisites - -In order to use the slide deck, you must have: - -- **git**: For convenience, have your SSH key configured on git-r3lab. [Here](https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html) is how to do it. -- **git-lfs**: Installation instructions are [here](https://help.github.com/en/articles/installing-git-large-file-storage) -- **Python 3**: It is recommend to use a virtual environment. Information on how to create a virtual environment is [here](https://virtualenvwrapper.readthedocs.io/en/latest/). -- **yarn**: Instructions are [here](https://yarnpkg.com/lang/en/docs/install) - -## How to get started - -- Fork this repository -- Clone your fork - ```bash - $ git clone --recurse-submodules ssh://git@git-r3lab-server.uni.lu:8022/<yourUsername>/presentations-internal.git - ``` -- If the `--recurse-submodules` flag has been omitted, run this command to check for the missing modules and update them: - ```bash - $ git submodule update --init --recursive - ``` -- Open a terminal and work on your presentation: - ```bash - $ cd presentations-internal - $ pip install . - $ contribute --date="YYYY-MM-DD" --name="yourAwesomeTitle" - ``` - -## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px"> Tips - -- Please create a branch from `develop` before starting to work on your presentation. You could name it `YYYY-MM-DD_yourAwesomeTitle`. -- If you are done with making changes to your presentation, push them to your fork and open a merge request against the `develop` branch. - -## <img src="https://webdav-r3lab.uni.lu/public/R3lab/logos/warning.png" height="20px" width="20px">Solving the error: `Fatal error: Unable to find local grunt.` - -If you get a fatal error complaining about your local grunt installation, please make sure that you have add the `--recurse-submodules` flag when cloning, or that you ran the `git submodule update --init --recursive` command from within -the `presentations-internal` directory. - -Please also make sure that you run the `contribute` command from the root of the `presentations-internal` directory. - - -## How to continue working on a presentation - - For resuming your work on a presentation, you can either run the same contribute command:</br> - ``` - $ contribute --date="YYYY-MM-DD" --name="yourAwesomeTitle" - ``` - - or you can navigate to your presentation directory and start `grunt` server: - ``` - $ cd YYYY/yourAwesomeTitle/ - $ grunt server - ``` - -## Adding a new slide/slides - - Create a Markdown file with your slide(s) in `YYYY-MM-DD_yourAwesomeTitle/slides` and place it into `list.md` file at desired position: - -``` -[ - { "filename": "index.md" }, - { "filename": "structure.md" }, - { "filename": "myNewAwesomeSlide.md" }, - { "filename": "thanks.md" } -] -``` +Detailed instructions are here: https://git-r3lab.uni.lu/R3/outreach/templates/presentation \ No newline at end of file diff --git a/contribute.py b/contribute.py index a8c76e102786d7e3bc83865a7fc45b52a963b6a4..ea625ac904b127a1f0fc68bfb19110657e34a89e 100644 --- a/contribute.py +++ b/contribute.py @@ -20,6 +20,10 @@ def main(date, name): # get the root directory rootDir = os.getcwd() + # create a root directory if not existing + if not os.path.exists(mainDir): + os.mkdir(mainDir) + # generate the full name of the presentation fullName = date + "_" + name diff --git a/contribute.sh b/contribute.sh new file mode 100755 index 0000000000000000000000000000000000000000..76ceb98890c5e78b1098cce8f372235af6300b30 --- /dev/null +++ b/contribute.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# set the variables +dockerImg="git-r3lab.uni.lu:4567/r3/docker/nodejs-yarn-grunt" +dockerPort="9000" + +helpFunction() +{ + echo "" + echo "Usage: $0 -d parameterDate -n parameterName" + echo -e "\t-d Data of presentation" + echo -e "\t-n Name of presentation" + exit 1 # Exit script after printing help +} + +while getopts "d:n:" opt +do + case "$opt" in + d ) parameterDate="$OPTARG" ;; + n ) parameterName="$OPTARG" ;; + ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent + esac +done + +# Print helpFunction in case parameters are empty +if [ -z "$parameterDate" ] || [ -z "$parameterName" ] +then + echo "Some or all of the parameters are empty"; + helpFunction +fi + +# launch the docker file +cmd="python contribute.py --date=\"$parameterDate\" --name=\"$parameterName\"" + +docker run -p $dockerPort:$dockerPort -it -v $(pwd)/:/presentation $dockerImg /bin/bash -c "$cmd" diff --git a/template/Gruntfile.coffee b/template/Gruntfile.coffee index 4aee8a284d585fe7a2863c7c896007966ef05b5b..686dd9be931ab71b7ae4e04acd8fba52863aad40 100644 --- a/template/Gruntfile.coffee +++ b/template/Gruntfile.coffee @@ -36,9 +36,9 @@ module.exports = (grunt) -> port: 9000 # Change hostname to '0.0.0.0' to access # the server from outside. - hostname: 'localhost' + #hostname: '0.0.0.0' base: '.' - open: true + #open: true livereload: true jshint: diff --git a/theme b/theme index 3f950f06b72824f97b486a47d54754eeed0f0faf..8b3401b863d08b5a676bfa327dba915a14d41e70 160000 --- a/theme +++ b/theme @@ -1 +1 @@ -Subproject commit 3f950f06b72824f97b486a47d54754eeed0f0faf +Subproject commit 8b3401b863d08b5a676bfa327dba915a14d41e70