charts-embed-sdk icon indicating copy to clipboard operation
charts-embed-sdk copied to clipboard

docs: CHARTS-6059 Extract common text from SDK guides

Open lilyh4 opened this issue 2 years ago • 0 comments

Summary

  • Our SDK examples share a lot of common text in their README.md files
  • Common partial files have been added to a new directory examples/docs
  • Used npm package markdown-include to support building our README files with other Markdown files
    • With each outputted README.md (one per SDK example) there now needs to be a new markdown.json file which specifies the build file for it
      • These build files are located in examples/.md-config
    • Until we set up an action, compilation is manual (see below)
  • With this approach, future text changes should only be made to the configuration files or the partial docs

Script to compile all SDK guide README files:

for i in examples/charts/* examples/dashboard/*;
  do ./node_modules/markdown-include/bin/cli.js "${i}"/markdown.json;
done;

Updated file tree

charts-embed-sdk/examples
├── .md-config
│   ├── chart
|	|   ├── authenticated-custom-jwt.md 	
|	|   └── ...other md config files 			
|	└── dashboard
│	    └── ...other md config files 		
├── charts
│   ├── authenticated-custom-jwt
|	|   ├── assets
|	|   ├── src 	
|	|   ├── app.js 	
|	|   ├── index.html 
|	|   ├── markdown.json 		
|	|   ├── package.json 	
|	|   ├── package.json 	
|	|   └── package-lock.json 
|	└── ...other examples	
├── dashboard
|	└── ...other examples	
├── docs
│   ├── chart
|	|   └── ...partial md files
|	├── dashboard
|	|   └── ...partial md files
|	└── ...partial md files
└── README.md

lilyh4 avatar Mar 30 '23 03:03 lilyh4