Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add presenter view to Bespoke template #157

Merged
merged 26 commits into from
Jan 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5f93746
Add bespoke presenter plugin
Sep 11, 2019
3573192
Merge branch 'master' into bespoke-presenter
Sep 11, 2019
5fa3089
Merge branch 'master' into bespoke-presenter
Sep 17, 2019
a5c4fb0
Update view's styling by mode
Sep 17, 2019
9b6c5e4
Add iframe for next slide in presenter view
Sep 17, 2019
324f3c5
Disable several bespok plugins in presenter view
Sep 17, 2019
b8dbe3d
Improve stability of next slide view
yhatt Sep 17, 2019
dd6f810
Allow navigation when clicked next slide view
Sep 18, 2019
72e0286
Add basic implementation of note on presenter view
Sep 18, 2019
faa0495
Refactor presenter plugin
Sep 18, 2019
aedb184
Add information footer to presenter view
Sep 18, 2019
3b55a04
Add presenter view icon and keyboard shortcut
Sep 18, 2019
ad18215
Update disable state of buttons on presenter view
Sep 18, 2019
e8fd48c
Don't render notes if there aren't any notes
Sep 18, 2019
8b41a84
Fix stylelint
Sep 18, 2019
1e1efa6
Fix container that doesn't fill window in Safari
Sep 19, 2019
f052bba
Merge branch 'master' into bespoke-presenter
yhatt Sep 19, 2019
9b118da
Merge branch 'bespoke-presenter' of github.com:marp-team/marp-cli int…
Sep 20, 2019
4962a73
Merge branch 'keep-sync-query' into bespoke-presenter
Sep 24, 2019
09cd54c
Merge branch 'master' into bespoke-presenter
Nov 12, 2019
178abf4
Merge branch 'master' into bespoke-presenter
yhatt Nov 21, 2019
e188db7
Merge branch 'master' into bespoke-presenter
yhatt Jan 18, 2020
0c37ea5
Refactor presenter view template to use JSX/vhtml
yhatt Jan 18, 2020
be3e483
Fix Jest and linter/formatter config to cover JSX
yhatt Jan 18, 2020
5574977
Fill test cases for presenter view
yhatt Jan 18, 2020
b1c8b8f
[ci skip] Update README.md and CHANGELOG.md
yhatt Jan 18, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Added

- Presenter view for bespoke template ([#142](https://github.com/marp-team/marp-cli/issues/142), [#157](https://github.com/marp-team/marp-cli/pull/157))
- Setup cache, badge, and skip tag support for GitHub Actions ([#186](https://github.com/marp-team/marp-cli/pull/186), [#192](https://github.com/marp-team/marp-cli/pull/192))

### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ The `bespoke` template is using [Bespoke.js](https://github.com/bespokejs/bespok
- **Fullscreen**: Toggle fullscreen by hitting <kbd>f</kbd> / <kbd>F11</kbd> key.
- **On-screen controller**: There is a touch-friendly OSC. You may also disable by `--bespoke.osc=false` if unneccesary.
- **Fragmented list**: Recognize [Marpit's fragmented list](https://github.com/marp-team/marpit/issues/145) and appear list one-by-one if used `*` and `1)` as the bullet marker.
- **Presenter view**: Open presenter view in external window by hitting <kbd>p</kbd> key.
- **Progress bar** (optional): By setting `--bespoke.progress` option, you can add a progress bar on the top of the deck.

### `bare` template
Expand Down
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { jestPreset } = require('ts-jest')

module.exports = {
collectCoverageFrom: ['src/**/*.ts'],
collectCoverageFrom: ['src/**/*.ts', 'src/**/*.tsx'],
coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'],
coverageThreshold: { global: { lines: 95 } },
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFiles: ['jest-plugin-context/setup', './jest.setup.js'],
transform: {
...jestPreset.transform,
Expand All @@ -13,5 +13,5 @@ module.exports = {
'^.*\\.pug$': '<rootDir>/test/_transformers/pug.js',
},
testEnvironment: 'node',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]s$',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.[jt]sx?$',
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"check:format": "yarn -s format -c",
"check:ts": "tsc --noEmit",
"clean": "rimraf lib",
"format": "prettier \"**/*.{css,js,json,md,scss,ts,yaml,yml}\"",
"format": "prettier \"**/*.{css,js,jsx,json,md,scss,ts,tsx,yaml,yml}\"",
"format:write": "yarn -s format --write",
"lint:ts": "tslint \"{src,test}/**/*.ts\"",
"lint:ts": "tslint \"{src,test}/**/*.{ts,tsx}\"",
"lint:css": "stylelint \"src/**/*.{css,scss}\"",
"prepack": "npm-run-all --parallel check:* lint:* test:coverage --parallel build types",
"preversion": "run-p check:* lint:* test:coverage",
Expand Down Expand Up @@ -116,6 +116,7 @@
"tslint-config-airbnb": "^5.11.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.5",
"vhtml": "^2.2.0",
"yauzl": "^2.10.0",
"zip-stream": "^2.1.3"
},
Expand Down
1 change: 1 addition & 0 deletions src/assets/osc-presenter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions src/templates/bespoke/_button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@mixin _button-icon($icon) {
background: transparent url($icon) no-repeat center center;
background-size: contain;
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
}

@mixin button-icon($icon, $size: 32px) {
@extend %button-#{$icon};
@include button-size($size);
}

@mixin button-size($size) {
height: $size;
line-height: $size;
width: $size;
}

%button {
appearance: none;
background-color: transparent;
border: 0;
color: inherit;
cursor: pointer;
font-size: inherit;
opacity: 0.8;
outline: none;
padding: 0;
transition: opacity 0.2s linear;
-webkit-tap-highlight-color: transparent;

&:disabled {
cursor: not-allowed;
opacity: 0.15 !important;
}

&:hover {
opacity: 1;

&:active {
opacity: 0.6;
}

&:not(:disabled) {
transition: none;
}
}
}

// Use placeholder selectors to prevent multi time definitions of image data URI
%button-prev {
@include _button-icon('../../assets/osc-prev.svg');
}

%button-next {
@include _button-icon('../../assets/osc-next.svg');
}

%button-fullscreen {
@include _button-icon('../../assets/osc-fullscreen.svg');

&.exit {
background-image: url('../../assets/osc-fullscreen-exit.svg');
}
}

%button-presenter {
@include _button-icon('../../assets/osc-presenter.svg');
}
9 changes: 9 additions & 0 deletions src/templates/bespoke/bespoke.pug
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ prepend deck
span(data-bespoke-marp-osc="page")
button(data-bespoke-marp-osc="next" tabindex=-1 title="Next slide") Next slide
button(data-bespoke-marp-osc="fullscreen" tabindex=-1 title="Toggle fullscreen (f)") Toggle fullscreen
button(data-bespoke-marp-osc="presenter" tabindex=-1 title="Open presenter view (p)") Open presenter view

append deck
if comments && comments.length > 0
each notes, index in comments
if notes && notes.length > 0
.bespoke-marp-note(data-index=index tabindex="0")
each paragraph in notes
p= paragraph

block script
script!= bespoke.js
Loading