According to?

For programmers, in addition to coding, we have all kinds of soft quality to improve, sharing ability is one of the most important, a good sharing needs the efforts of the sharer.

These include: the ability of the sharer to set the mood, the quality of the content, and even the form and tools of sharing. A good form and tool for sharing can add a lot to your sharing.

How?

Share the ability to mobilize the atmosphere, the quality of the content needs to share itself more learning, more summary; External forms of sharing can be improved in a short time.

Imagine a scenario: Niu did some good practice in the project and deposited good documentation, but that’s all? Diffusion and influence are not enough.

Mavs start sharing in small groups or large groups, but writing separate powerpoint slides for the sake of sharing is putting the cart before the horse. Because the content of the PPT is basically already in the document.

Thus, scripts that convert documents to PPT with one click came into being

What?

Script depends on Chrome violent monkey plug-in (a plug-in can be customized to inject scripts, such as Baidu cloud disk cracking download scripts) script address: Zhihu PPT

After very simple installation, enter zhihu column document page, the PPT button will appear in the upper right corner!

Students can write according to their own preferences of the document platform, injection of their own scripts can refer to Zhihu PPT script and GitHub description configuration

The online Demo

Making: github.com/imcuttle/sl…

List of shortcuts:

  • ESC/O: Enable the overall preview mode
  • Cmd + ESC/Ctrl + ESC: Exit the PPT mode
  • Direction key: PPT page turning

The principle of

Parse the DOM tree and the spanning tree structure is as follows:

< H1 > Title </ H1 > <p> Content </p> <h2> Title 2</h2> <p> Content 2</p>Copy the code

Will be parsed into

{type: 'LVL ', level: 1, value:' title ', children: [{type: 'text', value: 'content'}, {type: 'LVL ', level: 2, value:' title ', children: [{type: 'text', value: 'content'}, {type: 'LVL ', level: 2, value: 'title 2 children: [{value: type:' text ', '2' content}]}}]Copy the code