Forráskód Böngészése

Move stuff and clean-up

Benoît Hubert 6 éve
szülő
commit
86ed18afe3
31 módosított fájl, 3 hozzáadás és 11034 törlés
  1. 0 0
      _old_stuff/index.html
  2. 0 35
      react-tuto/.eslintrc.js
  3. 0 141
      react-tuto/gulpfile.js
  4. 0 10746
      react-tuto/package-lock.json
  5. 0 60
      react-tuto/package.json
  6. 0 22
      react-tuto/restes section 2/23. Quelques précautions.md
  7. 0 11
      react-tuto/restes section 2/26. Exercice.md
  8. 0 17
      react-tuto/restes section 2/zz.md
  9. 0 0
      tutorial/markdown/SUMMARY.md
  10. 0 0
      tutorial/markdown/about.md
  11. 0 0
      tutorial/markdown/tutor01_introduction.md
  12. 0 0
      tutorial/markdown/tutor02_expressionparsing.md
  13. 0 0
      tutorial/markdown/tutor03_moreexpressions.md
  14. 0 0
      tutorial/markdown/tutor04_interpreters.md
  15. 0 0
      tutorial/markdown/tutor05_controlstructs.md
  16. 0 0
      tutorial/markdown/tutor06_booleanexpressions.md
  17. 0 0
      tutorial/markdown/tutor07_lexicalscanning.md
  18. 0 0
      tutorial/markdown/tutor08_littlephilosophy.md
  19. 0 0
      tutorial/markdown/tutor09_atopview.md
  20. 0 0
      tutorial/markdown/tutor10_introducingtiny.md
  21. 0 0
      tutorial/markdown/tutor11_lexicalscanrevisit.md
  22. 0 0
      tutorial/markdown/tutor12_miscellany.md
  23. 0 0
      tutorial/markdown/tutor13_procedures.md
  24. 0 0
      tutorial/markdown/tutor14_types.md
  25. 0 0
      tutorial/markdown/tutor15_backtothefuture.md
  26. 0 0
      tutorial/markdown/tutor16_unitconstruction.md
  27. 0 0
      tutorial/md-sections-tool/extract.js
  28. 0 0
      tutorial/md-sections-tool/extractAll.js
  29. 0 0
      tutorial/md-sections-tool/package-lock.json
  30. 3 2
      react-tuto/tools/package.json
  31. 0 0
      tutorial/test/extract.test.js

index.html → _old_stuff/index.html


+ 0 - 35
react-tuto/.eslintrc.js

@@ -1,35 +0,0 @@
-module.exports = {
-    "env": {
-        "browser": true,
-        "es6": true
-    },
-    "extends": "eslint:recommended",
-    "parserOptions": {
-        "ecmaFeatures": {
-            "experimentalObjectRestSpread": true,
-            "jsx": true
-        },
-        "sourceType": "module"
-    },
-    "plugins": [
-        "react"
-    ],
-    "rules": {
-        "indent": [
-            "error",
-            4
-        ],
-        "linebreak-style": [
-            "error",
-            "unix"
-        ],
-        "quotes": [
-            "error",
-            "single"
-        ],
-        "semi": [
-            "error",
-            "always"
-        ]
-    }
-};

+ 0 - 141
react-tuto/gulpfile.js

