Cli tool to extract code blocks from Readme files, saves them onto separate files.
Go Markdown Block Extractor will extract all the codeblocks from markdown files and save them as their own separate files. This allows to run checks like linting, formating or any other custom checks to make sure that the code blocks in the markdown files, which most likely are some sort of documentation, are actually valid.
First, install the go programming language.
Then run:
go install github.com/djrmarques/gmbe@latest
Verify installation with
gmbe --help
Use the following command:
gmbe extract -f Readme.md
This command will create a folder called Readme
, and inside there will be files with the code blocks.
There are a few usage flags that can be used:
It's possible to specify the output folder with:
gmbe extract -o folder -f Readme.md # This will save the files inside this folder
It's also possible to join all the codeblocks of the same type inside the same file
gmbe extract -j -f Readme.md # This will join all code blocks of the same type in the same file