Skip to content

Commit 9ab29f3

Browse files
committed
feat: add copy-to-clipboard button to code blocks (resolves #361)
1 parent 4baa295 commit 9ab29f3

53 files changed

Lines changed: 5746 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bookignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*.js
21
*.pdf

_layouts/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
{% endif %}
1818
{% endfor %}
1919
{% endblock %}
20+
<link rel="stylesheet" href="/website/copy-code.css">
2021
{% block head %}{% endblock %}
2122
</head>
2223
<body>

_layouts/website/page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@
124124
gitbook.page.hasChanged({{ template.getJSContext()|dump|safe }});
125125
});
126126
</script>
127+
<script src="/website/copy-code.js"></script>
127128
</div>
128129
{% endblock %}

cn/_layouts/layout.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE HTML>
2+
<html lang="{{ config.language }}" {% if page.dir == "rtl" %}dir="rtl"{% endif %}>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>{% block title %}{{ config.title|d("HonKit", true) }}{% endblock %}</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<meta name="description" content="{% block description %}{% endblock %}">
8+
<meta name="generator" content="HonKit {{ gitbook.version }}">
9+
{% if config.author %}<meta name="author" content="{{ config.author }}">{% endif %}
10+
{% if config.isbn %}<meta name="identifier" content="{{ config.isbn }}" scheme="ISBN">{% endif %}
11+
{% block style %}
12+
{% for resource in plugins.resources.css %}
13+
{% if resource.url %}
14+
<link rel="stylesheet" href="{{ resource.url }}">
15+
{% else %}
16+
<link rel="stylesheet" href="{{ resource.path|resolveAsset }}">
17+
{% endif %}
18+
{% endfor %}
19+
{% endblock %}
20+
<link rel="stylesheet" href="/website/copy-code.css">
21+
{% block head %}{% endblock %}
22+
</head>
23+
<body>
24+
{% block body %}{% endblock %}
25+
{% block javascript %}{% endblock %}
26+
</body>
27+
</html>

cn/_layouts/website/header.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% block book_header %}
2+
<div class="book-header" role="navigation">
3+
{% if glossary.path %}
4+
<a href="{{ ('/' + glossary.path)|resolveFile }}" class="btn pull-left" aria-label="{{ "GLOSSARY_OPEN"|t }}"><i class="fa fa-sort-alpha-asc"></i></a>
5+
{% endif %}
6+
7+
<!-- Title -->
8+
<h1>
9+
<i class="fa fa-circle-o-notch fa-spin"></i>
10+
<a href="{{ "/"|resolveFile }}" >{{ page.title }}</a>
11+
</h1>
12+
</div>
13+
{% endblock %}

0 commit comments

Comments
 (0)