幻灯片制作

screen shot 2017-07-14 at 12 33 14 pm

Markdown Preview Enhanced 使用 reveal.js 来渲染漂亮的幻灯片。

点击这里 查看相关的介绍。

presentation

Presentation Front-Matter

你可以通过 front-matter 来设置你的幻灯片。
你需要将你的设置写在 presentation 部分下。
例如:

  1. ---
  2. presentation:
  3. width: 800
  4. height: 600
  5. ---
  6. <!-- slide -->
  7. 在这里编写你的幻灯片。。。

这个幻灯片将会拥有 800x600 的大小。

设置

  1. ---
  2. presentation:
  3. # The "normal" size of the presentation, aspect ratio will be preserved
  4. # when the presentation is scaled to fit different resolutions. Can be
  5. # specified using percentage units.
  6. width: 960
  7. height: 700
  8. # Factor of the display size that should remain empty around the content
  9. margin: 0.1
  10. # Bounds for smallest/largest possible scale to apply to content
  11. minScale: 0.2
  12. maxScale: 1.5
  13. # Display controls in the bottom right corner
  14. controls: true
  15. # Display a presentation progress bar
  16. progress: true
  17. # Display the page number of the current slide
  18. slideNumber: false
  19. # Push each slide change to the browser history
  20. history: false
  21. # Enable keyboard shortcuts for navigation
  22. keyboard: true
  23. # Enable the slide overview mode
  24. overview: true
  25. # Vertical centering of slides
  26. center: true
  27. # Enables touch navigation on devices with touch input
  28. touch: true
  29. # Loop the presentation
  30. loop: false
  31. # Change the presentation direction to be RTL
  32. rtl: false
  33. # Randomizes the order of slides each time the presentation loads
  34. shuffle: false
  35. # Turns fragments on and off globally
  36. fragments: true
  37. # Flags if the presentation is running in an embedded mode,
  38. # i.e. contained within a limited portion of the screen
  39. embedded: false
  40. # Flags if we should show a help overlay when the questionmark
  41. # key is pressed
  42. help: true
  43. # Flags if speaker notes should be visible to all viewers
  44. showNotes: false
  45. # Number of milliseconds between automatically proceeding to the
  46. # next slide, disabled when set to 0, this value can be overwritten
  47. # by using a data-autoslide attribute on your slides
  48. autoSlide: 0
  49. # Stop auto-sliding after user input
  50. autoSlideStoppable: true
  51. # Enable slide navigation via mouse wheel
  52. mouseWheel: false
  53. # Hides the address bar on mobile devices
  54. hideAddressBar: true
  55. # Opens links in an iframe preview overlay
  56. previewLinks: false
  57. # Transition style
  58. transition: 'default' # none/fade/slide/convex/concave/zoom
  59. # Transition speed
  60. transitionSpeed: 'default' # default/fast/slow
  61. # Transition style for full page slide backgrounds
  62. backgroundTransition: 'default' # none/fade/slide/convex/concave/zoom
  63. # Number of slides away from the current that are visible
  64. viewDistance: 3
  65. # Parallax background image
  66. parallaxBackgroundImage: '' # e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
  67. # Parallax background size
  68. parallaxBackgroundSize: '' # CSS syntax, e.g. "2100px 900px"
  69. # Number of pixels to move the parallax background per slide
  70. # - Calculated automatically unless specified
  71. # - Set to 0 to disable movement along an axis
  72. parallaxBackgroundHorizontal: null
  73. parallaxBackgroundVertical: null
  74. # Parallax background image
  75. parallaxBackgroundImage: '' # e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg"
  76. # Parallax background size
  77. parallaxBackgroundSize: '' # CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto)
  78. # Number of pixels to move the parallax background per slide
  79. # - Calculated automatically unless specified
  80. # - Set to 0 to disable movement along an axis
  81. parallaxBackgroundHorizontal: 200
  82. parallaxBackgroundVertical: 50
  83. # Enable Speake Notes
  84. enableSpeakerNotes: false
  85. ---

自定义幻灯片样式

你可以添加 id 以及 class 到一个特定的幻灯片:

  1. <!-- slide id="my-id" class="my-class1 my-class2" -->

或者你也可以自定义第 nth 个幻灯片,编写你的 less 如下:

  1. .markdown-preview.markdown-preview {
  2. // 自定义 presentation 样式
  3. .reveal .slides {
  4. // 修改所有幻灯片
  5. }
  6. // 自定义 presentation 样式
  7. .slides > section:nth-child(1) {
  8. // 修改 `第 1 个幻灯片`
  9. }
  10. }

➔ Pandoc