jupyterlab / theme-cookiecutter Goto Github PK
View Code? Open in Web Editor NEWA cookiecutter template to help you make new JupyterLab theme extensions
License: BSD 3-Clause "New" or "Revised" License
A cookiecutter template to help you make new JupyterLab theme extensions
License: BSD 3-Clause "New" or "Revised" License
Hi!
I input text "microcoder" in a field org_name
, after that begin install the package and I got an error:
jupyter labextension install .
An error occured.
ValueError: "/home/alpine/juptheme/jupyterlab-ubu-theme" is not a valid npm package
See the log file for details: /tmp/jupyterlab-debug-4e18d3kv.log
/tmp/jupyterlab-debug-4e18d3kv.log:
Node v12.15.0
Yarn configuration loaded.
> node /usr/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install
yarn install v1.21.1
error package.json: Name contains illegal characters
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> /usr/bin/npm pack /home/alpine/juptheme/jupyterlab-ubu-theme
npm ERR! Invalid name: "microcoder/jupyterlab-ubu-theme"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/alpine/.npm/_logs/2020-04-03T06_20_28_921Z-debug.log
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
yield
File "/usr/lib/python3.8/site-packages/jupyterlab/labextensions.py", line 93, in start
ans = self.run_task()
File "/usr/lib/python3.8/site-packages/jupyterlab/labextensions.py", line 138, in run_task
return any([
File "/usr/lib/python3.8/site-packages/jupyterlab/labextensions.py", line 139, in <listcomp>
install_extension(
File "/usr/lib/python3.8/site-packages/jupyterlab/commands.py", line 388, in install_extension
return handler.install_extension(extension, pin=pin)
File "/usr/lib/python3.8/site-packages/jupyterlab/commands.py", line 603, in install_extension
info = self._install_extension(extension, tempdir, pin=pin)
File "/usr/lib/python3.8/site-packages/jupyterlab/commands.py", line 1499, in _install_extension
info = self._extract_package(extension, tempdir, pin=pin)
File "/usr/lib/python3.8/site-packages/jupyterlab/commands.py", line 1578, in _extract_package
raise ValueError(msg % source)
ValueError: "/home/alpine/juptheme/jupyterlab-ubu-theme" is not a valid npm package
Exiting application: jupyter
First I'd like to say thank you for putting this together. I'd been searching for a while now for a way to make my custom theme work. From what I've seen, this is necessary for the icons to work with a custom theme. The install, and subsequent rebuild doesn't seem to copy over the svg files so the console is littered with 404's but having it run through webpack obviously doesn't have this issue.
Originally posted by @mountain01 in #1 (comment)
The issue that @mountain01 pointed out is actually separate from the webpack discussion. The file specifiers in the package.json
template are too specific, and so miss certain files.
(See my post here on the Jupyter forums)
New to notebook extensions and most all web development concepts. I’m attempting to change JupyterLab’s favicon using this cookiecutter theme, with the ultimate goal of being able to change the favicon based on a config file. I’m using a slight modification of this SOF post, included within my src/index.ts
file.
let head = document.head || document.getElementsByTagName('head')[0];
function changeFavicon(src: string) {
let link = document.createElement('link'),
oldLink = document.getElementById('dynamic-favicon');
link.id = 'dynamic-favicon';
link.rel = 'icon';
link.type = 'image/x-icon';
link.href = src;
if (oldLink) {
head.removeChild(oldLink);
}
head.appendChild(link);
}
When I call…
changeFavicon('http://www.google.com/favicon.ico');
…the favicon changes appropriately. But how would I access a favicon.ico
file stored within my very own local extension directory?
A step further, how could I change the path to different favicon files using a config file?
Follow-up Pr
To reduce maintenance burden this merge https://github.com/jupyterlab/theme-cookiecutter
+1, since the theme cookiecutter can easily get out of sync and doesn't necessarily benefit from the improvements made to the ts cookiecutter here (for example CI and releaser config).
Some follow-up steps that come to mind:
Originally posted by @jtpio in jupyterlab/extension-cookiecutter-ts#196 (comment)
I'm trying to build a theme, and it's hard to figure out what some of the css variables do. Example:
--jp-mirror-editor-variable-color: var(--foreground-light);
--jp-mirror-editor-variable-2-color: var(--magenta);
--jp-mirror-editor-variable-3-color: var(--gray);
In this example, --jp-mirror-editor-variable-color
appears to change all variables, while variable-2-color
and variable-3-color
don't do anything.
Additional documentation (inline with the template or in the readme / wiki) would be super helpful!
If you try to import a font, say with
@font-face {
font-family: 'Whatever';
src: url('fonts/Whatever.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
Then building jupyterlab with the extension will fail with error:
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
Error: Automatic publicPath is not supported in this browser
I think the cookiecutter version only serves files in the root, while icons, etc are deeper down, also
perhaps missing some types (svg, png, etc)
From package.json:
cookiecutter version:
"style/*.css",
"style/*.ttf",
"style/*.eot",
"style/*.woff",
"style/*.woff2"
theme-light-extension version:
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.