config.ts 611 B

123456789101112131415161718192021
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { ConfigWithDefaults, ConfigSection } from '@jupyterlab/services';
  4. import { log } from './log';
  5. export async function main() {
  6. log('Config');
  7. // The base url of the Jupyter server.
  8. const section = await ConfigSection.create({ name: 'notebook' });
  9. const config = new ConfigWithDefaults({
  10. section,
  11. defaults: { default_cell_type: 'code' },
  12. className: 'Notebook'
  13. });
  14. log(config.get('default_cell_type')); // 'code'
  15. const data = await config.set('foo', 'bar');
  16. log(data);
  17. }