diff --git a/.gitignore b/.gitignore index 85e7c1d..b20c1da 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /.idea/ +/dist/ +/src/.tmp/ +/src/node_modules/ diff --git a/README.md b/README.md index 4600dc3..de06a7b 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,31 @@ slim-wiki A slim wiki based on PHP and markdown + +Build instructions +------------------ + +Install grunt globally: + + sudo npm install -g grunt-cli + +Install grunt dependency in project: + + cd src + npm install + +Build client: + + cd src + grunt + +Build automatically on source changes (watch mode): + + cd src + grunt watch + + + Used libraries -------------- diff --git a/src/Gruntfile.js b/src/Gruntfile.js new file mode 100644 index 0000000..5c79826 --- /dev/null +++ b/src/Gruntfile.js @@ -0,0 +1,78 @@ +module.exports = function (grunt) { + 'use strict'; + + require('load-grunt-tasks')(grunt); + + var dist = __dirname + '/../dist'; + + grunt.registerTask('build', [ + 'copy', + 'less', + 'useminPrepare', + 'concat', + //'uglify', // TODO: uncomment if there is JavaScript + 'cssmin', + 'usemin' + ]); + + grunt.registerTask('default', [ + 'clean', + 'build' + ]); + + grunt.initConfig({ + + clean: { + options: { force: true }, // Allow cleaning '../dist' (which is outside the working directory) + stuff: [ '.tmp', dist ] + }, + + copy: { + dist: { + files: [ + { src: '.htaccess', dest: dist + '/' }, + { expand: true, src: '*.php', dest: dist + '/' }, + { expand: true, src: 'articles/**', dest: dist + '/' }, + { expand: true, src: 'client/img/**', dest: dist + '/' }, + { expand: true, src: 'server/**', dest: dist + '/' } + ] + } + }, + + less: { + dist: { + files: (function () { + var files = {}; + files[dist + '/client/css/style.css'] = 'client/less/style.less'; + return files; + })() + } + }, + + useminPrepare: { + html: 'server/layout/page.php', + + options: { + root: '.', + dest: dist + } + }, + + usemin: { + html: dist + '/server/layout/page.php' + }, + + watch: { + less: { + files: 'client/less/*.less', + tasks: 'less' + }, + copy: { + files: 'client/images/**', + tasks: 'copy' + } + } + + }); + +}; diff --git a/src/articles/cheat-sheets/Markdown_cheat_sheet.md b/src/articles/cheat-sheets/Markdown_cheat_sheet.md new file mode 100644 index 0000000..9c3253c --- /dev/null +++ b/src/articles/cheat-sheets/Markdown_cheat_sheet.md @@ -0,0 +1,79 @@ +# Header 1 # +## Header 2 ## +### Header 3 (Hashes on right are optional) +#### Header 4 +##### Header 5 +###### Header 6 + + +Alternative Header 1 +==================== + + +Alternative Header 2 +-------------------- + +A simple Link: http://google.de + +This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one +line (or many), and can drone on for hours. + +Here is a Markdown link to [a named link](http://google.de). + +Now some inline markup like _italics_, **bold**, ~~strike through~~ and `code()`. Note that underscores_in_words are ignored in [GitHub flavored](https://help.github.com/articles/github-flavored-markdown) Markdown. + + + +> Blockquotes are like quoted text in email replies +>> And, they can be nested + +Bullet lists: + +* Bullet lists are easy too +- Another one ++ Another one + +Numbered lists: + +1. A numbered list +2. Which is numbered +3. With periods and a space + +And now some code: + + // Code is just text indented a bit + which(is_easy) to_remember(); + +~~~ +// Un-indented code blocks work too + +if (this_is_more_code == true && !indented) { + // tild wrapped code blocks, also not indented +} +~~~ + +Text with +two trailing spaces +(on the right) +can be used +for things like poems + +### Horizontal rules + +* * * * +**** +-------------------------- + +