From bffb17540e6d8ef881aae2d84a0ede645d29ed27 Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 21 Jan 2021 13:04:44 +0000 Subject: [PATCH] updating notebook --- mediawiki-api.ipynb | 163 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 157 insertions(+), 6 deletions(-) diff --git a/mediawiki-api.ipynb b/mediawiki-api.ipynb index e78f42e..94043eb 100644 --- a/mediawiki-api.ipynb +++ b/mediawiki-api.ipynb @@ -50,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -60,7 +60,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -80,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -173,7 +173,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,24 @@ "metadata": {}, "outputs": [], "source": [ - "# Let's publish our HTML files" + "# Let's publish the HTML files that you just created" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# We can use terminal commands here (\"bash commands\" to be more precise), by using the \"!\" as the first character in a cell.\n", + "# For example:" ] }, { @@ -517,7 +534,7 @@ "metadata": {}, "outputs": [], "source": [ - "# ! cp ANYFILE /var/www/html/PrototypingTimes" + "! figlet hello" ] }, { @@ -527,6 +544,140 @@ "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# So, to copy files and folders over to the \"PrototypingTimes\" folder, we can use $ cp (from copy).\n", + "# The folder \"PrototypingTimes\" sits on the Sandbot server on this path: /var/www/html/PrototypingTimes/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# /var/www/html/PrototypingTimes/ == https://hub.xpub.nl/sandbot/PrototypingTimes/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# So to copy a file there, you can use this command:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "! cp YOURFUNNYFILENAME.html /var/www/html/PrototypingTimes/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# And in case you want to copy over folders, you can use $ cp -r (-r for recursive)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "! cp -r YOURFOLDERNAME /var/www/html/PrototypingTimes/" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "### Let's also publish this notebook as .html file?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# First, we can convert it to a .html file, using jupyter command line tools:\n", + "# (https://nbconvert.readthedocs.io/en/latest/usage.html)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "! jupyter nbconvert YOURNOTEBOOK.ipynb --to html " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# And then, copy it to the /var/www/html/PrototypingTimes/ folder with $ cp (as we just did above)" + ] + }, { "cell_type": "code", "execution_count": null,