Skip to content

Commit a5c6f32

Browse files
committed
Merge branch 'master' of https://github.com/MarkBind/markbind into convert-to-code-block
* 'master' of https://github.com/MarkBind/markbind: Allow changing parameter properties (MarkBind#1075) Custom timezone for built-in timestamp (MarkBind#1073) Fix reload inconsistency when updating frontmatter (MarkBind#1068) Implement an api to ignore content in certain tags (MarkBind#1047) Enable AppVeyor CI (MarkBind#1040) Add heading and line highlighting to code blocks (MarkBind#1034) Add dividers and fix bug in siteNav (MarkBind#1063) Fixed navbar no longer covers modals (MarkBind#1070) Add copy code-block plugin (MarkBind#1043) Render plugins on dynamic resources (MarkBind#1051) Documentation for Implement no-* attributes for <box> (MarkBind#1042) Migrate to bootstrap-vue popovers (MarkBind#1033) Refactor preprocess and url processing functions (MarkBind#1026) Add pageNav to Using Plugins Page (MarkBind#1062) # Conflicts: # docs/userGuide/syntax/siteNavigationMenus.mbdf
2 parents 9720d63 + e521f97 commit a5c6f32

File tree

120 files changed

+13540
-707
lines changed

Some content is hidden

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

120 files changed

+13540
-707
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
"lodash/prefer-lodash-method": [0],
3030
"lodash/prefer-noop": [0],
3131
"max-len": ["error", { "code": 110 }],
32+
"no-param-reassign": ["error", { "props": false }],
3233
"operator-linebreak": ["error", "before"],
3334
// override airbnb-base dev dependencies, latest version does not white list __mocks__
3435
"import/no-extraneous-dependencies": [

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- '8'
3+
- '10'
44
deploy:
55
# deploy on release, to markbind.org
66
- provider: script

appveyor.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
environment:
2+
nodejs_version: "10"
3+
4+
# Install scripts
5+
install:
6+
# Install nodejs version
7+
- ps: Install-Product node $env:nodejs_version
8+
# Install modules
9+
- npm ci
10+
11+
# Post-install test scripts
12+
test_script:
13+
- node --version
14+
- npm --version
15+
- npm run testwin
16+
17+
build: off

asset/css/markbind.css

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,36 @@ pre > code.hljs {
2525
counter-reset: line;
2626
}
2727

28+
pre > code.hljs[heading] {
29+
border-top-right-radius: 0;
30+
}
31+
32+
.code-block {
33+
position: relative;
34+
}
35+
36+
.code-block-heading {
37+
background-color: #f2f2ff;
38+
border-radius: 6px 6px 0 0;
39+
color: #8787a5;
40+
float: right;
41+
font-size: 85%;
42+
line-height: 1;
43+
max-width: 85%;
44+
overflow-wrap: break-word;
45+
padding: 0.25em 0.4em;
46+
text-align: right;
47+
}
48+
49+
.code-block-content {
50+
clear: both;
51+
display: block;
52+
}
53+
54+
code > span.highlighted {
55+
background: lavender;
56+
}
57+
2858
kbd {
2959
background-color: #fafbfc;
3060
border: 1px solid #c6cbd1;
@@ -94,7 +124,7 @@ code.hljs:hover {
94124
header.header-fixed {
95125
position: fixed;
96126
width: 100%;
97-
z-index: 9999;
127+
z-index: 1000;
98128
}
99129

100130
/* #app is treated as the main container */
@@ -340,3 +370,74 @@ li.footnote-item:target {
340370
top: 0;
341371
width: 3em;
342372
}
373+
374+
/* hide popover, modal, tooltip content */
375+
[data-mb-html-for] {
376+
display: none;
377+
}
378+
379+
/* styles for triggers */
380+
.trigger {
381+
text-decoration: underline dotted;
382+
}
383+
384+
.modal.mb-zoom {
385+
-webkit-transform: scale(0.1);
386+
-moz-transform: scale(0.1);
387+
-ms-transform: scale(0.1);
388+
transform: scale(0.1);
389+
opacity: 0;
390+
-webkit-transition: all 0.3s;
391+
-moz-transition: all 0.3s;
392+
transition: all 0.3s;
393+
}
394+
395+
.modal.mb-zoom.show {
396+
-webkit-transform: scale(1);
397+
-moz-transform: scale(1);
398+
-ms-transform: scale(1);
399+
transform: scale(1);
400+
opacity: 1;
401+
}
402+
403+
/* "Copy" code block button */
404+
pre {
405+
position: relative;
406+
}
407+
408+
.copy-btn {
409+
background-color: #b4b4b9;
410+
border-radius: 0.25rem;
411+
color: #f8f8ff;
412+
display: inline-block;
413+
font-size: 75%;
414+
line-height: 1;
415+
padding: 0.25em 0.4em;
416+
position: absolute;
417+
right: 0.5em;
418+
text-align: center;
419+
top: 0.4em;
420+
white-space: nowrap;
421+
}
422+
423+
.copy-btn:hover {
424+
color: #555;
425+
}
426+
427+
.copy-btn-body {
428+
align-items: center;
429+
display: flex;
430+
}
431+
432+
.copy-btn svg {
433+
fill: currentColor;
434+
margin-right: 0.4em;
435+
}
436+
437+
.copy-btn-label {
438+
font-size: 11px;
439+
}
440+
441+
.copy-btn:focus {
442+
outline: none;
443+
}

asset/js/setup.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,39 @@ function setupWithSearch() {
171171
setupSiteNav();
172172
}
173173

174+
function makeInnerGetterFor(attribute) {
175+
return (element) => {
176+
const innerElement = element.querySelector(`[data-mb-html-for="${attribute}"]`);
177+
return innerElement === null ? '' : innerElement.innerHTML;
178+
};
179+
}
180+
181+
function makeHtmlGetterFor(componentType, attribute) {
182+
return (element) => {
183+
const contentWrapper = document.getElementById(element.attributes.for.value);
184+
return contentWrapper.dataset.mbComponentType === componentType
185+
? makeInnerGetterFor(attribute)(contentWrapper) : '';
186+
};
187+
}
188+
189+
/* eslint-disable no-unused-vars */
190+
/*
191+
These getters are used by triggers to get their popover/tooltip content.
192+
We need to create a completely new popover/tooltip for each trigger due to bootstrap-vue's implementation,
193+
so this is how we retrieve our contents.
194+
*/
195+
const popoverContentGetter = makeHtmlGetterFor('popover', 'content');
196+
const popoverHeaderGetter = makeHtmlGetterFor('popover', 'header');
197+
const popoverInnerContentGetter = makeInnerGetterFor('content');
198+
const popoverInnerHeaderGetter = makeInnerGetterFor('header');
199+
200+
const popoverGenerator = { title: popoverHeaderGetter, content: popoverContentGetter };
201+
const popoverInnerGenerator = { title: popoverInnerHeaderGetter, content: popoverInnerContentGetter };
202+
203+
const tooltipContentGetter = makeHtmlGetterFor('tooltip', '_content');
204+
const tooltipInnerContentGetter = makeInnerGetterFor('_content');
205+
/* eslint-enable no-unused-vars */
206+
174207
if (enableSearch) {
175208
setupWithSearch();
176209
} else {

docs/images/copyCode.png

47.2 KB
Loading

docs/site.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"baseUrl": "",
3+
"timeZone": "Asia/Singapore",
34
"titlePrefix": "MarkBind",
45
"pages": [
56
{

0 commit comments

Comments
 (0)