@@ -1,141 +0,0 @@
-const gulp = require('gulp');
-const sourcemaps = require('gulp-sourcemaps');
-const source = require('vinyl-source-stream');
-const buffer = require('vinyl-buffer');
-const browserify = require('browserify');
-const watchify = require('watchify');
-const babelify = require('babelify');
-const pathmod = require('pathmodify');
-const babel = require('gulp-babel');
-const uglify = require('gulp-uglify');
-const gutil = require('gulp-util');
-const zip = require('gulp-zip');
-const fs = require('fs');
-const path = require('path');
-const es = require('event-stream');
-const Promise = require('bluebird');
-
-function slugify(str)
-{
-  str = str.replace(/^\s+|\s+$/g, ''); // trim
-  str = str.toLowerCase();
-
-  // remove accents, swap ñ for n, etc
-  var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
-  var to   = "aaaaeeeeiiiioooouuuunc------";
-
-  for (var i=0, l=from.length ; i<l ; i++)
-    str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
-
-
-  str = str.replace(/[^a-z0-9 -]/g, '') // remove invalid chars
-    .replace(/\s+/g, '-') // collapse whitespace and replace by -
-    .replace(/-+/g, '-'); // collapse dashes
-
-  return str;      // Trim - from end of text
-}
-
-Promise.promisifyAll(fs);
-// const archiveFiles = [
-//   'style.css',
-//   'screenshot.png',
-//   '*.php'
-// ];
-// const builtFiles = [
-//   'js/*'
-// ];
-const watchedFiles = [
-  'src/markdown/**/*'
-];
-
-// const themeName = 'reago';
-
-function buildClient(watch, done) {
-  var bundler =
-    browserify('./src/index.js', { debug: true })
-      .plugin(pathmod, {mods: [
-        pathmod.mod.dir('node_modules', __dirname + '/node_modules'),
-      ]})
-      // Transform JSX      https://github.com/andreypopp/reactify/issues/58
-      // Fix unexpected ... https://github.com/babel/babel-loader/issues/170
-      .transform(babelify, { presets: ['es2015', 'stage-0', 'react'] });
-  return new Promise(function (resolve, reject) {
-    bundler.bundle()
-      .on('error', function(err) { console.error(err); this.emit('end'); })
-      .pipe(source('bundle.react.js'))
-      .pipe(buffer())
-      .pipe(uglify())
-      .pipe(sourcemaps.init({ loadMaps: true }))
-      .pipe(sourcemaps.write('./'))
-      .pipe(gulp.dest(path.normalize(__dirname + '/../js/dist')))
-      .on('end', resolve);
-  });
-}
-
-function extractMarkdown() {
-  // return new Promise(function (resolve, reject) {
-    return fs.readdirAsync('src/markdown')
-    .then(subdirs => Promise.reduce(
-      subdirs,
-      (carry, dir) =>
-        fs.readdirAsync('src/markdown/' + dir)
-        .then(files => Promise.reduce(
-          files,
-          (carry, f) => fs.readFileAsync('src/markdown/' + dir + '/' + f)
-            .then(buf => buf.toString())
-            .then(content => {
-              const basename = path.basename(f, '.md');
-              const re = /(\d+)\. (.*)/;
-              const matches = basename.match(re);
-              const title = ! matches ? basename :
-                parseInt(matches[1], 10) + '. ' + matches[2];
-              return carry.concat({
-                title,
-                path: '/' + slugify(title),
-                content
-              });
-            }),
-          []
-        ))
-        .then(items => carry.concat({ title: dir, path: '/' + slugify(dir), items })),
-      []
-    ))
-    .then(JSON.stringify)
-    .then(markdownJson => fs.writeFileAsync('src/resources/markdown.json', markdownJson))
-  // });
-}
-
-// function makeZip(cb) {
-//   return extractThemeVersion()
-//     .then(themeVersion => {
-//       var base = 'dist/' + themeVersion;
-//       var tmp = base + '/reago';
-//       var rebasedFiles = base + '/**/*';
-//       es.concat(
-//           gulp.src(archiveFiles)
-//               .pipe(gulp.dest(tmp)),
-//             gulp.src(builtFiles)
-//                 .pipe(gulp.dest( tmp + '/js')),
-//           gulp.src(rebasedFiles, { base })
-//               .pipe(zip(themeName + '-' + themeVersion + '.zip'))
-//               .pipe(gulp.dest('dist'))
-//       ).on('end', cb)
-//     });
-// }
-
-gulp.task('watch', function() {
-  gulp.watch(['src'], buildClient);
-  // gulp.watch(watchedFiles, extractMarkdown);
-});
-
-gulp.task('buildClient', function() {
-  return buildClient();
-});
-
-gulp.task('extractMarkdown', function() {
-  return extractMarkdown();
-});
-
-// gulp.task('makeZip', makeZip);
-
-gulp.task('default', gulp.series('buildClient', 'watch'));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 10746
react-tuto/package-lock.json


+ 0 - 60
react-tuto/package.json

