Create a post

Here how to create a post on this blog

This website allows to post articles about data science and software engineering. You can insert maths formula, code, video or image easily.

Each article is written in MarkDown. If one part of your article has an syntax too specific, you can write HTML instead, inside your MarkDown document. The maths formulae use LateX syntax thanks to MathJax. And to insert image or video, use the include macro offered by Jekyll.

Your article has metadata and content, here an example.


---
layout: post
title:  "Example 1"
keywords: ["data-science", "big-data"]   <--- metadata
ref: example-1
lang: en
author: glegoux
---

Example 1 <--- content

Follow this stages:

0) Clone this git repository and install the environment, see README.md. Read and understand this example.

1) Write an article about a funny subject. Create a file in _drafts folder and format this name like that: <articlename>.md.

2) To see your article, run jekyll server with make draft in the working directory. Open your navigator at http://127.0.0.1:4000/ and look at posts tab.

3) One time your article is finished, rename it like that YEAR-MONTH-DAY-<articlename>.md and move it to _posts folder. Run jekyll server with make run.

4) You can see your article at URL precised in its metadata. Now you can push your article.

Insert maths formula


code:

This formula $ \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} e^{-\frac{x^2}{2}} = 1 $ is on the same line than the text.

This formula has its own line:

$$ x^4 + x^3 + x^2 + x = 1 $$

rendering:

This formula $ \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} e^{-\frac{x^2}{2}} = 1 $ is on the same line than the text.

This formula has its own line:

Insert videos


code:


{% include youtube.html id="4xXqvLEA2k4" description="Programming Contest"  %}

rendering:

Programming Contest

Insert Images


code:

 
{% include img.html url="/static/img/algorithm-words.jpg" width="50%" description="Algorithm" %}

rendering:

Algorithm
Algorithm

Insert code



Python

code:

~~~  python
#/usr/bin/env python

if __name__ == '__main__':
    print("Hello")
~~~

rendering:

#/usr/bin/env python

if __name__ == '__main__':
    print("Hello")


Java

code:

~~~  java
public class Main {
	public static void main(String[] args) {
		System.out.println("Hello");
	}
}
~~~

rendering:

public class Main {
    public static void main(String[] args) {
		System.out.println("Hello");
	}
}


Scala

code:

~~~  scala
object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, world!")
  }
}
~~~

rendering:

object HelloWorld {
  def main(args: Array[String]): Unit = {
    println("Hello, world!")
  }
}


Javascript

code:

~~~  javascript
function hello() {
    console.log('hello');
}
hello();
~~~

rendering:

function hello() {
    console.log('hello');
}
hello();


Bash

code:

~~~  bash
#/usr/bin/env bash

echo "Hello"
~~~

rendering:

#/usr/bin/env bash

echo "Hello"


SQL

code:

~~~  sql
SELECT key, value
FROM maps
WHERE value = 'value'
ORDER BY key;
~~~

rendering:

SELECT key, value
FROM maps
WHERE value = 'value'
ORDER BY key;


JSON

code:

~~~  json
{
    "menu": {
        "id": "file",
        "value": "File",
        "popup": {
            "menuitem": [
                { "value": "New", "onclick": "CreateNewDoc()" },
                { "value": "Open", "onclick": "OpenDoc()" },
                { "value": "Close", "onclick": "CloseDoc()" }
            ]
        }
    }
}
~~~

rendering:

{
    "menu": {
        "id": "file",
        "value": "File",
        "popup": {
            "menuitem": [
                { "value": "New", "onclick": "CreateNewDoc()" },
                { "value": "Open", "onclick": "OpenDoc()" },
                { "value": "Close", "onclick": "CloseDoc()" }
            ]
        }
    }
}