{"id":19874199,"url":"https://github.com/pythoninthegrass/convert_html_md","last_synced_at":"2025-03-01T01:23:19.807Z","repository":{"id":62839634,"uuid":"562563853","full_name":"pythoninthegrass/convert_html_md","owner":"pythoninthegrass","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-13T15:59:07.000Z","size":4503,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T16:50:30.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pythoninthegrass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pythoninthegrass"]}},"created_at":"2022-11-06T18:27:38.000Z","updated_at":"2023-01-31T20:51:06.000Z","dependencies_parsed_at":"2024-11-12T16:35:02.822Z","dependency_job_id":null,"html_url":"https://github.com/pythoninthegrass/convert_html_md","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"pythoninthegrass/python_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fconvert_html_md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fconvert_html_md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fconvert_html_md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoninthegrass%2Fconvert_html_md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythoninthegrass","download_url":"https://codeload.github.com/pythoninthegrass/convert_html_md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241301910,"owners_count":19940730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T16:22:17.760Z","updated_at":"2025-03-01T01:23:19.787Z","avatar_url":"https://github.com/pythoninthegrass.png","language":"Python","readme":"# convert_html_md\n\n## Summary\nExtended version of the [Nimbus HTML to Markdown gist](https://gist.github.com/pythoninthegrass/61b7d738e85c32cec9c867a7a4e07306). \n\nUses [pandoc](https://pandoc.org/) to convert HTML files with asset directories exported from Nimbus for use in other vendor-agnostic Markdown readers (cf. [UpNote](https://getupnote.com/)).\n\n**Table of Contents**\n* [convert_html_md](#convert_html_md)\n  * [Summary](#summary)\n  * [Setup](#setup)\n    * [Dependencies](#dependencies)\n  * [Usage](#usage)\n  * [TODO](#todo)\n  * [Further Reading](#further-reading)\n\n## Setup\n* Install\n    * [editorconfig](https://editorconfig.org/)\n    * [asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf)\n    * [poetry](https://python-poetry.org/docs/)\n\n### Dependencies\n`pip` comes with python by default and is sufficient to get up and running quickly. `asdf` is a wrapper for `pyenv` (among other runtimes) and takes care of python versions. `poetry` handles dependencies, virtual environments, and packaging.\n\n* `pip`\n    ```bash\n    # activate a new virtual environment\n    python3 -m venv .venv; . .venv/bin/activate; pip3 install --upgrade pip\n\n    # install dependencies\n    python3 -m pip install -r requirements.txt\n    ```\n* `asdf`\n    ```bash\n    # add python plugin\n    asdf plugin-add python\n\n    # install stable python\n    asdf install python \u003clatest\u003e  # 3.10.8\n\n    # uninstall version\n    asdf uninstall python latest\n\n    # refresh symlinks for installed python runtimes\n    asdf reshim python\n\n    # set working directory version (i.e., repo)\n    asdf local python latest\n\n    # set stable to system python\n    asdf global python latest\n    ```\n* `poetry`\n    ```bash\n    # Install\n    curl -sSL https://install.python-poetry.org | $(which python3) -\n\n    # Uninstall\n    export POETRY_UNINSTALL=1\n    curl -sSL https://install.python-poetry.org | $(which python3) -\n\n    # Change config\n    poetry config virtualenvs.in-project true           # .venv in `pwd`\n\n    # Install from requirements.txt\n    poetry add `cat requirements.txt`\n\n    # Update dependencies\n    poetry update\n\n    # Remove library\n    poetry remove \u003clib\u003e\n\n    # Generate requirements.txt\n    poetry export -f requirements.txt --output requirements.txt --without-hashes\n    ```\n* Poetry with `asdf`\n    ```bash\n    # Add poetry asdf plugin\n    asdf plugin-add poetry https://github.com/asdf-community/asdf-poetry.git\n\n    # Install latest version via asdf\n    asdf install poetry latest\n\n    # Set latest version as default\n    asdf global poetry latest\n\n    # Install via asdf w/version\n    ASDF_POETRY_INSTALL_URL=https://install.python-poetry.org asdf install poetry 1.2.2\n    asdf local poetry 1.2.2\n    ```\n\n## Usage\n* Virtual environment\n    ```bash\n    # source virtual environment (venv) from dependencies setup above\n    . .venv/bin/activate\n\n    # run program from top-level directory\n    python3 convert.py\n\n    # exit\n    deactivate\n    ```\n* Poetry\n    ```bash\n    # Run script and exit environment\n    poetry run python convert.py\n\n    # Activate virtual environment (venv)\n    poetry shell\n\n    # Run script\n    python convert.py\n\n    # Deactivate venv\n    exit  # ctrl-d\n    ```\n\n## TODO\n* ~~Document usage~~\n* Parallelize with `joblib`\n* Benchmark\n  * 3.10.8\n  * 3.11.0\n  * Pre/post-parallelization\n* [Open Issues](https://github.com/pythoninthegrass/convert_html_md/issues)\n\n## Further Reading\n[Convert Nimbus Notes HTML to Markdown for Joplin](https://gist.github.com/aolle/6e595650391deef79ffb1c9bb38fb6e9)\n\n[Python decorator to measure execution time - DEV Community 👩‍💻👨‍💻](https://dev.to/kcdchennai/python-decorator-to-measure-execution-time-54hk)\n\n[The Boilerplate for Logging in Python | by Ezz El Din Abdullah | Brainwave | Medium](https://medium.com/the-brainwave/the-boilerplate-for-logging-in-python-105952585f39)\n\n[Run Code after Your Program Exits with Python’s AtExit | by Mike Huls | Sep, 2022 | Towards Data Science](https://towardsdatascience.com/run-code-after-your-program-exits-with-pythons-atexit-82a0069b486a)\n\n[Replace multiple spaces with a single space in Python | bobbyhadz](https://bobbyhadz.com/blog/python-replace-multiple-spaces-with-single-space)\n\n[Python's zipfile: Manipulate Your ZIP Files Efficiently – Real Python](https://realpython.com/python-zipfile/#building-a-zip-file-from-a-directory)\n","funding_links":["https://github.com/sponsors/pythoninthegrass"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoninthegrass%2Fconvert_html_md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythoninthegrass%2Fconvert_html_md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoninthegrass%2Fconvert_html_md/lists"}