diff --git a/README.md b/README.md index 8c0ea4f..af5f4f5 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Basic usage: It's suggested you use a file extension other than .markdown or .md for the input file. .mdp is the one the developer uses. -mdpre uses stdin and stdout so you can use this as part of a pipeline. It also uses stderr for all messages. Verbose mode (`-v`) gives you lots of messages. For syntax help use `-h`. +mdpre uses stdin and stdout so you can use this as part of a pipeline. +It also uses stderr for all messages. +Verbose mode (`-v`) gives you lots of messages. +For syntax help use `-h`. -Latest release (v0.5) is [here](https://github.com/MartinPacker/mdpre). +Latest release (v0.6.9) is [here](https://github.com/MartinPacker/mdpre). diff --git a/changelog.log b/changelog.log index 756ef4a..451fd37 100644 --- a/changelog.log +++ b/changelog.log @@ -1,15 +1,16 @@ -mdpre Markdown Preprocessor v0.6.8 (8 March, 2024) -================================================== +mdpre Markdown Preprocessor v0.6.9 (17 September, 2024) +======================================================= - opened for writing -Def mdpre_date = 8 March, 2024 -Def mdpre_level = 0.6.8 +Def mdpre_date = 17 September, 2024 +Def mdpre_level = 0.6.9 Def userid = martinpacker -Def time = 15:30 -Def date = 8 March, 2024 +Def time = 10:25 +Def date = 17 September, 2024 This Is The Change Log For mdpre Markdown Preprocessor Table Of Contents - spec '2 2 Releases' 2 2 Releases +..... ..... v0.6.9 - 17 September, 2024 ..... ..... v0.6.8 - 8 March, 2024 ..... ..... v0.6.7 - 17 December, 2023 ..... ..... v0.6.6 - 30 November, 2023 @@ -32,7 +33,7 @@ Table Of Contents - spec '2 2 Releases' ..... ..... v0.2 - 26 March, 2018 ..... ..... v0.1 - 17 March, 2018 ..... ..... v0.0 - 12 March, 2018 --------------------------------------------------- +------------------------------------------------------- - Processing completed. --------------------------------------------------- +------------------------------------------------------- diff --git a/changelog.md b/changelog.md index c4d92c8..e5a40ab 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,10 @@ +### v0.6.9 - 17 September, 2024 + +* **FIXED** Used a test for `userid` variable that shouldn't break on Ubuntu - [Issue 26](https://github.com/MartinPacker/mdpre/issues/26) +* **FIXED** Used raw strings for parsing CSV-related control lines - [Issue 27](https://github.com/MartinPacker/mdpre/issues/27) ### v0.6.8 - 8 March, 2024 diff --git a/changelog.mdp b/changelog.mdp index b0f48cd..952e842 100644 --- a/changelog.mdp +++ b/changelog.mdp @@ -3,6 +3,10 @@ =toc 2 2 Releases +### v0.6.9 - 17 September, 2024 + +* **FIXED** Used a test for `userid` variable that shouldn't break on Ubuntu - [Issue 26](https://github.com/MartinPacker/mdpre/issues/26) +* **FIXED** Used raw strings for parsing CSV-related control lines - [Issue 27](https://github.com/MartinPacker/mdpre/issues/27) ### v0.6.8 - 8 March, 2024 diff --git a/mdpre b/mdpre index bebf906..7e7567f 100755 --- a/mdpre +++ b/mdpre @@ -33,8 +33,8 @@ from enum import Enum import calendar -mdpre_level = "0.6.8" -mdpre_date = "8 March, 2024" +mdpre_level = "0.6.9" +mdpre_date = "17 September, 2024" banner = "mdpre Markdown Preprocessor v" + mdpre_level + " (" + mdpre_date + ")" log = partial(print, file=sys.stderr) # | create log to stderr @@ -342,13 +342,13 @@ def intTryParse(value): return value, False -def parse_colalign(colString, p_separator="\s+"): +def parse_colalign(colString, p_separator = r"\s+"): cs = colString.rstrip().lstrip() return re.split(p_separator, cs) -def parse_colwidth(colString, p_separator="\s+"): +def parse_colwidth(colString, p_separator = r"\s+"): cs = colString.rstrip().lstrip() colwidths = re.split(p_separator, cs) colwidthInt = [] @@ -358,7 +358,7 @@ def parse_colwidth(colString, p_separator="\s+"): return colwidthInt -def parse_calstart(calString, p_separator="\s+"): +def parse_calstart(calString, p_separator = r"\s+"): d = calString.rstrip().lstrip() ym = re.split(p_separator, d) @@ -370,7 +370,7 @@ def parse_calstart(calString, p_separator="\s+"): return (int(ym[0]), int(ym[1]), cal_cellHeight) -def parse_caldays(spanString, cal_spans, p_separator="\s+"): +def parse_caldays(spanString, cal_spans, p_separator = r"\s+"): sp = spanString.rstrip().lstrip() words = re.split(p_separator, sp) @@ -1187,7 +1187,10 @@ def setupStandardVariables(): input_file.insert(0, "=def date " + runDate + " ") input_file.insert(0, "=def time " + runTime + " ") - input_file.insert(0, "=def userid " + os.getlogin() + " ") + + username = os.getenv('USER') or os.getenv('LOGNAME') or os.getenv('USERNAME') + input_file.insert(0, "=def userid " + username + " ") + input_file.insert(0, "=def mdpre_level " + mdpre_level + " ") input_file.insert(0, "=def mdpre_date " + mdpre_date + " ")