Go to file
syy11cn 2474dd9660 docs: add basic usage guide 2022-06-04 15:08:30 +08:00
.vscode docs: add basic usage guide 2022-06-04 15:08:30 +08:00
docs docs: font 2022-04-16 17:17:31 +08:00
packages feat(core): read config file 2022-06-04 13:55:41 +08:00
playground chore(playground): update 2022-06-03 14:56:35 +08:00
templates/UESTC/SISE/internship docs: update 2022-06-04 13:55:54 +08:00
.eslintignore chore: init 2022-04-12 22:09:19 +08:00
.eslintrc chore: init 2022-04-12 22:09:19 +08:00
.gitignore chore: update 2022-04-13 10:24:39 +08:00
LICENSE chore: init 2022-04-12 22:09:19 +08:00
README.md docs: add basic usage guide 2022-06-04 15:08:30 +08:00
package.json chore: update package.json 2022-06-03 14:57:11 +08:00
pnpm-lock.yaml chore: update deps 2022-06-02 17:39:43 +08:00
pnpm-workspace.yaml chore(deps): update 2022-04-16 17:15:26 +08:00
tsconfig.json chore: update ts config 2022-05-29 15:05:41 +08:00

README.md

md-report

What's md-report

The repo name md-report stands for both "Write your reports in markdown, and get them in docx." and "Made report again." ("马德,又是报告" in Chinese) meanings.

Motivation

Anyway, it is quite inconvenient for Mac OS / Linux users to deal with MS Office files (sometimes it's the same for Windows users because of the outdated doc template).

Writing characters, words and sentences is easy, but it is difficult to handle style in WPS Office as well as MS Office.

Benifit

The md-report helps you focus on the content rather than the style of your reports.

Basic Usage

Install Node.js v14+

Just follow the instruction on the official website to download and install Node.js.

For frontend developers, nvm is a better choice.

Create Workspace Directory

Create a folder that will contain your work of report and create a markdown file named index.md in the folder.

Also create a config.json file to set the text in page headers.

  • index.md: Choose a template in (https://github.com/syy11cn/md-report/tree/main/templates) or write your own structure of reports.
  • config.json: Write the config file as follows (Remember to replace <your_page_header_text> with your own text). More configuration support and docs are on the way.
{
  "meta": {
    "pageHeaderText": "<your_page_header_text>" // Will be placed in page header on even pages.
  }
}

Run the Command

  • With npx:
cd <your_workspace_dir>
npx @md-report/core
  • Install the command globally:
npm i -g @md-report/core
cd <your_workspace_dir>
mdreport

By default, a My Document.docx file will be created in your workspace directory.

Custom Input and Output

  • To specify the input markdown file, use -f argument;
  • To specify the input config file, use -c argument;
  • To specify the filename of output document, use -o argument.

One More Step

Because of the limit of dependency, the TOC is inserted but need to be manually updated.

  • After you get your .docx document, just open it, and check if there is any mistakes.
  • Then go to the first line on the first page.
  • Click the right button of your mouse, and select the update field item in the menu.

Finally, you just need to combine your cover and your contents together. It's just a combination of two .docx files. You can find tons of utils and get your taste to solve it.

Acknowledgement

The idea comes from slidev, a PowerPoint generator with markdown files.

License

MIT © 2022 Yiyang Sun