diff --git a/public/js/editorpreviews.js b/public/js/editorpreviews.js deleted file mode 100644 index 6f51f815..00000000 --- a/public/js/editorpreviews.js +++ /dev/null @@ -1,33 +0,0 @@ -importScripts('../go_wasm_exec.js'); - -/* -NOTE(ben): The structure here is a little funny but allows for some debouncing. Any postMessages -that got queued up can run all at once, then it can process the latest one. - */ - -let ready = false; -let inputData = null; - -onmessage = ({ data }) => { - inputData = data; - setTimeout(doPreview, 0); -} - -const go = new Go(); -WebAssembly.instantiateStreaming(fetch('../parsing.wasm'), go.importObject) - .then(result => { - go.run(result.instance); // don't await this; we want it to be continuously running - ready = true; - setTimeout(doPreview, 0); - }); - -const doPreview = () => { - if (!ready || inputData === null) { - return; - } - - const result = parseMarkdown(inputData); - inputData = null; - - postMessage(result); -} diff --git a/public/style.css b/public/style.css index 41b17fa5..3bcc7d1b 100644 --- a/public/style.css +++ b/public/style.css @@ -7289,6 +7289,9 @@ hr { border-top-style: solid; max-width: 300px; } +.mono { + font-family: "Fira Mono", monospace; } + article code { font-family: "Fira Mono", monospace; } @@ -7443,6 +7446,9 @@ article code { .minh-5 { min-height: 16rem; } +.minh-6 { + min-height: 32rem; } + .fira { font-family: "Fira Sans", sans-serif; } @@ -8004,27 +8010,10 @@ pre { border: 0px solid transparent; /* Not themed */ } -.editor .toolbar { - width: 95%; - margin: 10px auto; } - .editor .toolbar select { - font-size: 10pt; - border: 0px; } - .editor .toolbar select:hover { - border: 0px; } - .editor .toolbar select:focus { - border: 0px; } - .editor .toolbar #bold { - font-weight: bold; } - .editor .toolbar #italic { - font-style: italic; } - .editor .toolbar #underline { - text-decoration: underline; } - .editor .toolbar #monospace { - font-family: monospace; } - .editor .toolbar #url { - text-decoration: underline; - font-style: italic; } +@media screen and (min-width: 30em) { + #preview-container { + max-height: calc(100vh - 20rem); + overflow: auto; } } .edit-form .error { margin-left: 5em; diff --git a/src/migration/migration.go b/src/migration/migration.go index 84a46ec1..82a14100 100644 --- a/src/migration/migration.go +++ b/src/migration/migration.go @@ -115,13 +115,23 @@ func getCurrentVersion(ctx context.Context, conn *pgx.Conn) (types.MigrationVers return types.MigrationVersion(currentVersion), nil } -func ListMigrations() { - ctx := context.Background() +func tryGetCurrentVersion(ctx context.Context) types.MigrationVersion { + defer func() { + recover() + }() conn := db.NewConn() defer conn.Close(ctx) currentVersion, _ := getCurrentVersion(ctx, conn) + + return currentVersion +} + +func ListMigrations() { + ctx := context.Background() + + currentVersion := tryGetCurrentVersion(ctx) for _, version := range getSortedMigrationVersions() { migration := migrations.All[version] indicator := " "