Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ body {
}
}

.highlight[filename] {
.highlight[filename],
.hextra-asciinema-player[filename] {
margin-top: 2rem;
}

.highlight[filename]::before {
.highlight[filename]::before,
.hextra-asciinema-player[filename]::before {
content: attr(filename);
display: block;
padding: 0.5rem 0.75rem;
Expand All @@ -92,7 +94,8 @@ body {
border-top-right-radius: 0.5rem;
}

.highlight[filename] pre {
.highlight[filename] pre,
.hextra-asciinema-player[filename] pre {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
Expand Down
4 changes: 3 additions & 1 deletion layouts/shortcodes/hextra/asciinema.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
{{- $loop := .Get "loop" | default false -}}
{{- $poster := .Get "poster" | default "" -}}
{{- $markers := .Get "markers" | default "" -}}
{{- $filename := .Get "filename" | default "" -}}

{{- /* Handle file path: support local files, absolute paths, and remote URLs */ -}}
{{- $isLocal := not (urls.Parse $castFile).Scheme -}}
Expand Down Expand Up @@ -84,7 +85,8 @@
data-autoplay="{{ $autoplay }}"
data-loop="{{ $loop }}"
{{- if ne $poster "" }} data-poster="{{ $poster | safeURL }}"{{- end -}}
{{- if $markerConfig }} data-markers='{{ $markerConfig }}'{{- end -}}>
{{- if $markerConfig }} data-markers='{{ $markerConfig }}'{{- end -}}
{{- if $filename }} filename="{{ $filename }}"{{- end -}}>
</div>

{{- /* Include asciinema-player assets once per page */ -}}
Expand Down
5 changes: 4 additions & 1 deletion layouts/shortcodes/hextra/jupyter.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

{{- $path := .Get 0 -}}
{{- $allowUnsafeHTML := eq (.Get "allowUnsafeHTML") "true" -}}
{{- $filename := .Get "filename" -}}
{{- $fileAttr := "" -}}
{{- if $filename -}}{{- $fileAttr = printf " {filename=\"%s\"}" $filename -}}{{- end -}}
{{- $data := "" -}}
{{- $page := .Page -}}

Expand Down Expand Up @@ -44,7 +47,7 @@
{{- $source := index $cell "source" -}}
{{- $sourceContent := (cond (reflect.IsSlice $source) (delimit $source "") $source) -}}
{{- with ($sourceContent | strings.Chomp) -}}
{{ (printf "\n\n```%s\n%s\n```\n" $language .) | safeHTML -}}
{{ (printf "\n\n```%s%s\n%s\n```\n" $language $fileAttr .) | safeHTML -}}
{{- end -}}

<div class="hextra-jupyter-code-cell mb-3">
Expand Down
Loading