1

GitHub - simonguo/docsify-docx-converter: A tool for building docx based on your...

 1 year ago
source link: https://github.com/simonguo/docsify-docx-converter
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

docsify-docx-converter

book A tool for building docx based on your docsify project

Install

npm install --save-dev docsify-docx-converter

Usage

Create config file .docsifytodocxrc.js in your project root directory.

module.exports = {
  /** "table of contents" file path */
  contents: '_sidebar.md',

  /** Whether to enable title degradation, if enabled, replace <h1> with <h2>, <h2> with <h3>, and so on. */
  titleDowngrade: true,

  /** Document root directory */
  rootPath: './docs',

  /** Path where docx will stored */
  pathToPublic: './README.docx',

  /**
   * The maximum width of the image in the document, and the height will be adaptive according to the width.
   * The default is 468, which is the maximum width of a word document.
   */
  imgMaxWidth: 468,

  /** The title of the cover page. */
  coverTitle: null,

  /** The style of the body. */
  bodyStyles: 'font-family: 微软雅黑;',

  /** landscape or portrait (default) */
  orientation: 'portrait',

  /** map of margin sizes
   * expressed in twentieths of point, see WordprocessingML documentation for details):
   * http://officeopenxml.com/WPSectionPgMar.php
   * */
  margins: {}
};

Add script into package.json:

{
  "scripts": {
    "convert": "node_modules/.bin/docsify-docx-converter"
  }
}

Run converter:

npm run convert


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK