From 3060842731be45ab6cd777d85cf4e1fd2bed59e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Nowak Date: Sat, 11 Jun 2022 15:55:23 +0200 Subject: [PATCH] =?UTF-8?q?webgen=20v4.0.2=20+=20Leere=20Zeile=20eingef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webgen.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/webgen.py b/webgen.py index 3ccac4d..cd7d427 100755 --- a/webgen.py +++ b/webgen.py @@ -52,6 +52,9 @@ def edit(headline): if not editor: editor = "vim" subprocess.call([editor, headline]) +# spellcheck = os.getenv("SPELLCHECK") +# if spellcheck: +# subprocess.call([spellcheck, " -c ", headline]) return headline @@ -92,7 +95,7 @@ def selectfile(): headline = re.sub("\.md$", "", tabelle[int(ausgewaehlt[1])][1]) print(headline) -# a = input(yellow + "What do we dooo here?") + # a = input(yellow + "What do we dooo here?") # if the searched filename doesnt match an existing file we construct a new one if len(glob.glob(sourcedir + headline + ".md")) == 0: @@ -110,6 +113,7 @@ def selectfile(): return sourcefile, targetfile, headline + def mkdirindex(filesdir, indexfilename, filesdirheadline): """Dig the files-directory and generate an index.""" @@ -127,7 +131,7 @@ def mkdirindex(filesdir, indexfilename, filesdirheadline): body1 += '
Some files. Maybe useful or not.
' body1 += '' foot = "

You can't avoid chaos.

\n" - linecounter=0 + linecounter = 0 dirindexfile = open(filesdir + indexfilename, "w") @@ -147,13 +151,12 @@ def mkdirindex(filesdir, indexfilename, filesdirheadline): line = str('' + str(file) + " " + sizestr + "") dirindexfile.write(line) - linecounter+=1 + linecounter += 1 dirindexfile.write(foot) return linecounter - # Parse arguments "--html", "--stdout" and "Some Headline" # there are 3 parameters. if --html is given, the fileending will be .html. # Else, if stdout is choosen there can be no fileending, but it will still contain html @@ -228,6 +231,7 @@ head1 = ( # Some fancy css for minimalistic terminal style + style_fn = '' head2 = "\n" body1 = 'Back
Moin

' @@ -249,7 +253,7 @@ if outfile != sys.stdout: print(outputfile) # Dig the files-directory and generate an index. -linecounter=mkdirindex(filesdir, indexfilename, filesdirheadline) -print("Dirindex in ",filesdir," has ", linecounter, "lines") +linecounter = mkdirindex(filesdir, indexfilename, filesdirheadline) +print("Dirindex in ", filesdir, " has ", linecounter, "lines") # Have a nice time.