Przeglądaj źródła

Merge pull request #855 from infosiftr/edit-warnings

Add (and later strip) a nice warning at the top of README.md about it being auto-generated
yosifkit 8 lat temu
rodzic
commit
e7f26def17
2 zmienionych plików z 19 dodań i 0 usunięć
  1. 16 0
      .template-helpers/template.md
  2. 3 0
      push.pl

+ 16 - 0
.template-helpers/template.md

@@ -1,3 +1,19 @@
+<!--
+
+********************************************************************************
+
+WARNING:
+
+    DO NOT EDIT "%%REPO%%/README.md"
+
+    IT IS AUTO-GENERATED
+
+    (from the other files in "%%REPO%%/" combined with a set of templates)
+
+********************************************************************************
+
+-->
+
 # Supported tags and respective `Dockerfile` links
 
 %%TAGS%%

+ 3 - 0
push.pl

@@ -60,6 +60,9 @@ sub prompt_for_edit {
 	my $proposedText = slurp $proposedFile or warn 'missing ' . $proposedFile;
 	$proposedText = trim(decode('UTF-8', $proposedText));
 	
+	# remove our warning about generated files (Hub doesn't support HTML comments in Markdown)
+	$proposedText =~ s% ^ <!-- .*? --> \s* %%sx;
+	
 	if ($lengthLimit > 0 && length($proposedText) > $lengthLimit) {
 		# TODO https://github.com/docker/hub-beta-feedback/issues/238
 		my $fullUrl = "$githubBase/$proposedFile";