@@ -1,60 +0,0 @@
-{
-  "name": "react-tuto",
-  "version": "1.0.0",
-  "description": "",
-  "main": "index.js",
-  "scripts": {
-    "test": "npx mocha --exit --timeout 10000 test/**/*.js",
-    "build": "npx gulp",
-    "lint": "npx eslint --fix src/"
-  },
-  "keywords": [],
-  "author": "",
-  "license": "ISC",
-  "dependencies": {
-    "catch-links": "^2.0.1",
-    "gulp-util": "^3.0.8",
-    "lodash": "^4.17.4",
-    "react-markdown": "^3.1.4",
-    "react-redux": "^5.0.6",
-    "redux": "^3.7.2",
-    "redux-logger": "^3.0.6",
-    "redux-thunk": "^2.2.0"
-  },
-  "devDependencies": {
-    "babel-core": "^6.26.0",
-    "babel-plugin-transform-runtime": "^6.23.0",
-    "babel-preset-env": "^1.6.1",
-    "babel-preset-es2015": "^6.24.1",
-    "babel-preset-react": "^6.24.1",
-    "babel-preset-stage-0": "^6.24.1",
-    "babel-runtime": "^6.26.0",
-    "babelify": "^8.0.0",
-    "bluebird": "^3.5.1",
-    "browserify": "^14.5.0",
-    "bufferutil": "^3.0.3",
-    "eslint": "^6.1.0",
-    "eslint-plugin-react": "^7.14.3",
-    "event-stream": "^3.3.4",
-    "feathers-localstorage": "^2.0.0",
-    "gulp": "^4.0.0",
-    "gulp-babel": "^7.0.0",
-    "gulp-buffer": "0.0.2",
-    "gulp-sourcemaps": "^2.6.3",
-    "gulp-tap": "^1.0.1",
-    "gulp-uglify": "^3.0.0",
-    "gulp-zip": "^4.1.0",
-    "gulplog": "^1.0.0",
-    "mocha": "^6.2.0",
-    "pathmodify": "^0.5.0",
-    "react": "^16.2.0",
-    "react-dom": "^16.2.0",
-    "react-router-dom": "^4.2.2",
-    "rollup-stream": "^1.24.1",
-    "socket.io-client": "^2.0.4",
-    "utf-8-validate": "^4.0.0",
-    "vinyl-buffer": "^1.0.1",
-    "vinyl-source-stream": "^2.0.0",
-    "watchify": "^3.9.0"
-  }
-}

+ 0 - 22
react-tuto/restes section 2/23. Quelques précautions.md

@@ -1,22 +0,0 @@
-Dans l'exemple précédent, modifie l'attribut `id` de la `div`, **sans modifier**
-le JavaScript, et vois ce qui se passe dans la console. Tu dois obtenir une erreur :
-
-    empty.html:17 Uncaught TypeError: Cannot set property 'innerHTML' of null
-
-<blockquote>
-Si l'élement ciblé n'est pas trouvé, <code>getElementById()</code> renvoie <code>null</code>
-(une autre valeur courante en JS, à distinguer de <code>undefined</code>).
-</blockquote>
-
-Il faut donc être prudent :
-* Soit être très rigoureux, et modifier en même temps le HTML et le JS pour que les `id`
-correspondent.
-* Ou bien, si par exemple on récupère du HTML d'une source externe, et qu'on n'est pas sûr
-que l'élément existe, tester sa valeur avant de le modifier :
-
-```javascript
-var element = document.getElementById('element-inconnu');
-if(element !== null) {
-  element.innerHTML = "Contenu ajouté si l'élément existe";
-}
-```

+ 0 - 11
react-tuto/restes section 2/26. Exercice.md

@@ -1,11 +0,0 @@
-Avant de se lancer, je te présente la fonction `split()`, qui s'applique à une chaîne :
-```javascript
-var garniture = 'oeufs,jambon,fromage,tomate';
-var ingredients = garniture.split(',');
-```
-Je t'encourage à examiner son résultat (`console.log` est ton ami), pour te renseigner sur ce qu'elle fait.
-
-A partir de cet exemple et du précédent, et de tes connaissances en CSS, construis une belle liste
-d'ingrédients, en utilisant JS. Je veux que les caractères apparaissent en italique, et avec la police Georgia.
-
-Tu peux réutiliser une grande partie du code des exemples précédents !

