diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 133d3859e57814ec12851904944ad73a7611b6cb..f7f54b4e2a928feb59ddc3064342163380ac64d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,13 +5,13 @@ pages: - pandoc --version # - pandoc --help # - pandoc --list-input-formats # Broken as pandoc dates from 2013 on this image! :( - - for file in `cat html_src_files.lst`; do + - for file in `cat html_src_files.lst | sed 's/#.*//g' `; do bin/pandoc_fixer.pl ${file}; echo "Creating" public/`dirname ${file}`; mkdir -p public/`dirname ${file}`; mv ${file%.*}.html public/`dirname ${file}`/; done - - cat html_src_files.lst | sed -e 's|.md$|.html|' -e 's|.org$|.html|' -e 's|^./\(.*\)$|- [[./\1]]|' > index.org + - cat html_src_files.lst | sed -e 's|\.md |.html |' -e 's|\.org |\.html |' -e 's|^./\([^ ]*\) *# *\([^ ]*\)|- [[./\1]] (\2)|' > index.org - pandoc -s -f org -t html -o public/index.html index.org artifacts: paths: diff --git a/gitlab-ci.org b/gitlab-ci.org index eea1c32b98990efe3e173fc2dbca733f0fa4bc47..fc2acca0fa04701615a343909062191d85fc937c 100644 --- a/gitlab-ci.org +++ b/gitlab-ci.org @@ -1,59 +1,7 @@ * GitLab CI configuration Here is the manually filtered list of org and md files that need to be -exported to html with the gitlab pages CI mechanism. - -#+BEGIN_SRC txt :tangle html_src_files.lst -./module1/ressources/introduction_to_markdown_fr.org -./module1/ressources/introduction_to_markdown.org -./module1/ressources/sequence0_fr.org -./module1/ressources/sequence1_fr.org -./module1/ressources/sequence2_fr.org -./module1/ressources/sequence3_fr.org -./module1/ressources/sequence5_fr.org -./module1/ressources/sequence1.org -./module1/ressources/sequence2.org - -./module2/ressources/maintaining_a_journal.org -./module2/ressources/maintaining_a_journal_fr.org -./module2/ressources/jupyter.org -./module2/ressources/jupyter_fr.org -./module2/ressources/rstudio.org -./module2/ressources/rstudio_fr.org -./module2/ressources/gitlab.org -./module2/ressources/gitlab_fr.org -./module2/ressources/emacs_orgmode.org -./module2/ressources/emacs_orgmode_fr.org -./module2/ressources/sequence6_examples/README.org -./module2/ressources/sequence6_examples/README_fr.org -./module2/exo4/stat_activity.org -./module2/slides/ressources.org -./module2/slides/ressources_fr.org - - -./module3/ressources/iso_date_format.org -./module3/ressources/iso_date_format_fr.org -./module3/ressources/influenza-like-illness-analysis-orgmode+R.org -./module3/ressources/influenza-like-illness-analysis-orgmode+Lisp+Python+R.org -./module3/ressources/influenza-like-illness-analysis-orgmode.org -./module3/ressources/analyse-syndrome-grippal-orgmode.org -./module3/ressources/analyse-syndrome-grippal-orgmode+R.org -./module3/ressources/analyse-syndrome-grippal-orgmode+Lisp+Python+R.org - -./module4/ressources/resources_refs.org -./module4/ressources/resources_refs_fr.org -./module4/ressources/exo1.org -./module4/ressources/exo2.org -./module4/ressources/exo3.org -./module4/ressources/resources_environment.org -./module4/ressources/resources_environment_fr.org - -./documents/notebooks/notebook_RStudio_SASmarkdown.md -./documents/tuto_git_gtlab/tuto_git_gitlab.md -./documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md -./documents/tuto_magit/tuto_magit.md -./documents/tuto_emacs_windows/tuto_emacs_windows.md -./documents/tuto_jupyter_windows/tuto_jupyter_windows.md -#+END_SRC +exported to html with the gitlab pages CI mechanism. Have a look at +file:html_src_files.lst to know which files are exported. Here is the yaml file used for CI. All the work is done in a single perl script. @@ -65,13 +13,13 @@ pages: - pandoc --version # - pandoc --help # - pandoc --list-input-formats # Broken as pandoc dates from 2013 on this image! :( - - for file in `cat html_src_files.lst`; do + - for file in `cat html_src_files.lst | sed 's/#.*//g' `; do bin/pandoc_fixer.pl ${file}; echo "Creating" public/`dirname ${file}`; mkdir -p public/`dirname ${file}`; mv ${file%.*}.html public/`dirname ${file}`/; done - - cat html_src_files.lst | sed -e 's|.md$|.html|' -e 's|.org$|.html|' -e 's|^./\(.*\)$|- [[./\1]]|' > index.org + - cat html_src_files.lst | sed -e 's|\.md |.html |' -e 's|\.org |\.html |' -e 's|^./\([^ ]*\) *# *\([^ ]*\)|- [[./\1]] (\2)|' > index.org - pandoc -s -f org -t html -o public/index.html index.org artifacts: paths: @@ -80,6 +28,64 @@ pages: - master #+END_SRC +* Update script =html_src_files.lst= +Once the content of the MOOC has been exported from FUN into =/tmp/course/=: +#+begin_src shell :results output :exports both +for file in `cat html_src_files.lst | sed -e 's/#.*//g'`; do + FILE=`echo $file | sed -e 's|^\./||' -e 's|.org$||' -e 's|.md$||'` + URL=`grep -l "gitlabpages.*$FILE" /tmp/course/html/*.html | sed -e 's|.html$||' -e 's|/tmp/course/html/|https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/|'` + echo "$file # $URL" +done +#+end_src + +#+RESULTS: +#+begin_example +./module1/ressources/introduction_to_markdown_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/ecbcbd8bfafd48e9a912f66237b76c92 +./module1/ressources/introduction_to_markdown.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/ecbcbd8bfafd48e9a912f66237b76c92 +./module1/ressources/sequence1_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/9719a1f5b81a4f2d89c27e54ce81f498 +./module1/ressources/sequence2_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/565a72fe3c8b464f8ec3e31b56cd4c57 +./module1/ressources/sequence3_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/d85eb783ff884ff8b1306b680326b198 +./module1/ressources/sequence5_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/c96bfaf3804847a38d2a8850ee0baf54 +./module1/ressources/sequence1.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/9719a1f5b81a4f2d89c27e54ce81f498 +./module1/ressources/sequence2.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/565a72fe3c8b464f8ec3e31b56cd4c57 +./module2/ressources/maintaining_a_journal.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/0af0b6bf03194c1bb2798c29d7375a76 +./module2/ressources/maintaining_a_journal_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/0af0b6bf03194c1bb2798c29d7375a76 +./module2/ressources/jupyter.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/8dcce91be83c4ece834abfa98b8bbfb1 +./module2/ressources/jupyter_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/8dcce91be83c4ece834abfa98b8bbfb1 +./module2/ressources/rstudio.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/09d339f009cd4b45a468583ab7730221 +./module2/ressources/rstudio_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/09d339f009cd4b45a468583ab7730221 +./module2/ressources/gitlab.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/448cd6f9018545d1a67405551add6fda +./module2/ressources/gitlab_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/448cd6f9018545d1a67405551add6fda +./module2/ressources/emacs_orgmode.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/954f94ce4f9a4d858d47b41793cc96c8 +./module2/ressources/emacs_orgmode_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/954f94ce4f9a4d858d47b41793cc96c8 +./module2/ressources/sequence6_examples/README.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/827b36e10ddd49239f1c62cc1903951a +./module2/ressources/sequence6_examples/README_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/827b36e10ddd49239f1c62cc1903951a +./module2/exo4/stat_activity.org # +./module2/slides/ressources.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/36723edefc72488ab44e269501cfc9f8 +./module2/slides/ressources_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/36723edefc72488ab44e269501cfc9f8 +./module3/ressources/iso_date_format.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/316fc24edc1b44278ada4ca531c705be +./module3/ressources/iso_date_format_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/316fc24edc1b44278ada4ca531c705be +./module3/ressources/influenza-like-illness-analysis-orgmode+R.org # +./module3/ressources/influenza-like-illness-analysis-orgmode+Lisp+Python+R.org # +./module3/ressources/influenza-like-illness-analysis-orgmode.org # +./module3/ressources/analyse-syndrome-grippal-orgmode.org # +./module3/ressources/analyse-syndrome-grippal-orgmode+R.org # +./module3/ressources/analyse-syndrome-grippal-orgmode+Lisp+Python+R.org # +./module4/ressources/resources_refs.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/3c3c8cb2160d44e09a087b825beb92b8 +./module4/ressources/resources_refs_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/3c3c8cb2160d44e09a087b825beb92b8 +./module4/ressources/exo1.org # +./module4/ressources/exo2.org # +./module4/ressources/exo3.org # +./module4/ressources/resources_environment.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/4be922aa6b8c471ab1addcdbddb4e487 +./module4/ressources/resources_environment_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/4be922aa6b8c471ab1addcdbddb4e487 +./documents/notebooks/notebook_RStudio_SASmarkdown.md # +./documents/tuto_git_gtlab/tuto_git_gitlab.md # +./documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md # +./documents/tuto_magit/tuto_magit.md # +./documents/tuto_emacs_windows/tuto_emacs_windows.md # +./documents/tuto_jupyter_windows/tuto_jupyter_windows.md # +#+end_example + * Local Testing Having to go through a commit/push all the time to check whether it works or not is a pain. Here a simple mechanism that allows to test diff --git a/html_src_files.lst b/html_src_files.lst index 9e5becd3defde72f40559e6884f5ef29180e35bf..1d3a7de007ab6e16383fee4e5596b9c6a8ff1490 100644 --- a/html_src_files.lst +++ b/html_src_files.lst @@ -1,49 +1,49 @@ -./module1/ressources/introduction_to_markdown_fr.org -./module1/ressources/introduction_to_markdown.org -./module1/ressources/sequence1_fr.org -./module1/ressources/sequence2_fr.org -./module1/ressources/sequence3_fr.org -./module1/ressources/sequence5_fr.org -./module1/ressources/sequence1.org -./module1/ressources/sequence2.org +./module1/ressources/introduction_to_markdown_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/ecbcbd8bfafd48e9a912f66237b76c92 +./module1/ressources/introduction_to_markdown.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/ecbcbd8bfafd48e9a912f66237b76c92 +./module1/ressources/sequence0_fr.org # +./module1/ressources/sequence1_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/9719a1f5b81a4f2d89c27e54ce81f498 +./module1/ressources/sequence2_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/565a72fe3c8b464f8ec3e31b56cd4c57 +./module1/ressources/sequence3_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/d85eb783ff884ff8b1306b680326b198 +./module1/ressources/sequence5_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/c96bfaf3804847a38d2a8850ee0baf54 +./module1/ressources/sequence1.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/9719a1f5b81a4f2d89c27e54ce81f498 +./module1/ressources/sequence2.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/565a72fe3c8b464f8ec3e31b56cd4c57 -./module2/ressources/maintaining_a_journal.org -./module2/ressources/maintaining_a_journal_fr.org -./module2/ressources/jupyter.org -./module2/ressources/jupyter_fr.org -./module2/ressources/rstudio.org -./module2/ressources/rstudio_fr.org -./module2/ressources/gitlab.org -./module2/ressources/gitlab_fr.org -./module2/ressources/emacs_orgmode.org -./module2/ressources/emacs_orgmode_fr.org -./module2/ressources/sequence6_examples/README.org -./module2/ressources/sequence6_examples/README_fr.org -./module2/exo4/stat_activity.org -./module2/slides/ressources.org -./module2/slides/ressources_fr.org +./module2/ressources/maintaining_a_journal.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/0af0b6bf03194c1bb2798c29d7375a76 +./module2/ressources/maintaining_a_journal_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/0af0b6bf03194c1bb2798c29d7375a76 +./module2/ressources/jupyter.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/8dcce91be83c4ece834abfa98b8bbfb1 +./module2/ressources/jupyter_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/8dcce91be83c4ece834abfa98b8bbfb1 +./module2/ressources/rstudio.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/09d339f009cd4b45a468583ab7730221 +./module2/ressources/rstudio_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/09d339f009cd4b45a468583ab7730221 +./module2/ressources/gitlab.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/448cd6f9018545d1a67405551add6fda +./module2/ressources/gitlab_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/448cd6f9018545d1a67405551add6fda +./module2/ressources/emacs_orgmode.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/954f94ce4f9a4d858d47b41793cc96c8 +./module2/ressources/emacs_orgmode_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/954f94ce4f9a4d858d47b41793cc96c8 +./module2/ressources/sequence6_examples/README.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/827b36e10ddd49239f1c62cc1903951a +./module2/ressources/sequence6_examples/README_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/827b36e10ddd49239f1c62cc1903951a +./module2/exo4/stat_activity.org # +./module2/slides/ressources.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/36723edefc72488ab44e269501cfc9f8 +./module2/slides/ressources_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/36723edefc72488ab44e269501cfc9f8 +./module3/ressources/iso_date_format.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/316fc24edc1b44278ada4ca531c705be +./module3/ressources/iso_date_format_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/316fc24edc1b44278ada4ca531c705be +./module3/ressources/influenza-like-illness-analysis-orgmode+R.org # +./module3/ressources/influenza-like-illness-analysis-orgmode+Lisp+Python+R.org # +./module3/ressources/influenza-like-illness-analysis-orgmode.org # +./module3/ressources/analyse-syndrome-grippal-orgmode.org # +./module3/ressources/analyse-syndrome-grippal-orgmode+R.org # +./module3/ressources/analyse-syndrome-grippal-orgmode+Lisp+Python+R.org # -./module3/ressources/iso_date_format.org -./module3/ressources/iso_date_format_fr.org -./module3/ressources/influenza-like-illness-analysis-orgmode+R.org -./module3/ressources/influenza-like-illness-analysis-orgmode+Lisp+Python+R.org -./module3/ressources/influenza-like-illness-analysis-orgmode.org -./module3/ressources/analyse-syndrome-grippal-orgmode.org -./module3/ressources/analyse-syndrome-grippal-orgmode+R.org -./module3/ressources/analyse-syndrome-grippal-orgmode+Lisp+Python+R.org +./module4/ressources/resources_refs.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/3c3c8cb2160d44e09a087b825beb92b8 +./module4/ressources/resources_refs_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/3c3c8cb2160d44e09a087b825beb92b8 +./module4/ressources/exo1.org # +./module4/ressources/exo2.org # +./module4/ressources/exo3.org # +./module4/ressources/resources_environment.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/4be922aa6b8c471ab1addcdbddb4e487 +./module4/ressources/resources_environment_fr.org # https://www.fun-mooc.fr/courses/course-v1:inria+41016+session02/jump_to_id/4be922aa6b8c471ab1addcdbddb4e487 -./module4/ressources/resources_refs.org -./module4/ressources/resources_refs_fr.org -./module4/ressources/exo1.org -./module4/ressources/exo2.org -./module4/ressources/exo3.org -./module4/ressources/resources_environment.org -./module4/ressources/resources_environment_fr.org - -./documents/notebooks/notebook_RStudio_SASmarkdown.md -./documents/tuto_git_gtlab/tuto_git_gitlab.md -./documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md -./documents/tuto_magit/tuto_magit.md -./documents/tuto_emacs_windows/tuto_emacs_windows.md -./documents/tuto_jupyter_windows/tuto_jupyter_windows.md +./documents/notebooks/notebook_RStudio_SASmarkdown.md # +./documents/tuto_git_gtlab/tuto_git_gitlab.md # +./documents/tuto_rstudio_gitlab/tuto_rstudio_gitlab.md # +./documents/tuto_magit/tuto_magit.md # +./documents/tuto_emacs_windows/tuto_emacs_windows.md # +./documents/tuto_jupyter_windows/tuto_jupyter_windows.md # diff --git a/module2/ressources/emacs_orgmode.org b/module2/ressources/emacs_orgmode.org index d051fe9d1cbc6419f31e9b8df50bcb10f8c6952b..2bccc797efb1dea0caa35f911d8f1a0ee4366d12 100644 --- a/module2/ressources/emacs_orgmode.org +++ b/module2/ressources/emacs_orgmode.org @@ -90,8 +90,12 @@ which is now deprecated. The Web site https://emacsformacosx.com/ proposes precompiled Emacs versions for macOS. Download the latest version (the one that figures prominently on the page) and install it like you would install any other macOS application, by copying =Emacs.app= from the downloaded disk image to a convenient location on your computer. -In case you need to run Emacs from the command line (note: this is not required for the MOOC), you have to enter the full path to the executable. Assuming that you have copied =Emacs.app= to =/path/to/emacs=, this is =/path/to/emacs/Emacs.app/Contents/MacOS/Emacs=. If you just type =emacs=, you will use the prehistoric command-line-only version at =/usr/bin/emacs= provided by Apple. +If you like working in a terminal (the =Terminal.app= from macOS, or an enhanced one such as [[https://iterm2.com/][iTerm2]]), the standard macOS way of opening a file in Emacs is =open -a Emacs.app /path/to/my/file.txt=. This will launch Emacs, unless it is already running, and then ask Emacs to open the file. Note that this is different from the Unix/Linux way of running Emacs, which is what you see in the videos. Under Linux, you type "emacs /path/to/my/file.txt" in the terminal, which always starts a fresh copy of Emacs. +*** Advanced topics - not required for following the MOOC +For advanced uses of Emacs, such as calling Emacs from a Makefile to automate document processing, you have to adopt the Unix way also under macOS, because this is the only way to provide parameters other than filenames. However, you have to enter the full path to the executable. Assuming that you have copied =Emacs.app= to =/path/to/emacs=, this is =/path/to/emacs/Emacs.app/Contents/MacOS/Emacs=. If you just type =emacs=, you will use the prehistoric command-line-only version at =/usr/bin/emacs= provided by Apple. You can of course make the Emacs executable more easily accessible using a shell alias, or by putting =/path/to/emacs/Emacs.app/Contents/MacOS/= on your =$PATH=. See the [[https://www.gnu.org/software/bash/manual/bashref.html][bash manual]] for details and explanation. + +Be aware that running Emacs the Unix way implies some subtle differences compared to running Emacs the macOS way. In particular, Emacs will inherit the shell's environment variables when run the Unix way, but the user session's environment variables when run the macOS way. ** Windows Download the [[https://ftp.gnu.org/gnu/emacs/windows/emacs-26/emacs-26.1-i686.zip][precompiled Emacs 26.1]] and unzip the zip file preserving the directory structure, and run =bin\runemacs.exe=.