Skip to content

Commit e8c4d3c

Browse files
authored
update revealjs (#28)
* update revealjs * skip cache
1 parent e9322fa commit e8c4d3c

File tree

7 files changed

+29
-40
lines changed

7 files changed

+29
-40
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,24 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
-
12-
name: Checkout
11+
- name: Checkout
1312
uses: actions/checkout@v2
1413
with:
1514
fetch-depth: 0
1615
submodules: 'recursive'
17-
-
18-
name: Set up Go
19-
uses: actions/setup-go@v2
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
2018
with:
2119
go-version: 1.17
22-
-
23-
name: Lint
20+
- name: Lint
2421
uses: golangci/golangci-lint-action@v2
2522
with:
2623
version: v1.29
27-
-
28-
name: Test
24+
skip-go-installation: true
25+
- name: Test
2926
run: |
3027
go test ./...
31-
-
32-
name: Check goreleaser configuration
28+
- name: Check goreleaser configuration
3329
uses: goreleaser/goreleaser-action@v2
3430
with:
3531
distribution: goreleaser

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "assets/socketio"]
55
path = assets/socketio
66
url = https://github.com/socketio/socket.io-client.git
7+
[submodule "assets/multiplex"]
8+
path = assets/multiplex
9+
url = https://github.com/reveal/multiplex

assets/multiplex

Submodule multiplex added at e2f74fa

assets/revealjs

Submodule revealjs updated 186 files

assets/templates/slide.html

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,18 @@
44
<meta charset="utf-8" />
55
<base href="/" />
66
<!-- Force all the relative paths to lookup from / -->
7-
<link rel="stylesheet" href="revealjs/css/reveal.css" />
7+
<link rel="stylesheet" href="revealjs/dist/reveal.css" />
88
<link
99
rel="stylesheet"
1010
{{if
1111
.OriginalTheme}}
1212
href="{{.Theme}}"
1313
{{else}}
14-
href="revealjs/css/theme/{{.Theme}}"
14+
href="revealjs/dist/theme/{{.Theme}}"
1515
{{end}}
1616
id="theme"
1717
/>
18-
<link rel="stylesheet" href="revealjs/lib/css/zenburn.css" />
19-
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
20-
<script>
21-
document.write(
22-
'<link rel="stylesheet" href="revealjs/css/print/' +
23-
(window.location.search.match(/print-pdf/gi) ? "pdf" : "paper") +
24-
'.css" type="text/css" media="print">'
25-
)
26-
</script>
27-
<!--[if lt IE 9]>
28-
<script src="revealjs/lib/js/html5shiv.js"></script>
29-
<![endif]-->
18+
<link rel="stylesheet" href="revealjs/plugin/highlight/zenburn.css" />
3019
</head>
3120
<body>
3221
<div class="reveal">
@@ -46,37 +35,33 @@
4635
</section>
4736
</div>
4837
</div>
49-
<script src="revealjs/js/reveal.js"></script>
38+
<script src="revealjs/dist/reveal.js"></script>
39+
<script src="revealjs/plugin/markdown/markdown.js"></script>
40+
<script src="revealjs/plugin/highlight/highlight.js"></script>
41+
<script src="revealjs/plugin/notes/notes.js"></script>
5042
<script>
5143
Reveal.initialize({
5244
controls: true,
5345
progress: true,
5446
history: true,
5547
center: true,
56-
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
57-
transition: Reveal.getQueryHash().transition || '{{.Transition}}', // default/cube/page/concave/zoom/linear/fade/none
48+
transition: '{{.Transition}}',
49+
plugins: [RevealMarkdown, RevealHighlight, RevealNotes],
50+
5851
{{if (ne .Multiplex.Secret "") -}}
5952
multiplex: {
6053
secret: {{if .Multiplex.IsMaster}}'{{.Multiplex.Secret}}'{{else}}null{{end}},
6154
id: '{{.Multiplex.Identifier}}',
6255
url: '/'
6356
},
6457
{{end -}}
65-
66-
// Optional libraries used to extend on reveal.js
6758
dependencies: [
6859
{{if (ne .Multiplex.Secret "") -}}
6960
{ src: 'socketio/socket.io.js', async: true },
70-
{ src: '{{if .Multiplex.IsMaster}}revealjs/plugin/multiplex/master.js{{else}}revealjs/plugin/multiplex/client.js{{end}}', async: true },
61+
{ src: '{{if .Multiplex.IsMaster}}multiplex/master.js{{else}}multiplex/client.js{{end}}', async: true },
7162
{{end -}}
72-
{ src: 'revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } },
73-
{ src: 'revealjs/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
74-
{ src: 'revealjs/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
75-
{ src: 'revealjs/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
76-
{ src: 'revealjs/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
77-
{ src: 'revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
7863
]
79-
});
64+
})
8065
</script>
8166
</body>
8267
</html>

server.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ var revealjs embed.FS
2222
//go:embed assets/socketio
2323
var socketiojs embed.FS
2424

25+
//go:embed assets/multiplex
26+
var multiplex embed.FS
27+
2528
//go:embed assets/templates/slide.html
2629
var slideTemplate string
2730

@@ -73,6 +76,7 @@ func (server *Server) Serve(param ServerParam) {
7376
param.Multiplex.IsMaster = true
7477
http.Handle("/master/", http.StripPrefix("/master", contentHandler(param, http.FileServer(http.Dir(".")))))
7578
http.Handle("/socketio/", assetsHandler("/assets/", http.FileServer(http.FS(socketiojs))))
79+
http.Handle("/multiplex/", assetsHandler("/assets/", http.FileServer(http.FS(multiplex))))
7680
http.Handle("/socket.io/", socketioServer)
7781
fmt.Printf("master slides can be found at http://*:%d/master/\n", port)
7882
}

server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestContentHandler(t *testing.T) {
3434
matches := []struct {
3535
regexp string
3636
}{
37-
{regexp: "revealjs/css/theme/beige.css"},
37+
{regexp: "revealjs/dist/theme/beige.css"},
3838
{regexp: `data-markdown="testdata/example.md"`},
3939
{regexp: `|| 'zoom',`},
4040
{regexp: `data-separator="\^==="`},

0 commit comments

Comments
 (0)