Skip to content

Instantly share code, notes, and snippets.

@lisandi
Last active October 6, 2021 16:26
Show Gist options
  • Save lisandi/4a09acf2be3eb23722f30d49d1b5c8c5 to your computer and use it in GitHub Desktop.
Save lisandi/4a09acf2be3eb23722f30d49d1b5c8c5 to your computer and use it in GitHub Desktop.

Revisions

  1. lisandi revised this gist Oct 6, 2021. 2 changed files with 448 additions and 248 deletions.
    448 changes: 448 additions & 0 deletions ep_new.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,448 @@
    #! /bin/sh

    echo "CREATE YOUR NEW ETHERPAD PLUGIN"
    echo "-------------------------------"
    echo "With this script you can develop different kinds of etherpad plugins:"
    echo
    echo "A. ep_newplugin you can develop Modules for EtherPad by ether (ep_)"
    echo " Please leave the Identifier option empty when you develop for Etherpad in general"
    echo
    echo "B. ep_id_newplugin.sh you can develop Modules for i.e. T3Pad (ep_t3_), the Pad for education and communities"
    echo " Please enter your personal identifier."
    echo " It will be added in the form ep_id_ (enter ONLY letters or numbers)"
    echo
    read -p "ENTER the min. 2 letter IDENTIFIER: " ID

    echo
    echo "This script is maintained by LisAndi and MontessoriX - All Inclusive Montessori Education for All"
    echo "T3Pad is the Etherpad for MontessoriX, Homeschoolers and other Communities - <https://t3pad.com>"
    echo "SUPPORT US: <https://ko-fi.com/montessori>"
    echo "Etherpad by the Ether Foundation can be reached at <https://etherpad.org>"
    echo "LisAndi Co., Ltd. - Software development in Paradies - Rawai, Phuket, Thailand - <https://lisandi.com>"
    echo "License: This script is provided under AGPLv.3 <https://www.gnu.org/licenses/agpl-3.0.en.html>"
    echo
    echo "Let's start!"
    echo "-------------------------------------------------------------------------"

    # Creating the Name of the plugin
    read -p "Enter the plugin name: ep_${ID}_" EPNAME

    PLUGINNAME=ep_${ID}_${EPNAME}
    echo "-------------------------------------------------------------------------"

    # Collecting Data for the description
    echo "Your Etherpad plugin ${PLUGINNAME} needs a description of min 50 letters:"
    read -p "Enter a short description:" DESCRIPTION
    echo "-------------------------------------------------------------------------"

    # The Year is needed for the Copyright
    date +'%Y'
    ## Store to a shell variable ##
    YEAR=$(date +'%Y')
    echo "The Year ${YEAR} is needed for the copyright"
    echo "-------------------------------------------------------------------------"

    # Collecting Basic PLugin Informations
    echo "Your Plugin ${PLUGINNAME} needs some author information"
    read -p "Enter your Github UserName: " GITNAME
    read -p "Enter your real name: " AUTHORNAME
    read -p "Enter your email-address: " AUTHOREMAIL
    echo "-------------------------------------------------------------------------"

    # Collecting License Information
    echo "Under which license you like to release your plugin?"
    echo " 1: Apache 2.0 - License of i.e. Etherpad-light - DEFAULT! Press 1"
    echo " 2: AGPLv3.0 - License of i.e. T3Pad and Humhub. This script can not be used in Proprietary scripts and derivates have to be published for users"
    echo " 3: GPLv2 and later - Used bei many CMS systems i.e. WordPress/Drupal/TYPO3/php-gettext/..."
    echo " 4: GPLv3.0 - often used in newer Open Source projects. This script can not be used in Proprietary scripts"
    echo " 5: LGPLv2.0 - used by older LGPL scripts like HTML Purifier, PHPMailer, ..."
    echo " 6: LGPLv3.0 - i.e. Odoo's, Smarty Template Engine's, License e.a."
    echo " 7: MIT - used by most Javascripts and many other smaller scripts"
    echo " 8: No License - All rights reserved (This script is incompatible with most Open Source scripts! - please contact the developer before use!)"
    while true; do
    read -p "Please enter your License choice (1/2/3/4/5/6/7/8) and then Press ENTER: " LCE
    case ${LCE} in
    [1]* ) echo "The following License has been added to ${PLUGINNAME}: Apache 2.0";break;;
    [2]* ) echo "The following License has been added to ${PLUGINNAME}: AGPLv3.0 - License of i.e. T3Pad and Humhub. This script can not be used in Proprietary scripts and derivates have to be published for users";break;;
    [3]* ) echo "The following License has been added to ${PLUGINNAME}: GPLv2 and later - Used bei many CMS systems i.e. WordPress/Drupal/TYPO3/php-gettext/...";break;;
    [4]* ) echo "The following License has been added to ${PLUGINNAME}: GPLv3.0 - often used in newer Open Source projects. This script can not be used in Proprietary scripts";break;;
    [5]* ) echo "The following License has been added to ${PLUGINNAME}: LGPLv2.0 - used by older LGPL scripts like HTML Purifier, PHPMailer, ...";break;;
    [6]* ) echo "The following License has been added to ${PLUGINNAME}: LGPLv3.0 - i.e. Odoo's, Smarty Template Engine's, License e.a.";break;;
    [7]* ) echo "The following License has been added to ${PLUGINNAME}: MIT - used by most Javascripts and many other smaller scripts";break;;
    [8]* ) echo "No License has been added to ${PLUGINNAME}: All rights reserved (This script is incompatible with most Open Source scripts! - please contact the developer before use!)";break;;
    []* ) echo "Choose the License and then Press ENTER.";exit;;
    * ) echo "Please ENTER the letter of your License choice or press \"1\" for Default Apache 2.0?";;
    esac
    done
    if [ ${LCE} = "1" ]
    then
    LSHORT="Apache-2.0+"
    LICENSEFILE="* @license Apache-2.0+ <http://www.apache.org/licenses/LICENSE-2.0>"
    elif [ ${LCE} = "2" ]
    then
    LSHORT="AGPL-3+"
    LICENSENAME="GNU Affero General Public License"
    LICENSEVERSION="3 of the License, or (at your option) any later version."
    LICENSEFILE="@license AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.html>"
    elif [ ${LCE} = "3" ]
    then
    LSHORT="GPL-2+"
    LICENSENAME="GNU General Public License"
    LICENSEVERSION="2 of the License, or (at your option) any later version."
    LICENSEFILE="@license GPL-2.0+ <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>"
    elif [ ${LCE} = "4" ]
    then
    LSHORT="GPL-3+"
    LICENSENAME="GNU General Public License"
    LICENSEVERSION="3 of the License, or (at your option) any later version."
    LICENSEFILE="@license GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.en.html>"
    elif [ ${LCE} = "5" ]
    then
    LSHORT="LGPL-2.1+"
    LICENSENAME="GNU Lesser General Public License"
    LICENSEVERSION="2.1 of the License."
    LICENSEFILE="@license LGPL-2.1 <https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>"
    elif [ ${LCE} = "6" ]
    then
    LSHORT="LGPL-3+"
    LICENSENAME="GNU Lesser General Public License"
    LICENSEVERSION="3.0 of the License."
    LICENSEFILE="@license LGPL-3.0+ <https://www.gnu.org/licenses/lgpl-3.0.html>"
    elif [ ${LCE} = "7" ]
    then
    LSHORT="MIT"
    LICENSEFILE="@license MIT <https://opensource.org/licenses/MIT+>"
    elif [ ${LCE} = "8" ]
    then
    LSHORT="Proprietary - All Rights reserved!"
    LICENSE="/**
    * ${COPYRIGHT}
    *
    * All Rights reserved! Please contact the developer before
    * any kind of usage, copying or modifying!
    */"
    else
    echo "None of the condition met"
    fi

    COPYRIGHT="/**
    * Copyright ${YEAR} by ${AUTHORNAME} <${AUTHOREMAIL}>
    *
    * This file is part of ${PLUGINNAME}.
    *"
    AP1="* Licensed under the Apache License, Version 2.0 or later
    * (the \"License\"); you may not use this file except in
    * compliance with the License.
    * Unless required by applicable law or agreed to in writing,
    * software distributed under the License is distributed on
    * an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    * either express or implied. See the License for the specific language
    * governing permissions and limitations under the License.
    * You may obtain a copy of the License at
    *
    * ${LICENSEFILE}
    */"
    MI1="* Permission is hereby granted, free of charge, to any person
    * obtaining a copy of this software and associated documentation
    * files (the \"Software\"), to deal in the Software without restriction,
    * including without limitation the rights to use, copy, modify, merge,
    * publish, distribute, sublicense, and/or sell copies of the Software,
    * and to permit persons to whom the Software is furnished to do so,
    * subject to the following conditions:
    *"
    MI2="* The above copyright notice and this permission notice shall be included
    * in all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,
    * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT."
    MI3="* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
    * THERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
    * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    *
    * ${LICENSEFILE}
    */"
    GP1="* ${PLUGINNAME} is free software: you can redistribute it and/or
    * modify it under the terms of the ${LICENSENAME}
    * as published by the Free Software Foundation, either version 3
    * of the License, or (at your option) any later version.
    *
    * ${PLUGINNAME} is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    * See the ${LICENSENAME} for more details.
    *
    * You should have received a copy of the ${LICENSENAME}
    * along with ${PLUGINNAME}. If not, see <http://www.gnu.org/licenses/>.
    *
    * ${LICENSEFILE}
    */"
    if [ ${LCE} = "1" ]
    then
    LICENSE="${COPYRIGHT}
    ${AP1}"
    elif [ ${LCE} = "2" ]
    then
    LICENSE="${COPYRIGHT}
    ${GP1}"
    elif [ ${LCE} = "3" ]
    then
    LICENSE="${COPYRIGHT}
    ${GP1}"
    elif [ ${LCE} = "4" ]
    then
    LICENSE="${COPYRIGHT}
    ${GP1}"
    elif [ ${LCE} = "5" ]
    then
    LICENSE="${COPYRIGHT}
    ${GP1}"
    elif [ ${LCE} = "6" ]
    then
    LICENSE="${COPYRIGHT}
    ${GP1}"
    elif [ ${LCE} = "7" ]
    then
    LICENSE="${COPYRIGHT}
    ${MI1}
    ${MI2}"
    elif [ ${LCE} = "8" ]
    then
    LICENSE="${COPYRIGHT}
    * All Rights reserved! Please contact the developer before
    * any kind of usage, copying or modifying!
    */"
    else
    echo "None of the condition met"
    fi
    echo "-------------------------------------------------------------------------"

    # Collecting Contributors Informations if they exist
    echo -n "Does ${PLUGINNAME} has contributors (y|n)?"
    read answer
    if [ "$answer" != "${answer#[Yy]}" ] ;then
    echo "Enter contributors CONTRIBUTOR-NAME <CONTRIBUTOR-EMAIl> if any"
    read -p "Enter a contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAME}
    while [ "${CONTRIBUTORNAME}" != "" ]
    do
    read -p "Enter ${CONTRIBUTORNAME}'s email: " CONTRIBUTOREMAIL
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}" <"${CONTRIBUTOREMAIL}">"
    echo "Adding ${CONTRIBUTORNAMES} as contibutor(s) to ${PLUGINNAME} by ${AUTHORNAME}, <${AUTHOREMAIL}>"
    read -p "Enter another contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}", "${CONTRIBUTORNAME}
    done
    echo "========="
    echo "Name: ${PLUGINNAME}"
    echo "Description: ${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHOREMAIL}>, <https://github.com/${GITNAME}"
    echo "Contributors: ${CONTRIBUTORS}"
    echo "Version: 0.0.1"
    echo "License:"
    echo "${LICENSE}"
    echo "========="
    else
    echo "========="
    echo "Name: ${PLUGINNAME}"
    echo "Description: ${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}"
    echo "Version: 0.0.1"
    echo "License:"
    echo "${LICENSE}"
    echo "========="
    fi
    COMMENTS=$@
    echo "-------------------------------------------------------------------------"

    # Creating the directory structure
    echo "Creating the folderstructure for ${PLUGINNAME} ..."
    mkdir ${PLUGINNAME} ${PLUGINNAME}/locales ${PLUGINNAME}/static ${PLUGINNAME}/static/css ${PLUGINNAME}/static/js ${PLUGINNAME}/static/image ${PLUGINNAME}/static/tests ${PLUGINNAME}/templates
    echo "---> Folderstructure for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # Creating ${PLUGINNAME}/package.json
    echo "Creating the package.json for ${PLUGINNAME} ..."
    cat <<EOF >${PLUGINNAME}/package.json
    {
    "name": "${PLUGINNAME}",
    "version": "0.0.1",
    "description": "${DESCRIPTION}",
    "author": {
    "name": "${AUTHORNAME}",
    "email": "<${AUTHOREMAIL}>",
    "github": "https://github.com/${GITNAME}"
    },
    "contributors": [
    "${CONTRIBUTORS}",
    ],
    "keywords": [
    "etherpad",
    "plugin",
    "ep",
    ],
    "license": {
    "${LSHORT}"
    },
    "repository": {
    "type": "git",
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}.git",
    },
    "bugs": {
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/issues",
    },
    "homepage": {
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/README.md",
    },
    "funding": {
    "type": "individual",
    "url": "https://etherpad.org/",
    },
    "dependencies": {
    "MODULE": "0.3.20",
    },
    "peerDependencies": {
    "ep_etherpad_lite":">=1.8.6",
    },
    "devDependencies": {
    "eslint": "^7.18.0",
    "eslint-config-etherpad": "^1.0.24",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-mocha": "^8.0.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
    },
    "eslintConfig": {
    "root": true,
    "extends": "etherpad/plugin",
    },
    "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    },
    "engines": {
    "node": ">= 10.13.0",
    }
    }
    EOF
    echo "---> package.json for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # Creating ${PLUGINNAME}/ep.json
    echo "Creating the ep.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/ep.json
    {
    "parts": [
    {
    "name": "main",
    "client_hooks": {
    "aceEditEvent": "${PLUGINNAME}/static/js/index",
    "postToolbarInit": "${PLUGINNAME}/static/js/index",
    "aceDomLineProcessLineAttributes": "${PLUGINNAME}/static/js/index",
    "postAceInit": "${PLUGINNAME}/static/js/index",
    "aceInitialized": "${PLUGINNAME}/static/js/index",
    "aceAttribsToClasses": "${PLUGINNAME}/static/js/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "aceRegisterBlockElements": "${PLUGINNAME}/static/js/index",
    },
    "hooks": {
    "authorize": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME1",
    "authenticate": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME2",
    "expressCreateServer": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME3",
    "eejsBlock_editbarMenuLeft": "${PLUGINNAME}/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "collectContentPost": "${PLUGINNAME}/static/js/shared",
    "padInitToolbar": "${PLUGINNAME}/index",
    "getLineHTMLForExport": "${PLUGINNAME}/index",
    }
    }
    ]
    }
    EOF
    echo "---> ep.json for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # Create ${PLUGINNAME}/README.md
    echo "Creating the README.md for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/README.md
    # ${PLUGINNAME}
    ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg)
    ![Screenshot](https://user-images.githubusercontent.com/220864/107214131-5c3dd600-6a01-11eb-82d9-b2d67ec8ae93.png)
    ## What is ${PLUGINNAME}?
    An Etherpad Plugin to apply the ${PLUGINNAME} functionality in a pad. (describe in minimum 50 Letters what it is)
    Currently supports:
    * ${PLUGINNAME} functionality 1
    * ${PLUGINNAME} functionality 2
    * ${PLUGINNAME} functionality 3
    * ${PLUGINNAME} functionality 4
    ## ${PLUGINNAME} Usage
    Experimental. As a special attribute on Etherpad, some weirdness may be experienced by using ${PLUGINNAME}.
    ## ${PLUGINNAME} History
    I decided to copy/paste the ep_t3 over ${PLUGINNAME} to create that plugin.
    ## ${PLUGINNAME} License
    ${LICENSE}
    ## ${PLUGINNAME} Development
    I did the development for free to help support continued learning due to disruptions by the coronavirus.
    ## ${PLUGINNAME} Author
    ${AUTHORNAME} <${AUTHOREMAIL}>, https://github.com/${GITNAME}
    ## ${PLUGINNAME} Contributors
    ${CONTRIBUTORS}
    ## Help Funding ${PLUGINNAME}
    Place your funding information here.
    SEND
    MORE
    -----
    MONEY
    Thanks
    ${AUTHORNAME}
    EOF
    echo "---> README.md for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # Create ${PLUGINNAME}/LICENSE.MD
    echo "Creating the example English language file en.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/LICENSE.md
    ${LICENSE}
    EOF
    echo "---> LICENSE.md with ${License} for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # CREATE ${PLUGINNAME}/en.json
    echo "Creating the example English language file en.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/locales/en.json
    {
    "${PLUGINNAME}.toolbar.left.title" : "Left"
    }
    EOF
    echo "---> The English language file en.json for ${PLUGINNAME} has been created"
    echo "-------------------------------------------------------------------------"

    # The PLugin has been created
    echo
    echo " |==================================================================|"
    echo " | Congratulations!"
    echo " | Your plugin ${PLUGINNAME} "
    echo " | by ${AUTHORNAME} has been created."
    echo " |==================================================================|"
    echo

    # List all created folders and files.
    echo "The following folders and files have been created, you can adjust them further later by editing their content"
    find ${PLUGINNAME} -type f,d -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F'\0' '{print $3}'
    echo "-------------------------------------------------------------------------"

    # move into the plugin folder
    cd ${PLUGINNAME}
    248 changes: 0 additions & 248 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -1,248 +0,0 @@
    #! /bin/sh

    echo "CREATE YOUR NEW ETHERPAD PLUGIN"
    echo "-------------------------------"
    echo "With this script you can develop different kinds of etherpad plugins:"
    echo
    echo "A. ep_newplugin you can develop Modules for EtherPad by ether (ep_)"
    echo " Please leave the Identifier option empty when you develop for Etherpad in general"
    echo
    echo "B. ep_id_newplugin.sh you can develop Modules for i.e. T3Pad (ep_t3_), the Pad for education and communities"
    echo " Please enter your personal identifier."
    echo " It will be added in the form ep_id_ (enter ONLY letters or numbers)"
    echo
    read -p "ENTER the min. 2 letter IDENTIFIER: " ID

    echo
    echo "This script is maintained by LisAndi and MontessoriX - All Inclusive Montessori Education for All"
    echo "T3Pad is the Etherpad for MontessoriX, Homeschoolers and other Communities - <https://t3pad.com>"
    echo "SUPPORT US: <https://ko-fi.com/montessori>"
    echo "Etherpad by the Ether Foundation can be reached at <https://etherpad.org>"
    echo "LisAndi Co., Ltd. - Software development in Paradies - Rawai, Phuket, Thailand - <https://lisandi.com>"
    echo "License: This script is provided under AGPLv.3 <https://www.gnu.org/licenses/agpl-3.0.en.html>"
    echo
    echo "Let's start!"
    echo
    read -p "Enter the plugin name: ep_${ID}_" EPNAME

    PLUGINNAME=ep_${ID}_${EPNAME}

    echo
    echo "Your Etherpad plugin ${PLUGINNAME} needs a description of min 50 letters:"
    read -p "Enter a short description:" DESCRIPTION
    echo
    echo "${PLUGINNAME} needs some author information"
    read -p "Enter your Github UserName: " GITNAME
    read -p "Enter your real name: " AUTHORNAME
    read -p "Enter your email-address: " AUTHOREMAIL
    echo
    echo -n "Does ${PLUGINNAME} has contributors (y|n)?"
    read answer
    if [ "$answer" != "${answer#[Yy]}" ] ;then
    echo "Enter contributors CONTRIBUTOR-NAME <CONTRIBUTOR-EMAIl> if any"
    read -p "Enter a contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAME}
    while [ "${CONTRIBUTORNAME}" != "" ]
    do
    read -p "Enter ${CONTRIBUTORNAME}'s email: " CONTRIBUTOREMAIL
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}" <"${CONTRIBUTOREMAIL}">"
    echo "Adding ${CONTRIBUTORNAMES} as contibutor(s) to ${PLUGINNAME} by ${AUTHORNAME}, <${AUTHOREMAIL}>"
    read -p "Enter another contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}", "${CONTRIBUTORNAME}
    done
    echo
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHOREMAIL}>, <https://github.com/${GITNAME}"
    echo "Contributors: ${CONTRIBUTORS}"
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    else
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}"
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    fi
    # Having shifted twice, the rest is now comments ...
    COMMENTS=$@

    # Creating the directory structure
    echo "Creating the folderstructure for ${PLUGINNAME} ..."
    mkdir ${PLUGINNAME} ${PLUGINNAME}/locales ${PLUGINNAME}/static ${PLUGINNAME}/static/css ${PLUGINNAME}/static/js ${PLUGINNAME}/static/image ${PLUGINNAME}/static/tests ${PLUGINNAME}/templates
    echo "---> Folderstructure for ${PLUGINNAME} has been created"

    # Creating ${PLUGINNAME}/package.json
    echo "Creating the package.json for ${PLUGINNAME} ..."
    cat <<EOF >${PLUGINNAME}/package.json
    {
    "name": "${PLUGINNAME}",
    "version": "0.0.1",
    "description": "${DESCRIPTION}",
    "author": {
    "name": "${AUTHORNAME}",
    "email": "<${AUTHOREMAIL}>",
    "github": "https://github.com/${GITNAME}"
    },
    "contributors": [
    "${CONTRIBUTORS}",
    ],
    "keywords": [
    "etherpad",
    "plugin",
    "ep",
    ],
    "license": {
    "${LICENSE}"
    },
    "repository": {
    "type": "git",
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}.git",
    },
    "bugs": {
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/issues",
    },
    "homepage": {
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/README.md",
    },
    "funding": {
    "type": "individual",
    "url": "https://etherpad.org/",
    },
    "dependencies": {
    "MODULE": "0.3.20",
    },
    "peerDependencies": {
    "ep_etherpad_lite":">=1.8.6",
    },
    "devDependencies": {
    "eslint": "^7.18.0",
    "eslint-config-etherpad": "^1.0.24",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-mocha": "^8.0.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
    },
    "eslintConfig": {
    "root": true,
    "extends": "etherpad/plugin",
    },
    "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    },
    "engines": {
    "node": ">= 10.13.0",
    }
    }
    EOF
    echo "---> package.json for ${PLUGINNAME} has been created"

    # Creating ${PLUGINNAME}/ep.json
    echo "Creating the ep.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/ep.json
    {
    "parts": [
    {
    "name": "main",
    "client_hooks": {
    "aceEditEvent": "${PLUGINNAME}/static/js/index",
    "postToolbarInit": "${PLUGINNAME}/static/js/index",
    "aceDomLineProcessLineAttributes": "${PLUGINNAME}/static/js/index",
    "postAceInit": "${PLUGINNAME}/static/js/index",
    "aceInitialized": "${PLUGINNAME}/static/js/index",
    "aceAttribsToClasses": "${PLUGINNAME}/static/js/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "aceRegisterBlockElements": "${PLUGINNAME}/static/js/index",
    },
    "hooks": {
    "authorize": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME1",
    "authenticate": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME2",
    "expressCreateServer": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME3",
    "eejsBlock_editbarMenuLeft": "${PLUGINNAME}/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "collectContentPost": "${PLUGINNAME}/static/js/shared",
    "padInitToolbar": "${PLUGINNAME}/index",
    "getLineHTMLForExport": "${PLUGINNAME}/index",
    }
    }
    ]
    }
    EOF
    echo "---> ep.json for ${PLUGINNAME} has been created"

    # Create ${PLUGINNAME}/README.md
    echo "Creating the README.md for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/README.md
    # ${PLUGINNAME}
    ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg)
    ![Screenshot](https://user-images.githubusercontent.com/220864/107214131-5c3dd600-6a01-11eb-82d9-b2d67ec8ae93.png)
    ## What is ${PLUGINNAME}?
    An Etherpad Plugin to apply the ${PLUGINNAME} functionality in a pad. (describe in minimum 50 Letters what it is)
    Currently supports:
    * ${PLUGINNAME} functionality 1
    * ${PLUGINNAME} functionality 2
    * ${PLUGINNAME} functionality 3
    * ${PLUGINNAME} functionality 4
    ## ${PLUGINNAME} Usage
    Experimental. As a special attribute on Etherpad, some weirdness may be experienced by using ${PLUGINNAME}.
    ## ${PLUGINNAME} History
    I decided to copy/paste the ep_t3 over ${PLUGINNAME} to create that plugin.
    ## ${PLUGINNAME} License
    ${LICENSE}
    ## ${PLUGINNAME} Development
    I did the development for free to help support continued learning due to disruptions by the coronavirus.
    ## ${PLUGINNAME} Author
    $AUTHORNAME ($USERNAME) - <$AUTHOREMAIL>
    ## ${PLUGINNAME} Contributors
    $CONTRIBUTORS
    ## Help Funding ${PLUGINNAME}
    Place your funding information here.
    SEND
    MORE
    -----
    MONEY
    Thanks
    $AUTHORNAME
    EOF
    echo "---> README.md for ${PLUGINNAME} has been created"

    # Create ${PLUGINNAME}/LICENSE.MD
    echo "Creating the Apache2.0 LICENSE.md for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/LICENSE.md
    Copyright 2021 [${AUTHORNAME}]
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
    EOF
    echo "---> LICENSE.md with ${License} for ${PLUGINNAME} has been created"

    # CREATE ${PLUGINNAME}/en.json
    echo "Creating the example English language file en.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/locales/en.json
    {
    "${PLUGINNAME}.toolbar.left.title" : "Left"
    }
    EOF
    echo "---> The English language file en.json for ${PLUGINNAME} has been created"
    echo
    echo "Congratulations!"
    echo "Your Plugin ${PLUGINNAME} by ${AUTHORNAME}" has been created.
    echo
    find ep_t3_tt -type f,d -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F'\0' '{print $3}'


    cd $PLUGINNAME
  2. lisandi revised this gist Oct 5, 2021. 1 changed file with 18 additions and 12 deletions.
    30 changes: 18 additions & 12 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -39,29 +39,36 @@ echo
    echo -n "Does ${PLUGINNAME} has contributors (y|n)?"
    read answer
    if [ "$answer" != "${answer#[Yy]}" ] ;then
    echo "enter contributors CONTRIBUTOR-NAME <CONTRIBUTOR-EMAIl> if any"
    read -p "Enter your contributors real name: " CONTRIBUTORAUTHORNAME
    read -p "Enter your contributors email-address: " CONTRIBUTORAUTHOREMAIL
    echo "Enter contributors CONTRIBUTOR-NAME <CONTRIBUTOR-EMAIl> if any"
    read -p "Enter a contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAME}
    while [ "${CONTRIBUTORNAME}" != "" ]
    do
    read -p "Enter ${CONTRIBUTORNAME}'s email: " CONTRIBUTOREMAIL
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}" <"${CONTRIBUTOREMAIL}">"
    echo "Adding ${CONTRIBUTORNAMES} as contibutor(s) to ${PLUGINNAME} by ${AUTHORNAME}, <${AUTHOREMAIL}>"
    read -p "Enter another contributor's real name: " CONTRIBUTORNAME
    CONTRIBUTORNAMES=${CONTRIBUTORNAMES}", "${CONTRIBUTORNAME}
    done
    echo
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}
    echo "Contributors: ${CONTRIBUTORS}
    echo "Author: ${AUTHORNAME}, <${AUTHOREMAIL}>, <https://github.com/${GITNAME}"
    echo "Contributors: ${CONTRIBUTORS}"
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    else
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}
    echo "Contributors: ${CONTRIBUTORS}
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}"
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    fi
    # Having shifted twice, the rest is now comments ...
    COMMENTS=$@

    # Creating the directory structure
    echo "Creating the Folderstructure for ${PLUGINNAME} ..."
    echo "Creating the folderstructure for ${PLUGINNAME} ..."
    mkdir ${PLUGINNAME} ${PLUGINNAME}/locales ${PLUGINNAME}/static ${PLUGINNAME}/static/css ${PLUGINNAME}/static/js ${PLUGINNAME}/static/image ${PLUGINNAME}/static/tests ${PLUGINNAME}/templates
    echo "---> Folderstructure for ${PLUGINNAME} has been created"

    @@ -197,9 +204,9 @@ I did the development for free to help support continued learning due to disrupt
    $AUTHORNAME ($USERNAME) - <$AUTHOREMAIL>
    ## ${PLUGINNAME} Contributors
    $CONTRIBUTORSNAME
    $CONTRIBUTORS
    ## ${PLUGINNAME} Funding
    ## Help Funding ${PLUGINNAME}
    Place your funding information here.
    SEND
    @@ -238,5 +245,4 @@ echo
    find ep_t3_tt -type f,d -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F'\0' '{print $3}'


    cd $PLUGINNAME

    cd $PLUGINNAME
  3. lisandi revised this gist Oct 5, 2021. 1 changed file with 128 additions and 73 deletions.
    201 changes: 128 additions & 73 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -1,62 +1,102 @@
    #! /bin/sh

    echo "CREATE YOUR NEW ETHERPAD PLUGIN"
    echo "A. using ep_t3.sh you can develop Modules for T3Pad (ep_t3_), the Pad for education and communities"
    echo "B. using ep_newplugin you can develop Modules for EtherPad by ether (ep_)"
    echo "-------------------------------"
    echo "With this script you can develop different kinds of etherpad plugins:"
    echo
    echo "A. ep_newplugin you can develop Modules for EtherPad by ether (ep_)"
    echo " Please leave the Identifier option empty when you develop for Etherpad in general"
    echo
    echo "B. ep_id_newplugin.sh you can develop Modules for i.e. T3Pad (ep_t3_), the Pad for education and communities"
    echo " Please enter your personal identifier."
    echo " It will be added in the form ep_id_ (enter ONLY letters or numbers)"
    echo
    read -p "ENTER the min. 2 letter IDENTIFIER: " ID

    echo
    echo "This script is maintained by LisAndi and MontessoriX - All Inclusive Montessori Education for All"
    echo "T3Pad is the Etherpad for MontessoriX, Homeschoolers and other Communities - <https://t3pad.com>"
    echo "Support us at MontessoriX: <https://ko-fi.com/montessori>"
    echo "SUPPORT US: <https://ko-fi.com/montessori>"
    echo "Etherpad by the Ether Foundation can be reached at <https://etherpad.org>"
    echo "LisAndi Co., Ltd. - Software development in Paradies - Rawai, Phuket, Thailand - <https://lisandi.com>"
    echo "License: This script is provided under AGPLv.3 <https://www.gnu.org/licenses/agpl-3.0.en.html>"


    echo
    echo "Let's start!"
    echo
    read -p "Enter the plugin name: ep_${ID}_" EPNAME

    read -p "Enter the plugin name: ep_" PLUGINNAME
    read -p "Enter a short description - min. 50 letters:" DESCRIPTION
    read -p "Enter your user or nick-name: " USERNAME
    PLUGINNAME=ep_${ID}_${EPNAME}

    echo
    echo "Your Etherpad plugin ${PLUGINNAME} needs a description of min 50 letters:"
    read -p "Enter a short description:" DESCRIPTION
    echo
    echo "${PLUGINNAME} needs some author information"
    read -p "Enter your Github UserName: " GITNAME
    read -p "Enter your real name: " AUTHORNAME
    read -p "Enter your email-address: " AUTHOREMAIL

    echo
    echo -n "Does ${PLUGINNAME} has contributors (y|n)?"
    read answer
    if [ "$answer" != "${answer#[Yy]}" ] ;then
    echo "enter contributors CONTRIBUTOR-NAME <CONTRIBUTOR-EMAIl> if any"
    read -p "Enter your contributors real name: " CONTRIBUTORAUTHORNAME
    read -p "Enter your contributors email-address: " CONTRIBUTORAUTHOREMAIL
    echo
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}
    echo "Contributors: ${CONTRIBUTORS}
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    else
    echo "${PLUGINNAME}"
    echo "${DESCRIPTION}"
    echo "Author: ${AUTHORNAME}, <${AUTHORENAIL}>, <https://github.com/${GITNAME}
    echo "Contributors: ${CONTRIBUTORS}
    echo "Version: 0.0.1"
    echo "License: ${LICENSE}"
    fi
    # Having shifted twice, the rest is now comments ...
    COMMENTS=$@

    # Creating the directory structure
    echo "Creating the Folderstructure for ep_${PLUGINNAME} ..."
    mkdir ep_${PLUGINNAME} ep_${PLUGINNAME}/locales ep_${PLUGINNAME}/static ep_${PLUGINNAME}/static/css ep_${PLUGINNAME}/static/js ep_${PLUGINNAME}/static/image ep_${PLUGINNAME}/static/tests ep_${PLUGINNAME}/templates
    echo "Creating the Folderstructure for ${PLUGINNAME} ..."
    mkdir ${PLUGINNAME} ${PLUGINNAME}/locales ${PLUGINNAME}/static ${PLUGINNAME}/static/css ${PLUGINNAME}/static/js ${PLUGINNAME}/static/image ${PLUGINNAME}/static/tests ${PLUGINNAME}/templates
    echo "---> Folderstructure for ${PLUGINNAME} has been created"

    # Creating ep_${PLUGINNAME}/package.json
    echo "Creating the package.json for ep_${PLUGINNAME} ..."
    cat <<EOF >ep_${PLUGINNAME}/package.json
    # Creating ${PLUGINNAME}/package.json
    echo "Creating the package.json for ${PLUGINNAME} ..."
    cat <<EOF >${PLUGINNAME}/package.json
    {
    "name": "ep_${PLUGINNAME}",
    "name": "${PLUGINNAME}",
    "version": "0.0.1",
    "description": "$DESCRIPTION",
    "description": "${DESCRIPTION}",
    "author": {
    "name": "$USERNAME ($AUTHORNAME)",
    "email": "<$AUTHOREMAIL>",
    "name": "${AUTHORNAME}",
    "email": "<${AUTHOREMAIL}>",
    "github": "https://github.com/${GITNAME}"
    },
    "contributors": [
    "CONTRIBUTORNAME (REAL NAME)",
    "${CONTRIBUTORS}",
    ],
    "keywords": [
    "etherpad",
    "plugin",
    "ep",
    ],
    "license": {
    "Apache2"
    "${LICENSE}"
    },
    "repository": {
    "type": "git",
    "url": "https://github.com/ether/ep_${PLUGINNAME}.git",
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}.git",
    },
    "bugs": {
    "url": "https://github.com/ether/ep_${PLUGINNAME}/issues",
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/issues",
    },
    "homepage": {
    "url": "https://github.com/ether/ep_${PLUGINNAME}/README.md",
    "url": "https://github.com/${GITNAME}/${PLUGINNAME}/README.md",
    },
    "funding": {
    "type": "individual",
    @@ -91,70 +131,75 @@ cat <<EOF >ep_${PLUGINNAME}/package.json
    }
    }
    EOF
    echo "---> package.json for ${PLUGINNAME} has been created"

    # Creating ep_${PLUGINNAME}/ep.json
    echo "Creating the ep.json for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/ep.json
    # Creating ${PLUGINNAME}/ep.json
    echo "Creating the ep.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/ep.json
    {
    "parts": [
    {
    "name": "main",
    "client_hooks": {
    "aceEditEvent": "ep_PLUGINNAME/static/js/index",
    "postToolbarInit": "ep_PLUGINNAME/static/js/index",
    "aceDomLineProcessLineAttributes": "ep_PLUGINNAME/static/js/index",
    "postAceInit": "ep_PLUGINNAME/static/js/index",
    "aceInitialized": "ep_PLUGINNAME/static/js/index",
    "aceAttribsToClasses": "ep_PLUGINNAME/static/js/index",
    "collectContentPre": "ep_PLUGINNAME/static/js/shared",
    "aceRegisterBlockElements": "ep_PLUGINNAME/static/js/index",
    "aceEditEvent": "${PLUGINNAME}/static/js/index",
    "postToolbarInit": "${PLUGINNAME}/static/js/index",
    "aceDomLineProcessLineAttributes": "${PLUGINNAME}/static/js/index",
    "postAceInit": "${PLUGINNAME}/static/js/index",
    "aceInitialized": "${PLUGINNAME}/static/js/index",
    "aceAttribsToClasses": "${PLUGINNAME}/static/js/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "aceRegisterBlockElements": "${PLUGINNAME}/static/js/index",
    },
    "hooks": {
    "authorize": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME1",
    "authenticate": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME2",
    "expressCreateServer": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME3",
    "eejsBlock_editbarMenuLeft": "ep_PLUGINNAME/index",
    "collectContentPre": "ep_PLUGINNAME/static/js/shared",
    "collectContentPost": "ep_PLUGINNAME/static/js/shared",
    "padInitToolbar": "ep_PLUGINNAME/index",
    "getLineHTMLForExport": "ep_PLUGINNAME/index",
    "authorize": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME1",
    "authenticate": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME2",
    "expressCreateServer": "${PLUGINNAME}/YOURFILE:FUNCTIONNAME3",
    "eejsBlock_editbarMenuLeft": "${PLUGINNAME}/index",
    "collectContentPre": "${PLUGINNAME}/static/js/shared",
    "collectContentPost": "${PLUGINNAME}/static/js/shared",
    "padInitToolbar": "${PLUGINNAME}/index",
    "getLineHTMLForExport": "${PLUGINNAME}/index",
    }
    }
    ]
    }
    EOF
    echo "---> ep.json for ${PLUGINNAME} has been created"

    # Create ep_${PLUGINNAME}/README.md
    echo "Creating the README.md for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/README.md
    # My Example Plugin Name
    ![Publish Status](https://github.com/ether/ep_${PLUGINNAME}/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/ether/ep_${PLUGINNAME}/workflows/Node.js%20Package/badge.svg)
    # Create ${PLUGINNAME}/README.md
    echo "Creating the README.md for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/README.md
    # ${PLUGINNAME}
    ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/${GITNAME}/${PLUGINNAME}/workflows/Node.js%20Package/badge.svg)
    ![Screenshot](https://user-images.githubusercontent.com/220864/107214131-5c3dd600-6a01-11eb-82d9-b2d67ec8ae93.png)
    ## What is this?
    An Etherpad Plugin to apply the ep_${PLUGINNAME} functionality in a pad. (describe in minimum 50 Letters what it is)
    ## What is ${PLUGINNAME}?
    An Etherpad Plugin to apply the ${PLUGINNAME} functionality in a pad. (describe in minimum 50 Letters what it is)
    Currently supports:
    * My example functionality 1
    * My example functionality 2
    * My example functionality 3
    * My example functionality 4
    * ${PLUGINNAME} functionality 1
    * ${PLUGINNAME} functionality 2
    * ${PLUGINNAME} functionality 3
    * ${PLUGINNAME} functionality 4
    ## Export support
    Experimental. As a special attribute on Etherpad, some weirdness may be experienced.
    ## ${PLUGINNAME} Usage
    Experimental. As a special attribute on Etherpad, some weirdness may be experienced by using ${PLUGINNAME}.
    ## History
    I decided to copy/paste the ep_headings2 plugin over ep_align to fix a load of issues.
    ## ${PLUGINNAME} History
    I decided to copy/paste the ep_t3 over ${PLUGINNAME} to create that plugin.
    ## License
    Apache 2
    ## ${PLUGINNAME} License
    ${LICENSE}
    ## Development
    Development did for free to help support continued learning due to disruption by the coronavirus. 26LLC supported.
    ## ${PLUGINNAME} Development
    I did the development for free to help support continued learning due to disruptions by the coronavirus.
    ## Author
    $USERNAME ($AUTHORNAME) - <$AUTHOREMAIL>
    ## ${PLUGINNAME} Author
    $AUTHORNAME ($USERNAME) - <$AUTHOREMAIL>
    ## Funding
    ## ${PLUGINNAME} Contributors
    $CONTRIBUTORSNAME
    ## ${PLUGINNAME} Funding
    Place your funding information here.
    SEND
    @@ -166,22 +211,32 @@ Thanks
    $AUTHORNAME
    EOF
    echo "---> README.md for ${PLUGINNAME} has been created"

    # Create ep_${PLUGINNAME}/LICENSE.MD
    echo "Creating the Apache2.0 LICENSE.md for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/LICENSE.md
    Copyright 2021 [$AUTHORNAME]
    # Create ${PLUGINNAME}/LICENSE.MD
    echo "Creating the Apache2.0 LICENSE.md for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/LICENSE.md
    Copyright 2021 [${AUTHORNAME}]
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
    EOF
    echo "---> LICENSE.md with ${License} for ${PLUGINNAME} has been created"

    # CREATE ep_${PLUGINNAME}/en.json
    echo "Creating the example English language file en.json for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/locales/en.json
    # CREATE ${PLUGINNAME}/en.json
    echo "Creating the example English language file en.json for ${PLUGINNAME} ..."
    cat<<EOF >${PLUGINNAME}/locales/en.json
    {
    "ep_${PLUGINNAME}.toolbar.left.title" : "Left"
    "${PLUGINNAME}.toolbar.left.title" : "Left"
    }
    EOF
    echo "---> The English language file en.json for ${PLUGINNAME} has been created"
    echo
    echo "Congratulations!"
    echo "Your Plugin ${PLUGINNAME} by ${AUTHORNAME}" has been created.
    echo
    find ep_t3_tt -type f,d -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F'\0' '{print $3}'


    cd $PLUGINNAME

    echo "Created the folderstructure and mandatory files for ep_${PLUGINNAME} by $USERNAME ($AUTHORNAME)"
  4. lisandi revised this gist Oct 5, 2021. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,18 @@
    #! /bin/sh

    echo "CREATE YOUR NEW ETHERPAD PLUGIN"
    echo "A. using ep_t3.sh you can develop Modules for T3Pad (ep_t3_), the Pad for education and communities"
    echo "B. using ep_newplugin you can develop Modules for EtherPad by ether (ep_)"
    echo "This script is maintained by LisAndi and MontessoriX - All Inclusive Montessori Education for All"
    echo "T3Pad is the Etherpad for MontessoriX, Homeschoolers and other Communities - <https://t3pad.com>"
    echo "Support us at MontessoriX: <https://ko-fi.com/montessori>"
    echo "Etherpad by the Ether Foundation can be reached at <https://etherpad.org>"
    echo "LisAndi Co., Ltd. - Software development in Paradies - Rawai, Phuket, Thailand - <https://lisandi.com>"
    echo "License: This script is provided under AGPLv.3 <https://www.gnu.org/licenses/agpl-3.0.en.html>"


    echo "Let's start!"

    read -p "Enter the plugin name: ep_" PLUGINNAME
    read -p "Enter a short description - min. 50 letters:" DESCRIPTION
    read -p "Enter your user or nick-name: " USERNAME
  5. lisandi revised this gist Oct 4, 2021. 1 changed file with 54 additions and 39 deletions.
    93 changes: 54 additions & 39 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -1,49 +1,60 @@
    #! /bin/sh

    read -p "Enter the plugin name: ep_" PLUGINNAME
    read -p "Enter a short description - min. 50 letters:" DESCRIPTION
    read -p "Enter your user or nick-name: " USERNAME
    read -p "Enter your real name: " AUTHORNAME
    read -p "Enter your email-address: " AUTHOREMAIL

    # Having shifted twice, the rest is now comments ...
    COMMENTS=$@

    # Creating the directory structure
    mkdir ep_123 ep_123/locales ep_123/static ep_123/static/css ep_123/static/js ep_123/static/image ep_123/static/tests ep_123/templates
    echo "Creating the Folderstructure for ep_${PLUGINNAME} ..."
    mkdir ep_${PLUGINNAME} ep_${PLUGINNAME}/locales ep_${PLUGINNAME}/static ep_${PLUGINNAME}/static/css ep_${PLUGINNAME}/static/js ep_${PLUGINNAME}/static/image ep_${PLUGINNAME}/static/tests ep_${PLUGINNAME}/templates

    # Creating ep_123/package.json
    cat <<EOF >ep_123/package.json
    # Creating ep_${PLUGINNAME}/package.json
    echo "Creating the package.json for ep_${PLUGINNAME} ..."
    cat <<EOF >ep_${PLUGINNAME}/package.json
    {
    "name": "ep_PLUGINNAME",
    "name": "ep_${PLUGINNAME}",
    "version": "0.0.1",
    "description": "DESCRIPTION",
    "description": "$DESCRIPTION",
    "author": {
    "name": "USERNAME (REAL NAME)",
    "email": "<[email protected]>",
    },
    "name": "$USERNAME ($AUTHORNAME)",
    "email": "<$AUTHOREMAIL>",
    },
    "contributors": [
    "CONTRIBUTORNAME (REAL NAME)",
    ],
    ],
    "keywords": [
    "etherpad",
    "plugin",
    "ep",
    ],
    ],
    "license": {
    "Apache2"
    },
    },
    "repository": {
    "type": "git",
    "url": "https://github.com/ether/myplugin.git",
    "url": "https://github.com/ether/ep_${PLUGINNAME}.git",
    },
    "bugs": {
    "url": "https://github.com/ether/myplugin/issues",
    "url": "https://github.com/ether/ep_${PLUGINNAME}/issues",
    },
    "homepage": {
    "url": "https://github.com/ether/myplugin/README.md",
    "url": "https://github.com/ether/ep_${PLUGINNAME}/README.md",
    },
    "funding": {
    "type": "individual",
    "url": "https://etherpad.org/",
    },
    "dependencies": {
    "MODULE": "0.3.20",
    },
    },
    "peerDependencies": {
    "ep_etherpad_lite":">=1.8.6",
    },
    },
    "devDependencies": {
    "eslint": "^7.18.0",
    "eslint-config-etherpad": "^1.0.24",
    @@ -62,14 +73,15 @@ cat <<EOF >ep_123/package.json
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    },
    "engines": {
    "engines": {
    "node": ">= 10.13.0",
    }
    }
    EOF

    # Creating ep_123/ep.json
    cat<<EOF >ep_123/ep.json
    # Creating ep_${PLUGINNAME}/ep.json
    echo "Creating the ep.json for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/ep.json
    {
    "parts": [
    {
    @@ -99,17 +111,15 @@ cat<<EOF >ep_123/ep.json
    }
    EOF

    # Create ep_123/README.md
    cat<<EOF >ep_123/README.md
    # Create ep_${PLUGINNAME}/README.md
    echo "Creating the README.md for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/README.md
    # My Example Plugin Name
    ![Publish Status](https://github.com/ether/ep_my_example/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/ether/ep_my_example/workflows/Node.js%20Package/badge.svg)
    ![Publish Status](https://github.com/ether/ep_${PLUGINNAME}/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/ether/ep_${PLUGINNAME}/workflows/Node.js%20Package/badge.svg)
    ![Screenshot](https://user-images.githubusercontent.com/220864/107214131-5c3dd600-6a01-11eb-82d9-b2d67ec8ae93.png)
    ## What is this?
    An Etherpad Plugin to apply the my_example_plugin functionality (describe what it is) in a pad.
    An Etherpad Plugin to apply the ep_${PLUGINNAME} functionality in a pad. (describe in minimum 50 Letters what it is)
    Currently supports:
    * My example functionality 1
    * My example functionality 2
    @@ -129,31 +139,36 @@ Apache 2
    Development did for free to help support continued learning due to disruption by the coronavirus. 26LLC supported.
    ## Author
    My Example Plugin by XYZ
    $USERNAME ($AUTHORNAME) - <$AUTHOREMAIL>
    ## Funding
    Place your funding information here.
    EOF
    SEND
    MORE
    -----
    MONEY
    # Create ep_123/LICENSE.MD
    cat<<EOF >ep_123/LICENSE.md
    Copyright 2021 [ENTER YOUR FULL REAL NAME]
    Thanks
    $AUTHORNAME
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
    EOF

    # Create ep_${PLUGINNAME}/LICENSE.MD
    echo "Creating the Apache2.0 LICENSE.md for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/LICENSE.md
    Copyright 2021 [$AUTHORNAME]
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
    EOF

    # CREATE ep_123/en.json
    cat<<EOF >ep_123/locales/en.json
    # CREATE ep_${PLUGINNAME}/en.json
    echo "Creating the example English language file en.json for ep_${PLUGINNAME} ..."
    cat<<EOF >ep_${PLUGINNAME}/locales/en.json
    {
    "ep_my_example.toolbar.left.title" : "Left"
    "ep_${PLUGINNAME}.toolbar.left.title" : "Left"
    }
    EOF

    # renaming the main directory
    mv ep_123 ep_my_example


    echo "Created the folderstructure and mandatory files for ep_${PLUGINNAME} by $USERNAME ($AUTHORNAME)"
  6. lisandi revised this gist Oct 3, 2021. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    # Creating the directory structure
    mkdir ep_123 ep_123/locales ep_123/static ep_123/static/css ep_123/static/js ep_123/static/image ep_123/static/tests ep_123/templates
    &

    # Creating ep_123/package.json
    cat <<EOF >ep_123/package.json
    {
    @@ -67,7 +67,7 @@ cat <<EOF >ep_123/package.json
    }
    }
    EOF
    &

    # Creating ep_123/ep.json
    cat<<EOF >ep_123/ep.json
    {
    @@ -98,7 +98,7 @@ cat<<EOF >ep_123/ep.json
    ]
    }
    EOF
    &

    # Create ep_123/README.md
    cat<<EOF >ep_123/README.md
    # My Example Plugin Name
    @@ -135,7 +135,7 @@ My Example Plugin by XYZ
    Place your funding information here.
    EOF
    &

    # Create ep_123/LICENSE.MD
    cat<<EOF >ep_123/LICENSE.md
    Copyright 2021 [ENTER YOUR FULL REAL NAME]
    @@ -145,14 +145,14 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
    EOF
    &

    # CREATE ep_123/en.json
    cat<<EOF >ep_123/locales/en.json
    {
    "ep_my_example.toolbar.left.title" : "Left"
    }
    EOF
    &

    # renaming the main directory
    mv ep_123 ep_my_example

  7. lisandi renamed this gist Oct 3, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ep_newplugin.txt → ep_newplugin.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #! /bin/sh

    # Creating the directory structure
    mkdir ep_123 ep_123/locales ep_123/static ep_123/static/css ep_123/static/js ep_123/static/image ep_123/static/tests ep_123/templates
    &
  8. lisandi created this gist Oct 3, 2021.
    157 changes: 157 additions & 0 deletions ep_newplugin.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,157 @@
    # Creating the directory structure
    mkdir ep_123 ep_123/locales ep_123/static ep_123/static/css ep_123/static/js ep_123/static/image ep_123/static/tests ep_123/templates
    &
    # Creating ep_123/package.json
    cat <<EOF >ep_123/package.json
    {
    "name": "ep_PLUGINNAME",
    "version": "0.0.1",
    "description": "DESCRIPTION",
    "author": {
    "name": "USERNAME (REAL NAME)",
    "email": "<[email protected]>",
    },
    "contributors": [
    "CONTRIBUTORNAME (REAL NAME)",
    ],
    "keywords": [
    "etherpad",
    "plugin",
    "ep",
    ],
    "license": {
    "Apache2"
    },
    "repository": {
    "type": "git",
    "url": "https://github.com/ether/myplugin.git",
    },
    "bugs": {
    "url": "https://github.com/ether/myplugin/issues",
    },
    "homepage": {
    "url": "https://github.com/ether/myplugin/README.md",
    },
    "funding": {
    "type": "individual",
    "url": "https://etherpad.org/",
    },
    "dependencies": {
    "MODULE": "0.3.20",
    },
    "peerDependencies": {
    "ep_etherpad_lite":">=1.8.6",
    },
    "devDependencies": {
    "eslint": "^7.18.0",
    "eslint-config-etherpad": "^1.0.24",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-mocha": "^8.0.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prefer-arrow": "^1.2.3",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
    },
    "eslintConfig": {
    "root": true,
    "extends": "etherpad/plugin",
    },
    "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    },
    "engines": {
    "node": ">= 10.13.0",
    }
    }
    EOF
    &
    # Creating ep_123/ep.json
    cat<<EOF >ep_123/ep.json
    {
    "parts": [
    {
    "name": "main",
    "client_hooks": {
    "aceEditEvent": "ep_PLUGINNAME/static/js/index",
    "postToolbarInit": "ep_PLUGINNAME/static/js/index",
    "aceDomLineProcessLineAttributes": "ep_PLUGINNAME/static/js/index",
    "postAceInit": "ep_PLUGINNAME/static/js/index",
    "aceInitialized": "ep_PLUGINNAME/static/js/index",
    "aceAttribsToClasses": "ep_PLUGINNAME/static/js/index",
    "collectContentPre": "ep_PLUGINNAME/static/js/shared",
    "aceRegisterBlockElements": "ep_PLUGINNAME/static/js/index",
    },
    "hooks": {
    "authorize": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME1",
    "authenticate": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME2",
    "expressCreateServer": "ep_PLUGINNAME/YOURFILE:FUNCTIONNAME3",
    "eejsBlock_editbarMenuLeft": "ep_PLUGINNAME/index",
    "collectContentPre": "ep_PLUGINNAME/static/js/shared",
    "collectContentPost": "ep_PLUGINNAME/static/js/shared",
    "padInitToolbar": "ep_PLUGINNAME/index",
    "getLineHTMLForExport": "ep_PLUGINNAME/index",
    }
    }
    ]
    }
    EOF
    &
    # Create ep_123/README.md
    cat<<EOF >ep_123/README.md
    # My Example Plugin Name

    ![Publish Status](https://github.com/ether/ep_my_example/workflows/Node.js%20Package/badge.svg) ![Publish Status](https://github.com/ether/ep_my_example/workflows/Node.js%20Package/badge.svg)

    ![Screenshot](https://user-images.githubusercontent.com/220864/107214131-5c3dd600-6a01-11eb-82d9-b2d67ec8ae93.png)

    ## What is this?
    An Etherpad Plugin to apply the my_example_plugin functionality (describe what it is) in a pad.

    Currently supports:
    * My example functionality 1
    * My example functionality 2
    * My example functionality 3
    * My example functionality 4

    ## Export support
    Experimental. As a special attribute on Etherpad, some weirdness may be experienced.

    ## History
    I decided to copy/paste the ep_headings2 plugin over ep_align to fix a load of issues.

    ## License
    Apache 2

    ## Development
    Development did for free to help support continued learning due to disruption by the coronavirus. 26LLC supported.

    ## Author
    My Example Plugin by XYZ

    ## Funding
    Place your funding information here.

    EOF
    &
    # Create ep_123/LICENSE.MD
    cat<<EOF >ep_123/LICENSE.md
    Copyright 2021 [ENTER YOUR FULL REAL NAME]

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
    EOF
    &
    # CREATE ep_123/en.json
    cat<<EOF >ep_123/locales/en.json
    {
    "ep_my_example.toolbar.left.title" : "Left"
    }
    EOF
    &
    # renaming the main directory
    mv ep_123 ep_my_example