Initial commit

This commit is contained in:
François Pelletier 2024-01-08 10:18:32 -05:00
commit 75f7a2d742
6 changed files with 50 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/.idea/

7
LICENSE Normal file
View file

@ -0,0 +1,7 @@
Copyright 2024 François Pelletier
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1
README.md Normal file
View file

@ -0,0 +1 @@
# Convert Markdown output from Freeplane to Markdown lists

0
__init__.py Normal file
View file

19
markdown-fix-freeplane.py Normal file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env python
import re
import sys
# %%
def replace_title_with_list(text):
text = re.sub(r'#(#+)\s*(.*)', r'\1- \2', text)
text = re.sub(r'#', ' ', text)
return text
def __main__():
# read file passed as argument
with open(sys.argv[1], 'r') as my_file:
text = my_file.read()
print(replace_title_with_list(text))

22
pyproject.toml Normal file
View file

@ -0,0 +1,22 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "markdown-fix-freeplane"
version = "0.0.1"
authors = [
{ name="François Pelletier", email="francois@jevalide.ca" },
]
description = "Convert Markdown output from Freeplane to Markdown lists"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
[project.urls]
Homepage = "https://git.jevalide.ca/partage/markdown-fix-freeplane"
Issues = "https://git.jevalide.ca/partage/markdown-fix-freeplane/issues"