Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use custom svg icons by gulp #762

Open
Klap-in opened this issue May 22, 2022 · 1 comment
Open

use custom svg icons by gulp #762

Klap-in opened this issue May 22, 2022 · 1 comment

Comments

@Klap-in
Copy link

Klap-in commented May 22, 2022

I try to use custom svg icons in the contextmenu.
I try to understand how I could use this instruction (unfortunately I'm new to npm/node.js)
https://swisnl.github.io/jQuery-contextMenu/docs/customize.html

In this issue I found the some practical steps:
#492:

What icons are you using? Are you trying to add SVG icons? If so so the following (with npm installed ;))

Clone the repository
Add the icons to ./src/icons/
Run npm install
Run gulp css

(installed node with as snap on my Ubuntu 20.04 system sudo snap install node --classic --channel=16)

$ node --version
v16.15.0
$ npx --version
8.5.5
$ npm --version
8.5.5

npm install results in:

npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/karma
npm ERR!   dev karma@"^5.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer karma@"^4.0.0" from [email protected]
npm ERR! node_modules/karma-qunit
npm ERR!   dev karma-qunit@"^4.0.0" from the root project

After removing "karma-qunit": "^4.0.0", it makes more progress.
karma-qunit latest version is 4.1.2, so I would guess it could be resolved, but I have no experience yet, so sure I overlooked the right bits.

After that it throws:

npm ERR! code 127
npm ERR! path /home/user/...<path>..../jQuery-contextMenu/node_modules/fibers
npm ERR! command failed
npm ERR! command sh -c node build.js || nodejs build.js
npm ERR! sh: 1: nodejs: not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-05-22T13_49_40_095Z-debug-0.log

Probably this is more miss understanding of the npm tool, and not so much jQuery-contextmenu. But external pointers are welcome.

Also gulp build-icons does not deliver.
It proposes yarn add gulp because no local gulp is found. Trying this, results in similar error and a lot of extra big amounts of logging of messages.. But as new user of these tools, I do not get the right gist from it.

@splitbrain
Copy link

Just a few thoughts:

The broken karma-qunit dependency looks like a bug to me. I think the dependencies need to be adjusted.

sh -c node build.js

This seems to be wrong, too. The repository does not contain any build.js file. It was probably dropped when moving to gulp.

Looking at the build-icons gulp task, it seems that it tries to build a custom icon font from the given SVG files. I wonder if it would be possible to use inline SVGs instead and thus not require a build process at all to customize the icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants