Source Explorer

A helpful widget for viewing the source of a dat site.

dat site | git repo


Import the CSS and Javascript into your site. In your HTML:

<link rel="stylesheet" href="dat://">

In your Javascript:

import * as explorer from 'dat://'

explorer.setup(document.body, {
  url: window.location.toString(), // defaults to window.location
  folder: '/',                     // defaults to '/'
  file: 'index.html'               // defaults to 'index.html'