1.1.13 • Published 2 months ago

@synion/md-docs v1.1.13

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
2 months ago

analyze release npm npm

Product

md-docs is a cli tool which generates a static website by resolving files recursivly from a source folder.

See the test set for more information.

This script copies every file and directory from the docs directory into the dist directory and transforms every *.md file into a html file while adding the following features:

  1. Every *.md is transformed in a static web page;
  2. Every *.email.md is transformed in a static document web page;
  3. Every *.message.md is transformed in a static document web page and PDF;
  4. Every index.md is added to the menu;
  5. Every heading is automatically converted into a container;
  6. Every *.model.yml anchor is automatically converted into a model viewer;
  7. Every *.bpmn anchor is automatically converted into a BPMN.io viewer;
  8. Every *openapi.yaml anchor is automatically converted into a HTML documentation page;
  9. Every *.feature anchor is automatically converted into a feature details list;
  10. Every *.dashboard.yaml anchor is automatically converted into a BDD dashboard;
  11. Every *.user-task.yaml anchor is automatically converted into a user-interface;
  12. Every *.puml filer is automatically converted into an SVG image file;
  13. Every *.drawio file is automatically into an SVG image file;
  14. Every *.java, *.cs, *.ts, *.js, *.json, *.py, *.yml, *.yml anchor is automatically converted in a code block;
  15. Every markdown anchor is automatically converted into an HTML link;
  16. Every markdown anchor which starts with a _ is automatically added to the markdown file;
  17. Every git branch is added to the git menu;
  18. Test executions are automatically parsed in feature files;
  19. Unsorted list with items which reference the files above are automatically converted in tab panels;
  20. Images are wrapped in figures;
  21. Images can be aligned by adding align=center or align=left or align=right to the URL;
  22. Markdown is transformed into HTML using markdow-it, the following plugins are installed:

All links are relative, so you do not need a web server.

Class diagram

Architecture

The application is written in node js and implements a plug in architecture. It uses Awilix under the hood for dependency resolving. Plugins can be used by extending App and adding or replacing service registrations.

There are several plugin strategies:

  1. add or change the file parsers;
  2. add or change the HTML parsers;
  3. add or change the anchor parsers;
  4. change components;
  5. change component render functions;
const App = require('md-docs-cli/app');

module.exports = class MyApp extends App {
  constructor(options) {
    super(options);
  }

  _getServices(options) {
    const services = super(options);

    //Option 1
    services['newFileParser'] = asClass(NewFileParser).singleton();
    services.fileParsers.push('newFileParser');

    //Option 2
    services['newHtmlParser'] = asClass(NewHtmlParser).singleton();
    services.htmlParsers.push('newHtmlParser');

    //Option 3
    services['newAnchorParser'] = asClass(NewAnchorParser).singleton();
    services.anchorParsers.push('newAnchorParser');

    //Option 4
    services.pageComponent = asClass(MyPageComponent).singleton();

    //Option 5
    services.pageComponentRenderFn = asValue((data) => '<html />');

    return services;
  }
}

To get started

npm install @biz-dev-ops/md-docs -g
mkdir ../documentation
cd documentation
mkdir docs
echo "# It works!" > docs/index.md
md-docs
google-chrome dist/index.html

Options

branches only

md-docs -b

Custom theme

You can override all assets files by adding the same files to docs folder: docs/assets/style/custom-theme.css can then be overwritten by a custom theme implementation.

Skip branches

md-docs -s branch1 branch2

To debug

Set the environment to development. All intermediate steps are saved as files in the dist directory.

export NODE_ENV=development
1.1.13

2 months ago

1.1.12

2 months ago

1.1.11

2 months ago

1.1.10

2 months ago

1.1.9

2 months ago

1.1.8

2 months ago

1.1.7

3 months ago

1.1.6

3 months ago

1.1.5

3 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.0.121

3 months ago

1.0.120

3 months ago

1.0.118

3 months ago

1.0.119

3 months ago

1.0.117

3 months ago

1.0.116

3 months ago

1.0.115

3 months ago

1.0.114

3 months ago

1.0.113

3 months ago

1.0.110

3 months ago

1.0.111

3 months ago

1.0.109

4 months ago

1.0.108

4 months ago

1.0.107

4 months ago

1.0.106

4 months ago

1.0.105

5 months ago

1.0.101

7 months ago

1.0.100

8 months ago

1.0.103

7 months ago

1.0.102

7 months ago

1.0.104

6 months ago

1.0.94

10 months ago

1.0.99

8 months ago

1.0.98

8 months ago

1.0.97

9 months ago

1.0.96

9 months ago

1.0.91

11 months ago

1.0.93

11 months ago

1.0.92

11 months ago

1.0.77

12 months ago

1.0.79

11 months ago

1.0.78

12 months ago

1.0.80

11 months ago

1.0.84

11 months ago

1.0.83

11 months ago

1.0.82

11 months ago

1.0.81

11 months ago

1.0.88

11 months ago

1.0.87

11 months ago

1.0.86

11 months ago

1.0.85

11 months ago

1.0.89

11 months ago

1.0.90

11 months ago

1.0.65

1 year ago

1.0.69

1 year ago

1.0.68

1 year ago

1.0.67

1 year ago

1.0.73

1 year ago

1.0.72

1 year ago

1.0.71

1 year ago

1.0.70

1 year ago

1.0.76

1 year ago

1.0.75

1 year ago

1.0.74

1 year ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.56

1 year ago

1.0.39

1 year ago

1.0.38

2 years ago

1.0.40

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.41

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.23

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.2

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.1.10

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.0.5

2 years ago

0.1.3

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago