https://github.com/simonguo/docsify-docx-converter
A tool for building docx based on your docsify project
https://github.com/simonguo/docsify-docx-converter
Last synced: 7 months ago
JSON representation
A tool for building docx based on your docsify project
- Host: GitHub
- URL: https://github.com/simonguo/docsify-docx-converter
- Owner: simonguo
- Created: 2023-04-25T07:44:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-25T06:42:54.000Z (about 1 year ago)
- Last Synced: 2025-04-11T00:13:49.832Z (7 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-docsify - docsify-docx-converter - A tool for building docx based on your docsify project. [@simonguo](https://github.com/simonguo) (Plugins)
README
# docsify-docx-converter
📖 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.
```js
module.exports = {
/** "table of contents" file path */
contents: '_sidebar.md',
/** Whether to enable title degradation, if enabled, replace
with , with , 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
```