Skip to content

Commit

Permalink
v0.6.9 Bugfix - Issues 26, 27
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPacker committed Sep 17, 2024
1 parent fc1bfcd commit 83a588b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
17 changes: 9 additions & 8 deletions changelog.log
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@

mdpre Markdown Preprocessor v0.6.8 (8 March, 2024)
==================================================
mdpre Markdown Preprocessor v0.6.9 (17 September, 2024)
=======================================================
- opened <stdout> 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&colon;30
Def date = 8 March&comma; 2024
Def time = 10&colon;25
Def date = 17 September&comma; 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
Expand All @@ -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.
--------------------------------------------------
-------------------------------------------------------

4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions changelog.mdp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions mdpre
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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 + " ")

Expand Down

0 comments on commit 83a588b

Please sign in to comment.