From 53a9196d19dc361262632c776d71331c5c0f65c7 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Fri, 11 Aug 2023 12:47:06 +0100 Subject: [PATCH] Experimenting with limited use of Markdown in extension documentation --- README.md | 2 +- build.txt | 4 +-- .../Chapter 7/Documentation Renderer.w | 6 ++++- inform7/Internal/HTML/macos-platform.css | 25 +++++++++++++++++++ .../Inter/Architecture16Kit/kit_metadata.json | 2 +- .../Inter/Architecture32Kit/kit_metadata.json | 2 +- .../Inter/BasicInformKit/kit_metadata.json | 2 +- .../Inter/CommandParserKit/kit_metadata.json | 2 +- .../EnglishLanguageKit/kit_metadata.json | 2 +- .../Inter/WorldModelKit/kit_metadata.json | 2 +- 10 files changed, 39 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cac82f7ec..e01794337 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inform 7 -[Version](notes/versioning.md): 10.2.0-beta+6W99 'Krypton' (9 August 2023) +[Version](notes/versioning.md): 10.2.0-beta+6X01 'Krypton' (11 August 2023) ## About Inform diff --git a/build.txt b/build.txt index 640ab608b..79dfe4c26 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: beta -Build Date: 9 August 2023 -Build Number: 6W99 +Build Date: 11 August 2023 +Build Number: 6X01 diff --git a/inbuild/supervisor-module/Chapter 7/Documentation Renderer.w b/inbuild/supervisor-module/Chapter 7/Documentation Renderer.w index d128f2a4c..16b6dd2fb 100644 --- a/inbuild/supervisor-module/Chapter 7/Documentation Renderer.w +++ b/inbuild/supervisor-module/Chapter 7/Documentation Renderer.w @@ -656,9 +656,13 @@ had its infamous PNG transparency bug.) = void DocumentationRenderer::render_text(OUTPUT_STREAM, text_stream *text) { - WRITE("%S", text); + markdown_item *md = Markdown::parse(text); + HTML_OPEN_WITH("span", "class=\"markdowncontent\""); + Markdown::render_md_purist(OUT, md); + HTML_CLOSE("span"); } +@ = void DocumentationRenderer::syntax_coloured_code(OUTPUT_STREAM, text_stream *text, text_stream *colouring, int from, int to) { wchar_t current_col = 0; diff --git a/inform7/Internal/HTML/macos-platform.css b/inform7/Internal/HTML/macos-platform.css index 34eb9a505..ae9a88625 100644 --- a/inform7/Internal/HTML/macos-platform.css +++ b/inform7/Internal/HTML/macos-platform.css @@ -41,6 +41,8 @@ --paste-active-colour: #803030; --paste-passive-colour: #303030; --paste-background-colour: #f3f6fa; + + --md-background-colour: #e3e6ea; } @media (prefers-color-scheme: dark) { @@ -86,6 +88,8 @@ --paste-active-colour: #a05050; --paste-passive-colour: #505050; --paste-background-colour: #090b0d; + + --md-background-colour: #090b0d; } } @@ -549,6 +553,27 @@ button.dangerousbutton { cursor: pointer; } +/* Used in rendering Markdown in extension documentation */ + +.markdowncontent em { font-style: italic; } +.markdowncontent strong { font-weight: bold; } +.markdowncontent code { + font-size: 85%; + font-family: SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; + background-color: var(--md-background-colour); + border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; + box-sizing: border-box; + padding-bottom: 2.38px; + padding-left: 4.76px; + padding-right: 4.76px; + padding-top: 2.38px; + white-space: break-spaces; + width: auto; +} + /* Used in syntax-colouring for extension documentation */ span.syntaxdefinition { color: var(--syntaxdefinition-colour); } diff --git a/inform7/Internal/Inter/Architecture16Kit/kit_metadata.json b/inform7/Internal/Inter/Architecture16Kit/kit_metadata.json index 45143203b..3bf4f48da 100644 --- a/inform7/Internal/Inter/Architecture16Kit/kit_metadata.json +++ b/inform7/Internal/Inter/Architecture16Kit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "Architecture16Kit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "compatibility": "16-bit", "kit-details": { diff --git a/inform7/Internal/Inter/Architecture32Kit/kit_metadata.json b/inform7/Internal/Inter/Architecture32Kit/kit_metadata.json index 56f5d6dea..c311986f1 100644 --- a/inform7/Internal/Inter/Architecture32Kit/kit_metadata.json +++ b/inform7/Internal/Inter/Architecture32Kit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "Architecture32Kit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "compatibility": "32-bit", "kit-details": { diff --git a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json index 5ed451f1d..7c13044f1 100644 --- a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformKit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json index 35ae60f1f..5e857a4e5 100644 --- a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json +++ b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "CommandParserKit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json index 333be6454..ce78d4a09 100644 --- a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json +++ b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "EnglishLanguageKit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json index f3afa2933..22af11609 100644 --- a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json +++ b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "WorldModelKit", - "version": "10.2.0-beta+6W99" + "version": "10.2.0-beta+6X01" }, "needs": [ { "need": {