Skip to content

Commit a2b6663

Browse files
committed
Support custom hypothesis client url
fixes #4840
1 parent cf783ff commit a2b6663

File tree

7 files changed

+33
-10
lines changed

7 files changed

+33
-10
lines changed

news/changelog-1.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Add support for showing cross reference contents on hover (use `crossrefs-hover: false` to disable).
2020
- Add support for displaying `keywords` in HTML page title block, when present.
2121
- ([#3473](https://github.com/quarto-dev/quarto-cli/issues/3473)): Add support for `body-right` and `body-left` layouts for Website Table of Contents.
22+
- ([#4840](https://github.com/quarto-dev/quarto-cli/issues/4840)): Add support for specifying a custom Hypothesis client url using `client-url`
2223
- ([#4882](https://github.com/quarto-dev/quarto-cli/issues/4882)): Add support for `canonical-url`, which when provided will include a link tag with rel='canonical' which will use an explictly provided or automatically generated canonical url for the document.
2324
- ([#5189](https://github.com/quarto-dev/quarto-cli/issues/5189)): Ensure appendix shows even when `page-layout` is custom.
2425
- ([#5210](https://github.com/quarto-dev/quarto-cli/issues/5210)): Update to Bootstrap 5.2.2

src/resources/editor/tools/vs-code.mjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8697,6 +8697,11 @@ var require_yaml_intelligence_resources = __commonJS({
86978697
object: {
86988698
closed: true,
86998699
properties: {
8700+
"client-url": {
8701+
string: {
8702+
description: "Override the default hypothesis client url with a custom client url."
8703+
}
8704+
},
87008705
openSidebar: {
87018706
boolean: {
87028707
default: false,
@@ -22581,12 +22586,12 @@ var require_yaml_intelligence_resources = __commonJS({
2258122586
mermaid: "%%"
2258222587
},
2258322588
"handlers/mermaid/schema.yml": {
22584-
_internalId: 180637,
22589+
_internalId: 180639,
2258522590
type: "object",
2258622591
description: "be an object",
2258722592
properties: {
2258822593
"mermaid-format": {
22589-
_internalId: 180629,
22594+
_internalId: 180631,
2259022595
type: "enum",
2259122596
enum: [
2259222597
"png",
@@ -22602,7 +22607,7 @@ var require_yaml_intelligence_resources = __commonJS({
2260222607
exhaustiveCompletions: true
2260322608
},
2260422609
theme: {
22605-
_internalId: 180636,
22610+
_internalId: 180638,
2260622611
type: "anyOf",
2260722612
anyOf: [
2260822613
{

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,11 @@
16691669
"object": {
16701670
"closed": true,
16711671
"properties": {
1672+
"client-url": {
1673+
"string": {
1674+
"description": "Override the default hypothesis client url with a custom client url."
1675+
}
1676+
},
16721677
"openSidebar": {
16731678
"boolean": {
16741679
"default": false,
@@ -15553,12 +15558,12 @@
1555315558
"mermaid": "%%"
1555415559
},
1555515560
"handlers/mermaid/schema.yml": {
15556-
"_internalId": 180637,
15561+
"_internalId": 180639,
1555715562
"type": "object",
1555815563
"description": "be an object",
1555915564
"properties": {
1556015565
"mermaid-format": {
15561-
"_internalId": 180629,
15566+
"_internalId": 180631,
1556215567
"type": "enum",
1556315568
"enum": [
1556415569
"png",
@@ -15574,7 +15579,7 @@
1557415579
"exhaustiveCompletions": true
1557515580
},
1557615581
"theme": {
15577-
"_internalId": 180636,
15582+
"_internalId": 180638,
1557815583
"type": "anyOf",
1557915584
"anyOf": [
1558015585
{

src/resources/formats/html/hypothesis/hypothesis.ejs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
<% let srcHref = "https://hypothes.is/embed.js"; %>
12
<% if (typeof(hypothesis) === "object") { %>
3+
<% if (hypothesis['client-url']) { srcHref = hypothesis['client-url']; } %>
24
<script type="application/json" class="js-hypothesis-config">
35
<%= JSON.stringify(hypothesis, undefined, 2) %>
46
</script>
57
<% } %>
6-
<script async src="https://hypothes.is/embed.js"></script>
8+
<script async src="<%= srcHref %>"></script>
79
<script>
810
window.document.addEventListener("DOMContentLoaded", function (_event) {
911
document.body.classList.add('hypothesis-enabled');

src/resources/schema/definitions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@
303303
- object:
304304
closed: true
305305
properties:
306+
client-url:
307+
string:
308+
description: Override the default hypothesis client url with a custom client url.
306309
openSidebar:
307310
boolean:
308311
default: false

src/resources/types/schema-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ the discussions feature must be enabled. */;
148148
}; /* The giscus theme to use when displaying comments. */
149149
};
150150
hypothesis?: boolean | {
151+
"client-url"?:
152+
string /* Override the default hypothesis client url with a custom client url. */;
151153
assetRoot?: string /* The root URL from which assets are loaded. */;
152154
branding?: {
153155
accentColor?:

0 commit comments

Comments
 (0)