<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Installing CsoundMagics\n",
    "This cookbook provides an extension for Csound in Jupyter which adds four magics commands, two functions, and one class to the IPython kernel. There is also a Codemirror mode for Csound code syntax highlighting.\n",
    "\n",
    "Download the csoundmagics directory on your system, and from this dir run the command:\n",
    "\n",
    "```\n",
    "python3 installCsoundmagics.py\n",
    "```\n",
    "\n",
    "This will copy the *csoundmagic* extension in the user's ipython dir, copy the *csound.js* mode in the codemirror mode directory of Jupyter, and copy the *custom.js* file in the user's jupyter dir.\n",
    "\n",
    "See the 06-csoundmagics and 07-icsound notebooks for the use of this extension."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Author: <NAME>, May 2016"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
<commit_msg>added manual install option for csoundmagics<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Installing CsoundMagics\n",
    "### Automatic install\n",
    "This cookbook provides an extension for Csound in Jupyter which adds four magics commands, two functions, and one class to the IPython kernel. There is also a Codemirror mode for Csound code syntax highlighting.\n",
    "\n",
    "Download the csoundmagics directory on your system, and from this dir run the command:\n",
    "\n",
    "```\n",
    "python3 installCsoundmagics.py\n",
    "```\n",
    "\n",
    "This will copy the *csoundmagic* extension in the user's ipython dir, copy the *csound.js* mode in the codemirror mode directory of Jupyter, and copy the *custom.js* file in the user's jupyter dir.\n",
    "\n",
    "See the 06-csoundmagics and 07-icsound notebooks for the use of this extension."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Manual install\n",
    "In case the installCsoundmagics.py script does not work for your jupyter setup, evaluate the cell below and manually copy *csoundmagics.py*, *csound.js* and *custom.js* to the locations which are reported."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import notebook\n",
    "import os.path\n",
    "import site\n",
    "import shutil\n",
    "\n",
    "# Copy csoundmagics in user site-packages dir\n",
    "dest_magics = site.getusersitepackages()\n",
    "print('Location for csoundmagics.py:\\n%s' % dest_magics)\n",
    "#shutil.copy(\"csoundmagics/csoundmagics.py\", dest_magics)\n",
    "\n",
    "# Copy csound mode in codemirror\n",
    "dest_csmode = os.path.join(notebook.DEFAULT_STATIC_FILES_PATH, \"components\", \"codemirror\", \"mode\", \"csound\")\n",
    "print('Location for csoundmode.js:\\n%s' % dest_csmode)\n",
    "if not os.path.exists(dest_csmode):\n",
    "    os.mkdir(dest_csmode)\n",
    "#shutil.copy(\"csoundmagics/csound.js\", dest_csmode)\n",
    "\n",
    "# Copy custom.js in jupyter dir\n",
    "dest_custom = os.path.join(notebook.extensions.jupyter_config_dir(), \"custom\")\n",
    "print('Location for custom.js:\\n%s' % dest_custom)\n",
    "if not os.path.exists(dest_custom):\n",
    "    os.mkdir(dest_custom)\n",
    "#shutil.copy(\"csoundmagics/custom.js\", dest_custom)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Author: <NAME>, May 2016"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}

{'fraction_non_alphanumeric': 0.17216448260280162, 'fraction_numerical': 0.008133755083596927, 'mean_word_length': 3.208174904942966, 'pattern_counts': {'":': 58, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '118370', 'n_tokens_mistral': 1651, 'n_tokens_neox': 1598, 'n_words': 411}