Skip to content

Commit

Permalink
Support custom hypothesis client url
Browse files Browse the repository at this point in the history
fixes #4840
  • Loading branch information
dragonstyle committed Dec 6, 2023
1 parent cf783ff commit a2b6663
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 10 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Add support for showing cross reference contents on hover (use `crossrefs-hover: false` to disable).
- Add support for displaying `keywords` in HTML page title block, when present.
- ([#3473](https://github.com/quarto-dev/quarto-cli/issues/3473)): Add support for `body-right` and `body-left` layouts for Website Table of Contents.
- ([#4840](https://github.com/quarto-dev/quarto-cli/issues/4840)): Add support for specifying a custom Hypothesis client url using `client-url`
- ([#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.
- ([#5189](https://github.com/quarto-dev/quarto-cli/issues/5189)): Ensure appendix shows even when `page-layout` is custom.
- ([#5210](https://github.com/quarto-dev/quarto-cli/issues/5210)): Update to Bootstrap 5.2.2
Expand Down
11 changes: 8 additions & 3 deletions src/resources/editor/tools/vs-code.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8697,6 +8697,11 @@ var require_yaml_intelligence_resources = __commonJS({
object: {
closed: true,
properties: {
"client-url": {
string: {
description: "Override the default hypothesis client url with a custom client url."
}
},
openSidebar: {
boolean: {
default: false,
Expand Down Expand Up @@ -22581,12 +22586,12 @@ var require_yaml_intelligence_resources = __commonJS({
mermaid: "%%"
},
"handlers/mermaid/schema.yml": {
_internalId: 180637,
_internalId: 180639,
type: "object",
description: "be an object",
properties: {
"mermaid-format": {
_internalId: 180629,
_internalId: 180631,
type: "enum",
enum: [
"png",
Expand All @@ -22602,7 +22607,7 @@ var require_yaml_intelligence_resources = __commonJS({
exhaustiveCompletions: true
},
theme: {
_internalId: 180636,
_internalId: 180638,
type: "anyOf",
anyOf: [
{
Expand Down
11 changes: 8 additions & 3 deletions src/resources/editor/tools/yaml/web-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/resources/editor/tools/yaml/yaml-intelligence-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,11 @@
"object": {
"closed": true,
"properties": {
"client-url": {
"string": {
"description": "Override the default hypothesis client url with a custom client url."
}
},
"openSidebar": {
"boolean": {
"default": false,
Expand Down Expand Up @@ -15553,12 +15558,12 @@
"mermaid": "%%"
},
"handlers/mermaid/schema.yml": {
"_internalId": 180637,
"_internalId": 180639,
"type": "object",
"description": "be an object",
"properties": {
"mermaid-format": {
"_internalId": 180629,
"_internalId": 180631,
"type": "enum",
"enum": [
"png",
Expand All @@ -15574,7 +15579,7 @@
"exhaustiveCompletions": true
},
"theme": {
"_internalId": 180636,
"_internalId": 180638,
"type": "anyOf",
"anyOf": [
{
Expand Down
4 changes: 3 additions & 1 deletion src/resources/formats/html/hypothesis/hypothesis.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<% let srcHref = "https://hypothes.is/embed.js"; %>
<% if (typeof(hypothesis) === "object") { %>
<% if (hypothesis['client-url']) { srcHref = hypothesis['client-url']; } %>
<script type="application/json" class="js-hypothesis-config">
<%= JSON.stringify(hypothesis, undefined, 2) %>
</script>
<% } %>
<script async src="https://hypothes.is/embed.js"></script>
<script async src="<%= srcHref %>"></script>
<script>
window.document.addEventListener("DOMContentLoaded", function (_event) {
document.body.classList.add('hypothesis-enabled');
Expand Down
3 changes: 3 additions & 0 deletions src/resources/schema/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@
- object:
closed: true
properties:
client-url:
string:
description: Override the default hypothesis client url with a custom client url.
openSidebar:
boolean:
default: false
Expand Down
2 changes: 2 additions & 0 deletions src/resources/types/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ the discussions feature must be enabled. */;
}; /* The giscus theme to use when displaying comments. */
};
hypothesis?: boolean | {
"client-url"?:
string /* Override the default hypothesis client url with a custom client url. */;
assetRoot?: string /* The root URL from which assets are loaded. */;
branding?: {
accentColor?:
Expand Down

0 comments on commit a2b6663

Please sign in to comment.