+ 0 - 17
react-tuto/restes section 2/zz.md

@@ -1,17 +0,0 @@
-Déplie la `HTMLCollection`, puis son unique élément. Regarde attentivement `childNodes` et `children`.
-
-C'est presque la même chose : les deux ont en commun `head` et `body` qui correspondent aux balises de même nom.
-Mais `childNodes` contient, entre `head` et `body`, un noeud `text`.
-
-Déplie le et regarde sa propriété `data` : une chaîne de 3 caractères : le symbole du retour chariot,
-suivi de deux espaces. Si tu regardes dans `empty.html`, ça correspond exactement à ce qui se trouve après
-la balise fermante `</head>` et avant la balise ouvrante `<body>`. &Ccedil;a nous amène à l'explication...
-
-<blockquote>
-On distingue deux types de noeuds dans l'arbre du document :
-<ul>
-  <li>Des <em>éléments</em>, qui correspondent aux balises.</li>
-  <li>Des <em>noeuds texte</em>, qui sont du contenu textuel situé <em>entre deux balises</em>,
-  ou <em>à l'intérieur</em> d'une balise.</li>
-</ul>
-</blockquote>

react-tuto/lbac-markdown/SUMMARY.md → tutorial/markdown/SUMMARY.md


react-tuto/lbac-markdown/about.md → tutorial/markdown/about.md


react-tuto/lbac-markdown/tutor01_introduction.md → tutorial/markdown/tutor01_introduction.md


react-tuto/lbac-markdown/tutor02_expressionparsing.md → tutorial/markdown/tutor02_expressionparsing.md


react-tuto/lbac-markdown/tutor03_moreexpressions.md → tutorial/markdown/tutor03_moreexpressions.md


react-tuto/lbac-markdown/tutor04_interpreters.md → tutorial/markdown/tutor04_interpreters.md


react-tuto/lbac-markdown/tutor05_controlstructs.md → tutorial/markdown/tutor05_controlstructs.md


react-tuto/lbac-markdown/tutor06_booleanexpressions.md → tutorial/markdown/tutor06_booleanexpressions.md


react-tuto/lbac-markdown/tutor07_lexicalscanning.md → tutorial/markdown/tutor07_lexicalscanning.md


react-tuto/lbac-markdown/tutor08_littlephilosophy.md → tutorial/markdown/tutor08_littlephilosophy.md


react-tuto/lbac-markdown/tutor09_atopview.md → tutorial/markdown/tutor09_atopview.md


react-tuto/lbac-markdown/tutor10_introducingtiny.md → tutorial/markdown/tutor10_introducingtiny.md


react-tuto/lbac-markdown/tutor11_lexicalscanrevisit.md → tutorial/markdown/tutor11_lexicalscanrevisit.md


react-tuto/lbac-markdown/tutor12_miscellany.md → tutorial/markdown/tutor12_miscellany.md


react-tuto/lbac-markdown/tutor13_procedures.md → tutorial/markdown/tutor13_procedures.md


react-tuto/lbac-markdown/tutor14_types.md → tutorial/markdown/tutor14_types.md


react-tuto/lbac-markdown/tutor15_backtothefuture.md → tutorial/markdown/tutor15_backtothefuture.md


react-tuto/lbac-markdown/tutor16_unitconstruction.md → tutorial/markdown/tutor16_unitconstruction.md


react-tuto/tools/extract.js → tutorial/md-sections-tool/extract.js


react-tuto/tools/extractAll.js → tutorial/md-sections-tool/extractAll.js


react-tuto/tools/package-lock.json → tutorial/md-sections-tool/package-lock.json


+ 3 - 2
react-tuto/tools/package.json

@@ -1,10 +1,11 @@
 {
-  "name": "tools",
+  "name": "md-sections-tool",
   "version": "1.0.0",
   "description": "",
   "main": "extract.js",
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "test": "npx mocha --exit --timeout 10000 test/**/*.js",
+    "lint": "npx eslint --fix src/"
   },
   "keywords": [],
   "author": "",

react-tuto/test/extract.test.js → tutorial/test/extract.test.js