Skip to content

Commit

Permalink
improved README.md conversation for Pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Jun 2, 2022
1 parent 4fddb89 commit 9c94647
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion moptipy/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""An internal file with the version of the moptipy package."""
from typing import Final

__version__: Final[str] = "0.8.11"
__version__: Final[str] = "0.8.12"
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"rt", encoding='utf-8-sig') as reader:
old_lines = reader.readlines()

# It seems that the myst parser now again drops the numerical prefixes of
# links, i.e., it tags `## 1.2. Hello` with id `hello` instead of
# `12-hello`. This means that we need to fix all references following the
# pattern `[xxx](#12-hello)` to `[xxx](#hello)`. We do this with a regular
# expression `regex_search`.
# It seems that the markdown parser does not auto-generate anchors. This means
# that we need to fix all references following the pattern `[xxx](#12-hello)`
# to `[xxx]({docu_url#hello)`, where `docu_url` is the url of our
# documentation. We do this with a regular expression `regex_search`.
new_lines = []
in_code: bool = False # we only process non-code lines
# detects strings of the form [xyz](#123-bla) and gives \1=xyz and \2=bla
regex_search = re.compile("(\\[.+?])\\(#\\d+-(.+?)\\)")
regex_repl: str = "\\1(https://thomasweise.github.io/moptipy/index.html#\\2)"
license_old: str = "https://github.com/thomasWeise/moptipy/blob/main/LICENSE"
license_new: str = "https://thomasweise.github.io/moptipy/LICENSE.html"
for line in old_lines:
Expand All @@ -31,7 +31,7 @@
in_code = True # toggle to code
else: # fix all internal urls
# replace links of the form "#12-bla" to "#bla"
line = re.sub(regex_search, "\\1(#\\2)", line)
line = re.sub(regex_search, regex_repl, line)
line = line.replace(license_old, license_new)

new_lines.append(line)
Expand Down

0 comments on commit 9c94647

Please sign in to comment.