Package: m2w
English|简体中文m2w: Markdown to WordPressAutomatically upload and update local markdown to WordPress based on REST API/Password via Python:star2::star2::star2: Welcome m2w 2.5!Chinese tutorial:Docker系列 WordPress系列 WordPress上传或更新Markdown的最佳实践-m2w 2.0Table of Contentsm2w: Markdown to WordPressTable of ContentsBackgroundInstallUsageEnable REST APIUse m2wDemoLOGTO-DORelated EffortsMaintainersContributingLicenseMoreBackgroundm2wis a tool for automatically uploading or updating local Markdown to WordPress via Python, based on REST API (2.5+) or Password.m2whas these features:Support REST API, which is safer then conventional password!Useconfig/user.jsonto maintain the user information in a little different way comparing withm2w 1.0.You can just keep your file structures locally as you like.You can manage lots of websites at the same time via multiplelegacy_*.json.All you need to deal with is a single python scriptmyblog.pyinstead of two (update.pyandupload.pyinm2w 1.0).Ignore repeated new markdown files for uploading (v2.2.4+)InstallMinicondais recommended to manage Python version and related dependencies.Here is the dependency:# Python versionpython_requires='>=3.7.6'# Dependenciesinstall_requires=["python-frontmatter>=1.0.0","markdown>=3.3.6","python-wordpress-xmlrpc>=2.3","httpx>=0.24.0"]After 2022-12-10,m2wwas uploaded ontoPyPi. To installm2w, just run this code in your shell/conda environment:pip install m2wYou can also directly downloadm2wfrom this repotory. The usage is exactly the same.You can specify version or resource when installingm2w:pipinstall-ihttps://pypi.org/simplem2w==2.5.12Generally, the latest version ofm2wis recommended.UsageEnable REST APIThis step is needed onlywhen you want to use the REST API mode.If any, please allow Application password of WordPress in Wordfence:Go to personal settings and add a new REST API:Please record the new REST API in a safe place. If you forget it or suspect its safety, please remove the old API and create a new one:Use m2wInstall m2w from PyPi or this Github repotory.Build amyblog.pyfile (or other names you like) in<path01>. Here is thedemo. Create<path02>/config/user.jsonand setpath_m2was<path02>inmyblog.py:path_m2w='<path02>'# Absolute path of m2w config folderDefine<path02>/config/user.json.  You can add many websites likeweb01!  Please go to thedemofor more details. Here are some interpretations:user.jsonfor REST API mode:"web01":{"domain":"https://domain-01.com","username":"username-01","application_password":"password-01","path_markdown":["E:/Github/m2w/@test/main","E:/Github/m2w/@test/main2"],"post_metadata":{"category":["test"],"tag":["test"],"status":"publish"},"path_legacy_json":"/config/legacy"}user.jsonfor Password mode:"web01":{"domain":"https://domain-01.com","username":"username-01","password":"password-01","path_markdown":["E:/Github/m2w/@test/main","E:/Github/m2w/@test/main2"],"post_metadata":{"category":["test"],"tag":["test"],"status":"publish"},"path_legacy_json":"/config/legacy"}domain, username, application_password/password:  The information of your WordPress site and account.application_passwordis REST API, andpasswordis the conventional passord of your account. if bothapplication_passwordandpasswordexit, onlyapplication_passwordis available for m2w.path_markdown: Add as much top folders as you want!post_metadata/path_legacy_json: Set default if you don't know what they are.Runmyblog.pylike:python<path01>/myblog.pyDemoThis demo is conducted in Win10 withVScode.As shown in the following GIF, all changed or brand-new markdowns can be automatically updated/upload via just a simple commandpython myblog.py!LOG2023-06-05: m2w 2.0 was frozen atv2.2.11. Enjoy m2w 2.5+ from now on!2022-12-14：m2w.pyis the same name asm2wpackage, which would bring some bugs. I change the name of the demo script asmyblog.py.2022-12-10：Uploadm2w 2to PyPi. You can installm2w 2with code (in Shell)  likepip install -i https://pypi.org/simple m2w. The project url ishttps://pypi.org/project/m2w.2022-12-08：Ignore repeated uploading of new markdown based on their file names. Update otm2w 2.2.4(Strongly recommended)!2022-12-06：Optimized parameter space of m2w, which make it more flexible. Update otm2w 2.2!2022-12-03：Brand-new m2w 2.0!2022-11-13：Add error control for theClientfunction, which is helpful to avoid legacy bugs if the connection to the WordPress website is not available.Before: Createm2wproject.TO-DODevelop GUI across OSRelated Effortsnefu-ljw/python-markdown-to-wordpressMaintainers@huangwb8ContributingFeel free to dive in!Open an issueor submit PRs. m2w follows theContributor CovenantCode of Conduct.@FoxSuzuranLicenseThis software depends on other packages that may be licensed under different open source licenses.m2w is released under the MIT license. SeeLICENSEfor details.MoreApplications similar to m2wnefu-ljw/python-markdown-to-wordpress: The root project of m2w!WordPressXMLRPCTools: Manage WordPress posts in Hexo way.markpress:  Write WordPress in Markdown in Your Favorite Text Editorwordpress-markdown-blog-loader: This utility loads markdown blogs into WordPress as a post. It allows you to work on your blog in your favorite editor and keeps all your blogs in git.