From 244d793704e32ed70e1d04b61ec8482d908b0b71 Mon Sep 17 00:00:00 2001 From: Babibubebon Date: Mon, 5 Sep 2022 03:52:33 +0900 Subject: [PATCH] add shortcodes for YASGUI --- assets/_custom.scss | 13 +++++-- assets/_fonts.scss | 2 +- assets/_variables.scss | 3 ++ config.toml | 20 ++++++++++- content/_index.md | 4 +++ content/docs/mediaartsdb.md | 50 ++++++++++++++++++++++++++ content/docs/start.md | 1 + layouts/partials/docs/inject/head.html | 30 ++++++++++++++++ layouts/shortcodes/yasgui-query.html | 7 ++++ layouts/shortcodes/yasgui.html | 29 +++++++++++++++ 10 files changed, 155 insertions(+), 4 deletions(-) create mode 100644 assets/_variables.scss create mode 100644 content/docs/mediaartsdb.md create mode 100644 layouts/partials/docs/inject/head.html create mode 100644 layouts/shortcodes/yasgui-query.html create mode 100644 layouts/shortcodes/yasgui.html diff --git a/assets/_custom.scss b/assets/_custom.scss index c34491f..aad17b2 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -1,9 +1,18 @@ body { - overflow-wrap: break-word; - word-break: keep-all; + overflow-wrap: break-word; + word-break: keep-all; font-family: 'Noto Sans JP', sans-serif; } +code, .CodeMirror * { + font-family: 'M PLUS 1 Code', monospace; + font-weight: 500; +} + +.book-btn { + font-weight: bold; +} + .book-page { display: flex; flex-flow: column; diff --git a/assets/_fonts.scss b/assets/_fonts.scss index bfb2bc3..194355b 100644 --- a/assets/_fonts.scss +++ b/assets/_fonts.scss @@ -1 +1 @@ -@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap'); \ No newline at end of file +@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1+Code:wght@500&family=Noto+Sans+JP&display=swap'); \ No newline at end of file diff --git a/assets/_variables.scss b/assets/_variables.scss new file mode 100644 index 0000000..47b9a64 --- /dev/null +++ b/assets/_variables.scss @@ -0,0 +1,3 @@ +$container-max-width: 100rem; + +$toc-width: 12rem; \ No newline at end of file diff --git a/config.toml b/config.toml index 6d15803..9d9c991 100644 --- a/config.toml +++ b/config.toml @@ -4,8 +4,26 @@ title = '文化・芸術とLOD ハンズオン' theme = 'book' +pygmentsCodeFences = true + [params] BookRepo = 'https://github.com/Babibubebon/lodc2022-culture-art' BookCommitPath = 'commit' BookEditPath = 'edit/master' -BookComments = false \ No newline at end of file +BookComments = false + +[markup] + [markup.highlight] + anchorLineNos = false + codeFences = true + guessSyntax = false + hl_Lines = '' + hl_inline = false + lineAnchors = '' + lineNoStart = 1 + lineNos = true + lineNumbersInTable = false + noClasses = true + noHl = false + style = 'dracula' + tabWidth = 4 diff --git a/content/_index.md b/content/_index.md index bf626d7..3a16bc3 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,3 +1,7 @@ +--- +title: "" +--- + 文化・芸術とLOD ハンズオン ===== diff --git a/content/docs/mediaartsdb.md b/content/docs/mediaartsdb.md new file mode 100644 index 0000000..f5775a9 --- /dev/null +++ b/content/docs/mediaartsdb.md @@ -0,0 +1,50 @@ +--- +title: "メディア芸術データベース" +weight: 2 +# bookFlatSection: false +# bookToc: true +# bookHidden: false +# bookCollapseSection: false +# bookComments: false +# bookSearchExclude: false +--- + +# メディア芸術データベース(ベータ版) + +https://mediaarts-db.bunka.go.jp/ + + +## メディア芸術データベース・ラボ (MADB Lab) +https://mediag.bunka.go.jp/madb_lab/ + +- [SPARQLクエリサービス](https://mediag.bunka.go.jp/madb_lab/lod/sparql/) +- [データセット (Turtle, JSON-LD)](https://mediag.bunka.go.jp/madb_lab/lod/download/) + + +## クエリエディタ +{{< yasgui id="madb-lod" endpoint="https://mediag.bunka.go.jp/sparql" +default-query=`PREFIX rdf: +PREFIX rdfs: +PREFIX schema: +PREFIX class: +PREFIX ma: +SELECT * WHERE { + ?sub ?pred ?obj . +} LIMIT 10` +>}} + +----- + +### 公開年毎にアニメテレビレギュラーシリーズ数を集計する +{{< yasgui-query yasgui-id="madb-lod" title="公開年毎にTVアニメシリーズ数を集計する" >}} +PREFIX schema: +PREFIX rdf: +PREFIX rdfs: +PREFIX class: +SELECT ?y (COUNT(DISTINCT *) AS ?cnt) WHERE { + ?s a class:AnimationTVRegularSeries ; + schema:datePublished ?datePublished . +} +GROUP BY (SUBSTR(?datePublished, 1, 4) AS ?y) +ORDER BY ASC(?y) +{{< / yasgui-query >}} \ No newline at end of file diff --git a/content/docs/start.md b/content/docs/start.md index ae9a79b..4ca7d95 100644 --- a/content/docs/start.md +++ b/content/docs/start.md @@ -9,3 +9,4 @@ weight: 1 # bookSearchExclude: false --- +# はじめに \ No newline at end of file diff --git a/layouts/partials/docs/inject/head.html b/layouts/partials/docs/inject/head.html new file mode 100644 index 0000000..6297d9a --- /dev/null +++ b/layouts/partials/docs/inject/head.html @@ -0,0 +1,30 @@ +{{ if .HasShortcode "yasgui" }} + + + + + +{{ end }} \ No newline at end of file diff --git a/layouts/shortcodes/yasgui-query.html b/layouts/shortcodes/yasgui-query.html new file mode 100644 index 0000000..4d65789 --- /dev/null +++ b/layouts/shortcodes/yasgui-query.html @@ -0,0 +1,7 @@ +{{ $q := trim .Inner "\n" }} + +{{ highlight $q "sparql" }} + + ▶ 実行する + \ No newline at end of file diff --git a/layouts/shortcodes/yasgui.html b/layouts/shortcodes/yasgui.html new file mode 100644 index 0000000..d1c3060 --- /dev/null +++ b/layouts/shortcodes/yasgui.html @@ -0,0 +1,29 @@ +
+ {{ with .Get "endpoint" }} +

+ Endpoint: {{ . }} +

+ {{ end }} +
+
+ + +{{ if .Get "endpoint" }} + +{{ end }} \ No newline at end of file