Source code for examples.orgimport
"""Import some bookmarks stored in an org-mode format and display them."""
from loguru import logger
from magpie.data.testdata import data_file_path, programming_links_orgmode
from magpie.tools import orgimport
from magpie.util import pprint
[docs]
def main():
"""Import some bookmarks stored in an org-mode format and display them."""
bookmarks = orgimport.parse_file(data_file_path(programming_links_orgmode))
pprint(bookmarks)
# rprint(bookmarks)
# print all twigs that have notes so we can review them separately
for t in bookmarks.iter_twigs():
if t.notes:
logger.warning('-' * 120)
logger.warning(f'Notes for twig: {t}')
logger.warning(t.notes)
if __name__ == '__main__':
main()