在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):googleworkspace/md2googleslides开源软件地址(OpenSource Url):https://github.com/googleworkspace/md2googleslides开源编程语言(OpenSource Language):TypeScript 93.0%开源软件介绍(OpenSource Introduction):md2googleslides – Markdown to Google SlidesGenerate Google Slides from markdown & HTML. Run from the command line or embed in another application. This project was developed as an example of how to use the Slides API. While it does not yet produce stunningly beautiful decks, you are encouraged to use this tool for quickly prototyping presentations. Contributions are welcome. Installation and usageFor command line use, install md2gslides globally: npm install -g md2gslides Then get your OAuth client ID credentials:
After installing, import your slides by running: md2gslides slides.md --title "Talk Title" This will generate new Google Slides in your account with title NOTE: The first time the command is run you will be prompted for authorization. OAuth token
credentials are stored locally in a file named Each time you will run the above comment, new slide deck will be generated. In order to work on exactly the same deck, just get the ID of the already generated slides. For example, you can use following command:
Supported markdown rulesmd2gslides uses a subset of the CommonMark and Github Flavored Markdown rules for markdown. SlidesEach slide is typically represented by a header, followed by zero or more block elements. Begin a new slide with a horizontal rule ( The following examples show how to create slides of various layouts: Title slide--- # This is a title slide ## Your name here Section title slides--- # This is a section title Section title & body slides--- # Section title & body slide ## This is a subtitle This is the body Title & body slides--- # Title & body slide This is the slide body. Main point slideAdd --- # This is the main point {.big} Big number slideUse --- # 100% {.big} This is the body Two column slidesSeparate columns with --- # Two column layout This is the left column {.column} This is the right column Themes
ImagesInline imagesImages can be placed on slides using image tags. Multiple images can be included. Mulitple images in a single paragraph are arranged in columns, mutiple paragraphs arranged as rows. Note: Images are currently scaled and centered to fit the slide template. --- # Slides can have images ![](https://placekitten.com/900/900) Background imagesSet the background image of a slide by adding --- # Slides can have background images ![](https://placekitten.com/1600/900){.background} VideosInclude YouTube videos with a modified image tag. --- # Slides can have videos @[youtube](MG8KADiRbOU) Speaker notesInclude speaker notes for a slide using HTML comments. Text inside the comments may include markdown for formatting, though only text formatting is allowed. Videos, images, and tables are ignored inside speaker notes. --- # Slide title ![](https://placekitten.com/1600/900){.background} <!-- These are speaker notes. --> FormattingBasic formatting rules are allowed, including:
The following markdown illustrates a few common styles. **Bold**, *italics*, and ~~strikethrough~~ may be used. Ordered lists: 1. Item 1 1. Item 2 1. Item 2.1 Unordered lists: * Item 1 * Item 2 * Item 2.1 Additionally, a subset of inline HTML tags are supported for styling.
Supported CSS styles for use with
You may also use EmojiUse Github style emoji in your text using
the The following example inserts emoji in the header and body of the slide. ### I :heart: cats :heart_eyes_cat: Code blocksBoth indented and fenced code blocks are supported, with syntax highlighting. The following example renders highlighted code. ### Hello World ```javascript console.log('Hello world'); ``` To change the syntax highlight theme specify the md2gslides slides.md --style github You can also apply additional style changes to the entire block, such as changing the font size: ### Hello World ```javascript console.log('Hello world'); ```{style="font-size: 36pt"} TablesTables are supported via GFM syntax. Note: Including tables and other block elements on the same slide may produce poor results with overlapping elements. Either avoid or manually adjust the layout after generating the slides. The following generates a 2x5 table on the slide. ### Top pets in the United States Animal | Number -------|-------- Fish | 142 million Cats | 88 million Dogs | 75 million Birds | 16 million Local imagesImages referencing local paths temporarily uploaded and hosted to file.io. File.io is an emphemeral file serving service that generates short-lived random URLs to the upload file and deletes content shortly after use. Since local images are uploaded to a thrid party, explicit opt-in is required to use this feature.
Include the Image rasterizationSlides can also include generated images, using Using TeX: # How about some math? $$$ math \cos (2\theta) = \cos^2 \theta - \sin^2 \theta $$$ SVG # Or some SVG? $$$ svg <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 48"> <defs> <path id="a" d="M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z"/> </defs> <clipPath id="b"> <use xlink:href="#a" overflow="visible"/> </clipPath> <path clip-path="url(#b)" fill="#EA4335" d="M0 11l17 13 7-6.1L48 14V0H0z"/> <path clip-path="url(#b)" fill="#34A853" d="M0 37l30-23 7.9 1L48 0v48H0z"/> <path clip-path="url(#b)" fill="#4285F4" d="M48 48L17 24l-4-3 35-10z"/> </svg> $$$ Like local images, generated images are temporarily served via file.io. Pull requests for other image generators (e.g. mermaid, chartjs, etc.) are welcome! Reading from standard inputYou can also pipe markdown into the tool by omitting the file name argument. ContributingWith the exception of Before anything, ensure you have all dependencies: npm install To compile: npm run compile To run unit tests: npm run test To lint/format tests: npm run lint See CONTRIBUTING for additional terms. LicenseThis library is licensed under Apache 2.0. Full license text is available in LICENSE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论