.lit Config

This file is special in that it is parsed and any !plugins it contains are pre-populated for all other .lit documents in this .lit notebook.

Table of Contents

Settings

Not yet Implemented the below are mocks while we decide on the interface. Just another kind of !plugin? data exports could work the same...

GitHub

Set up a GitHub repository to save your updates to. Just run the Cell below. Requires a GitHub Access Token.

htmlinlinehidemeta
jsrun_mesetup> md
return lit.config.setupGithubAccess(token.value)
mdUpdated 68.9w ago

All set up.

{ token: '••••••••••', username: 'dotlitdev', repository: 'dotlit', branch: 'main', prefix: 'src' }

Theme

jsplugintype=themeid=test
export const theme = {
  url: "//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.0.0/build/styles/sunburst.min.css",
};

jsplugindisabletype=themeid=test2
export const theme = {
  value: "body {--bg: #efefef;}",
};

cssplugintype=theme
body {
  --bg: white;
  --bg-secondary-color: #efefef;
    
  --text-color: black;
  --text-secondary-color: grey;
  --text-primary-color: #9999f7;
  --text-highlight-bg: yellow;
  --text-highlight-color: black;

  --divider-subtle: #efefef;
  --medium-space: 0.4em;
  --code-bg-color: black;
  --code-text-color: white;
  --box-bg-opacity: 0.05;
}

Custom plugins

See plugin system for information on how to create !plugins and the various types.

js
const all = lit.file.data.plugins
return Object.keys(all).map(t=>`${t} (${Object.keys(all[t]).length})`)
txtUpdated 68.9w ago
[ 'theme (3)', 'viewer (2)' ]
mdinfo

ℹ️ Move, copy or transclude any document specific !plugin here to have it apply to all documents.

Register Service Worker

jsplugindisabletype=onloadid=sw
export const onload = () => {
  if ('serviceWorker' in navigator) {
    navigator
      .serviceWorker
      .register('/serviceworker.js');
  }
}

Prettier js transformer

Upload file

uploadusage

Detach/delete attached output

Sections depths

Multi select menu

json2 viewer

Implementation:

Example usage:

json2inline

CORS Proxy

Cors proxy see testing/Cors proxy

Plantuml viewer & repl

Uses plantuml.com to create svg images from uml source. Not included as a default viewer due to the external dependency, but it's great! See plugins/viewers/plantuml/plantuml for more.

Implementation:

Example usage:

umlinlineviewer
@startmindmap
* .lit
	* Digital Gardens
		* Tools for Thought
		* Learning in Public
			* Thinking in Public
		* Knowledge Graph
	* Literate Programming
		* Read Eval Print Loop
		* Runbooks
		* Interactive Notebooks
	* Guided Learning
		* Show don't Tell
		* No Code
			* Low Code
				* More Code	
	* Rapid Prototyping
@endmindmap
imgtesting/repl-output.svgUpdated 139.0w ago

Urgh, CORS...

So to bypass CORS we need a proxy, see testing/runkit for an example nodejs repl, which could achieve this proxying.

Fixed see testing/Cors Proxy for example.

Miscellaneous