Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Removing leading newline in code block #117

Merged
merged 2 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tmp/help.txt: drone-cache

tmp/make_help.txt: Makefile
-mkdir -p tmp
$(Q) awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " %-15s\t %s\n", $$1, $$2 }' $(MAKEFILE_LIST) &> tmp/make_help.txt
$(Q) awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " %-15s\t %s\n", $$1, $$2 }' $(MAKEFILE_LIST) &> tmp/make_help.txt

README.md: tmp/help.txt tmp/make_help.txt $(EMBEDMD_BIN)
$(EMBEDMD_BIN) -w README.md
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ $ docker run --rm \
## Development

[embedmd]:# (tmp/make_help.txt)
Copy link
Contributor Author

@spier spier May 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakkoyun what does this do? I wonder if this has to do with the extra newline that I am seeing ahead of this code block.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably that's the reason. This an annotation for a tiny program (https://github.com/campoy/embedmd) that we run to embed code pieces or generated things into markdown files. It's quite handy. Especially for the dynamic content. You can find the detailed usage in the Makefile.

drone-cache/Makefile

Lines 66 to 68 in 3172b74

tmp/make_help.txt: Makefile
-mkdir -p tmp
$(Q) awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make <target>\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " %-15s\t %s\n", $$1, $$2 }' $(MAKEFILE_LIST) &> tmp/make_help.txt

Copy link
Contributor

@kakkoyun kakkoyun May 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you remove the leading \n in printf statement, it should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It doesn't look like we are generating any dynamic help text here at all, are we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the \n now as you suggested.

However I don't understand how this is working.
I ran make README.md however that lead to a duplicate code block in the ## Development section.

You see me a bit confused :)

```txt

```txt
Usage:
make <target>

Expand Down