Skip to content

Commit

Permalink
Add size options (#745)
Browse files Browse the repository at this point in the history
* Add size options

* Fix sample activation and clean
  • Loading branch information
evilz authored Dec 23, 2021
1 parent 92826a7 commit aee7fef
Show file tree
Hide file tree
Showing 11 changed files with 604 additions and 539 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ xunit.xml
**/.scannerwork/*

/export/*

*.vsix
1 change: 0 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ junit.xml
math.md
tslint.json
coverage/**
samples/**
node_modules/**
jest.config.js
sourceMap
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 4.1.1

- Add config for presentation size [741](https://github.com/evilz/vscode-reveal/issues/741)
- Fix embeded sample issue
- update npm dependencies

## 4.1.0

Expand Down
991 changes: 500 additions & 491 deletions package-lock.json

Large diffs are not rendered by default.

80 changes: 59 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "vscode-reveal",
"displayName": "vscode-reveal",
"description": "Show markdown as revealJs presentation",
"version": "4.1.0",
"version": "4.1.1",
"publisher": "evilz",
"author": "Vincent Bourdon",
"license": "MIT",
"icon": "logo.png",
"preview": true,
"preview": false,
"repository": {
"type": "git",
"url": "https://github.com/evilz/vscode-reveal"
Expand All @@ -26,6 +26,7 @@
],
"activationEvents": [
"onLanguage:markdown",
"onCommand:vscode-revealjs.showSample",
"onCommand:vscode-revealjs.showRevealJS",
"onCommand:vscode-revealjs.showRevealJSInBrowser"
],
Expand Down Expand Up @@ -107,7 +108,8 @@
"description": "Determines where controls appear",
"enum": [
"bottom-right",
"edge"]
"edge"
]
},
"revealjs.controlsBackArrows": {
"type": "string",
Expand All @@ -116,7 +118,8 @@
"enum": [
"faded",
"hidden",
"visible"]
"visible"
]
},
"revealjs.showSlideNumber": {
"type": "string",
Expand All @@ -125,7 +128,8 @@
"enum": [
"all",
"print",
"speaker"]
"speaker"
]
},
"revealjs.hashOneBasedIndex": {
"type": "boolean",
Expand Down Expand Up @@ -368,6 +372,36 @@
"default": 3,
"description": "Number of slides away from the current that are visible"
},
"revealjs.width": {
"type": "number",
"default": 960,
"description": "Width of the presentation"
},
"revealjs.height": {
"type": "number",
"default": 700,
"description": "Height of the presentation"
},
"revealjs.margin": {
"type": "number",
"default": 0.04,
"description": "Factor of the display size that should remain empty around the content"
},
"revealjs.minScale": {
"type": "number",
"default": 0.2,
"description": "Bounds for smallest possible scale to apply to content"
},
"revealjs.maxScale": {
"type": "number",
"default": 2,
"description": "Bounds for largest possible scale to apply to content"
},
"revealjs.disableLayout": {
"type": "boolean",
"default": false,
"description": "disable the built-in scaling and centering and Bring Your Own Layout"
},
"revealjs.parallaxBackgroundImage": {
"type": "string",
"default": "",
Expand Down Expand Up @@ -427,6 +461,11 @@
"type": "boolean",
"default": true,
"description": "Enable the search in slides"
},
"revealjs.title": {
"type": "string",
"default": "Reveal JS presentation",
"description": "Title of your presentation"
}
}
},
Expand Down Expand Up @@ -523,7 +562,7 @@
"dependencies": {
"@koa/cors": "^3.1.0",
"front-matter": "4.0.2",
"fs-jetpack": "^4.2.0",
"fs-jetpack": "^4.3.0",
"gray-matter": "^4.0.3",
"koa": "^2.13.4",
"koa-ejs": "^4.3.0",
Expand All @@ -532,7 +571,7 @@
"markdown-it": "^12.3.0",
"markdown-it-abbr": "^1.0.4",
"markdown-it-attribution": "^0.1.4",
"markdown-it-attrs": "^4.1.0",
"markdown-it-attrs": "^4.1.1",
"markdown-it-block-embed": "0.0.3",
"markdown-it-deflist": "^2.1.0",
"markdown-it-div": "^1.1.0",
Expand All @@ -554,33 +593,32 @@
},
"devDependencies": {
"@types/glob": "^7.2.0",
"@types/jest": "^27.0.2",
"@types/jest": "^27.0.3",
"@types/koa": "^2.13.4",
"@types/koa-ejs": "^4.3.0",
"@types/koa-router": "^7.4.4",
"@types/koa-static": "^4.0.2",
"@types/koa-static-server": "^1.5.0",
"@types/markdown-it": "12.2.3",
"@types/marked": "^3.0.2",
"@types/node": "^16.11.6",
"@types/node": "^17.0.4",
"@types/plantuml-encoder": "^1.4.0",
"@types/request": "^2.48.7",
"@types/vscode": "^1.61.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"@vscode/test-electron": "^1.6.2",
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"@vscode/test-electron": "^2.0.0",
"@vscode/test-web": "^0.0.15",
"esbuild": "^0.14.3",
"eslint": "^8.1.0",
"esbuild": "^0.14.8",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.2.2",
"jest": "^27.4.4",
"eslint-plugin-jest": "^25.3.0",
"jest": "^27.4.5",
"jest-junit": "^13.0.0",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"sonarqube-scanner": "^2.8.1",
"source-map-support": "^0.5.20",
"ts-jest": "^27.1.1",
"typescript": "^4.5.3"
"source-map-support": "^0.5.21",
"ts-jest": "^27.1.2",
"typescript": "^4.5.4"
}
}
}
34 changes: 15 additions & 19 deletions samples/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ touch: true
loop: true
rtl: true
#navigationMode: 'default', linear grid
shuffle: true
shuffle: false
fragments: false
fragmentInURL: true
embedded: false
Expand Down Expand Up @@ -58,17 +58,17 @@ display: grid
#hideInactiveCursor: true,
#hideCursorTime: 5000

#width: 960,
#height: 700,
#margin: 0.04,
#minScale: 0.2,
#maxScale: 2.0
#disableLayout: false
width: 400
height: 1320
margin: 0.04
minScale: 0.2
maxScale: 2.0
disableLayout: false

parallaxBackgroundImage: https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg
parallaxBackgroundSize: 2100px 900px
parallaxBackgroundImage: https://miro.medium.com/max/3622/1*RoXcbaF9lIqwpMjiXg54Vw.png
parallaxBackgroundSize: 2100px 1320px
parallaxBackgroundHorizontal: 200
parallaxBackgroundVertical: 50
parallaxBackgroundVertical: 150


#### VSCODE EXTENSION CONFIG ####
Expand All @@ -85,20 +85,16 @@ highlightTheme: hybrid

# hideAddressBar: boolean




# title: string // TODO : should take first big title or can be set
# layout: string
# logoImg: string | null
# description: string
# author: string

# enableMenu: boolean
# enableChalkboard: boolean
# enableTitleFooter: boolean
# enableZoom: boolean
# enableSearch: boolean
enableMenu: false
enableChalkboard: false
#enableTitleFooter: boolean
enableZoom: false
enableSearch: false
---

# front matter !
Expand Down
18 changes: 17 additions & 1 deletion src/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ export interface IDocumentOptions {
transitionSpeed: 'default' | 'fast' | 'slow'
backgroundTransition: transitions
viewDistance: number

width: number,
height: number,
margin: number,
minScale: number,
maxScale: number,
disableLayout: boolean,

parallaxBackgroundImage: string // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
parallaxBackgroundSize: string // CSS syntax, e.g. "2100px 900px"
parallaxBackgroundHorizontal: number | null
Expand Down Expand Up @@ -130,6 +138,14 @@ export const defaultConfiguration: Configuration = {
transitionSpeed: 'default',
backgroundTransition: 'default',
viewDistance: 3,

width: 960,
height: 700,
margin: 0.04,
minScale: 0.2,
maxScale: 2.0,
disableLayout: false,

parallaxBackgroundImage: '',
parallaxBackgroundSize: '',
parallaxBackgroundHorizontal: 0,
Expand Down Expand Up @@ -159,7 +175,7 @@ export const getConfigurationDescription = (properties:object) => {

const allProps:ConfigurationDescription[] =
Object.keys(properties)
.map(key => ({ label: key.substr(9),
.map(key => ({ label: key.substring(9), // remove "revealjs."
detail: properties[key].description,
documentation: `Default value: ${properties[key].default}`,
type: properties[key].type,
Expand Down
12 changes: 6 additions & 6 deletions views/template.4.1.3.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@
parallaxBackgroundVertical: <%= parallaxBackgroundVertical %>,
//Presentation Size
//#width: 960,
//#height: 700,
//#margin: 0.04,
//#minScale: 0.2,
//#maxScale: 2.0
//#disableLayout: false
width: <%= width %>,
height: <%= height %>,
margin: <%= margin %>,
minScale: <%= minScale %>,
maxScale: <%= maxScale %>,
disableLayout: <%= disableLayout %>,
audio: {
prefix: 'audio/', // audio files are stored in the "audio" folder
Expand Down
Binary file removed vscode-reveal-4.1.0.vsix
Binary file not shown.
Binary file removed vscode-reveal-preview-4.0.10.vsix
Binary file not shown.
Binary file removed vscode-reveal-preview-4.0.9.vsix
Binary file not shown.

0 comments on commit aee7fef

Please sign in to comment.