Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for adding developer oriented Makefile example #29

Open
staticaland opened this issue May 16, 2020 · 0 comments
Open

Proposal for adding developer oriented Makefile example #29

staticaland opened this issue May 16, 2020 · 0 comments

Comments

@staticaland
Copy link

staticaland commented May 16, 2020

My dream is to use codebraid to write README.md files for all my
projects.

To achieve this I have come up with a Makefile to convert all .cbmd
files in a repository. This makes it much easier to get up and running
with a more automated workflow. I feel it is a must to convince all my
programmer friends that using Codebraid for this purpose is awesome. I
would love to see literate programming reach a wider audience.

I have been exploring the possibilites in this repo if you are curious.

Would you be interested in a PR with an example for this workflow?
Perhaps as a subfolder in the examples directory.

Makefile:

CODEBRAID_DOCS := $(shell find . -name '*.cbmd')
MARKDOWN_DOCS = $(CODEBRAID_DOCS:.cbmd=.md)

.PHONY: cbmd watch

# Must cd into the target file directory so Pandoc and Codebraid are
# able to use relative paths as one would expect
%.md : %.cbmd
	cd $(@D); codebraid pandoc --from markdown --to gfm --filter=mermaid-filter --output $(notdir $@) --overwrite $(notdir $^)

cbmd : $(MARKDOWN_DOCS)

watch :
	find . -name '*.cbmd' | entr make cbmd
@staticaland staticaland changed the title Proposal for adding programmer oriented Makefile example Proposal for adding developer oriented Makefile example May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant